Posts

Showing posts with the label android

Gradle task for launching Android simulator

Android build toolchain, albeit being powerful, sometimes lacks some essential functionality required for the modern software development. In particular, running instrumented unit-tests in the CI environment: those tests require a device or a simulator running, however developers need some scripting to make it work. To simplify the task, I've created a Gradle task that verifies if any Android device or simulator is connected. If not, the task launches a simulator with the first AVD in the list (or fails if no AVDs are found). It's up to you to make the dependencies for the connectedCheck task. The sample output: > ./gradlew connect --info ... :AndroidSampleApp:connect (Thread[main,5,main]) started. :AndroidSampleApp:connect Executing task ':AndroidSampleApp:connect' (up-to-date check took 0.001 secs) due to:   Task has not declared any outputs. Detecting devices... Launching emulator for Nexus_5_API_25 ... :AndroidSampleApp:connect (Thread[main,5,main])...

Android screen capture with GIF format

GIF format is still here, and it's a handy way to make small videos. It's very easy to do despite of all ads telling us to buy their commercial software, and I'm going to describe the tools we need. First, we need to capture the video of the screen. For Android, you can use  ADV Screen Recorder , but surely there are tools for any platform. Please verify the recorder settings (you may want to disable mic recording and change the output folder to be on an external SD). Second, after we recorded the video, we need to convert it into GIF-format. For that we're going to use FFMpeg tool (on Mac, just use "brew install ffmpeg"). GIF uses 256 colors, so we need to create an auxiliary palette file. Therefore, the converting process takes two steps: 1) create a palette, 2) use a palette and an input file to create the output GIF. The commands for that: $ ffmpeg -i input.mp4 -vf fps=10,scale=320:-1:flags=lanczos,palettegen palette.png $ ffmpeg  -i input.mp4 -...

glSatellite Demo

Image
During my research for 3D graphics application development I've noticed that a lot of tutorials and advices on the Internet are obsolete, imcomplete or even incorrect. That's why I've decided to create an open source technological demo of OpenGL for Android platform. That's just a demo, so it doesn't have any particular useful purpose, but shows the methods and algorithms to accomplish certain tasks. For now the application reads public NORAD satellite database and shows the satellite positions and altitude related to Earth in the form of beams (the height of the beam represents the relative altitude). The 3D features present:  - OpenGL ES 2;  - rotating, multi-touch zooming and moving the globe;  - stars on a fixed background;  - each satellite is represented by a beam with a unique color;  - identifying the corresponding satellite if a beam has been tapped (based on color picking method). Additionally to 3D features presented the application is: ...