Tuesday, July 30, 2013

Android, OpenGL ES 3.0, GPU

Previously, I've posted OpenCL GPU supported. You can see that mobile GPU is going to be more powerful and more efficient.
When investigating the OpenGL related information, I found that OpenGL ES 3.0 is started to be supported by many GPU vendors. Also, Android 4.3 is released with OpenGL ES 3.0.
Before you are going to creating OpenGL ES 3.0 app, first, you have to know which mobile GPUs that support OpenGL ES 3.0.
Below is the list that I found, also with the chip:

  1. Imageon Adreno 300 series
  2. Mali T-600 series
  3. PowerVR Series 6 (Rogue)
  4. Tegra 4 (WhitePaper PDF)

Please let me know if you know more.
Thanks for watching :)

To check OpenGL ES version on your device, click here.

Friday, July 26, 2013

Android OS History - Big changes

After developing Android app for two years, I figured out Android OS has became better and better. Indeed, I found the history and figured out the big changes for each version. See below for these big changes.
Beta: 5 November 2007, as Android birthday date.

  1. v1.0
    • Support camera.
    • Support Wifi.
    • Support Bluetooth.
  2. v1.1
    • HTC Dream, as first Android device.
  3. v1.5, Cupcake
    • Support video record and playback in MPEG-4 & 3GP formats.
  4. v1.6, Donut
    • Support gesture touch.
  5. v2.0, Eclair
    • Support Bluetooth 2.1.
    • Support more screen size.
    • Improve gesture to multi-touch.
  6. v2.0.1, Eclair
  7. v2.1, Eclair
  8. v2.2-2.2.3, Froyo (frozen yogurt)
    • Improve speed, memory, performance.
    • Use JIT compilation.
    • Support Adobe Flash.
  9. v2.3-2.3.2, Gingerbread
    • Support NFC.
    • Support AAC encode.
    • Support more sensors (gyroscopes and barometer).
    • Improve power management.
    • Improve audio, graphical, input for gaming.
    • Change ext4 file system from YAFFS.
  10. v2.3.3-2.3.7, Gingerbread
    • Improve battery efficiency.
  11. v3.0, Honeycomb
    • Change new UI (systembar, actionbar).
    • Support hardware acceleration.
    • Support multicore processors.
    • Note: for Xoom only.
  12. v3.1, Honeycomb
    • Support Open Ancessory (USB).
    • Support FLAC audio playback.
  13. v3.2, Honeycomb
    • Support GoogleTV.
    • Improve tablet support.
  14. v4.0-4.0.2, IceCream Sandwich
    • Support WiFi Direct.
    • Support WebP image format.
    • Improve video record to 1080p.
    • Note: Theoratically compatible for 2.3.x devices.
  15. v4.0.3-4.0.4, IceCream Sandwich
  16. v4.1, JellyBean
    • Improve rendering performance to 60fps (Project Butter).
    • Improve audio to multichannel.
    • Support video and audio decoder/encoder on Java SDK.
    • Change Chrome as default browser.
    • Remove Adobe Flash.
  17. v4.2, JellyBean
    • Support Wireless display (miracast).
  18. v4.3, JellyBean
    • Support OpenGL ES 3.0.
    • Support MediaMuxer.
    • Improve MediaCodec Encoder.

Reference: http://en.wikipedia.org/wiki/Android_version_history

Thursday, July 25, 2013

Download image as Bitmap

Sometimes, we need to download image and show to ImageView.
Therefore, it needs some Http API to do so.
Below is the code of how to download image using Http API and set it as Bitmap.

Bitmap downloadBitmap(String link) {
try {
URL url = new URL(link);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.connect();
InputStream input = connection.getInputStream();
Bitmap myBitmap = BitmapFactory.decodeStream(input);

return myBitmap;
} catch (IOException e) {
e.printStackTrace();
Log.e("getBmpFromUrl error: ", e.getMessage().toString());
return null;
}
}

To use it, you NEED to create a thread because it is restricted on using Http on UI thread.

Thread t = new Thread(new Runnable() {
@Override
public void run() {
Bitmap getdownload = downloadBitmap("http://lh5.ggpht.com/_hepKlJWopDg/TB-_WXikaYI/AAAAAAAAElI/715k4NvBM4w/s144-c/IMG_0075.JPG");
Log.e("", getdownload.getWidth()+" "+getdownload.getHeight());
}
});
t.start();

At last, don't forget to set INTERNET permission.

<uses-permission android:name="android.permission.INTERNET"/>

Adding source code syntax highlight

To do so, you just need to include the codes below into your template by editing the Template from Edit HTML.

<link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css">
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css">
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript">
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'/>
<script language='javascript'>
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.all();
</script>

This is using SyntaxHighlighter extension. Thanks to Alex Gorbatchev.

Sunday, July 14, 2013

Android, OpenCL, GPU

GPU, Graphics Processing Unit, is the master of the graphics performance on our Android device.It plays an important role when playing games, playing high quality video (HD), and even showing smooth UI. Therefore, it needs to support many rendering libraries, like OpenGL ES, OpenCV, OpenVG, etc.
It seems that GPU on our Android device is performing the same role as our VGA on PC. But, Android is just growing faster recently, so do all GPUs device support all those libraries?
After investigating by reading lots of articles, etc, I figured out that GPU on our Android device are still limited. Few GPUs supports OpenCL library. And what does OpenCL really do?
OpenCL, Open Computing Language, is recently used for non-graphical computing, like image processing, vector computation, matric computation, etc. See sample from Nvidia for more details by clicking here.
Here are Android GPUs that support OpenCL.
  1. Qualcomm (Adreno 300 series)
    • Devices (Snapdragon S4 GPU):
      • Asus PadFone 2, HTC Droid DNA, HTC J Butterfly, LG Optimus G, Nexus 4, Sony Xperia UL, Sony Xperia Z, Sony Xperia ZL, Sony Xperia ZR, Xiaomi MI-2.
  2. ARM (Mali-T600 series)
  3. PowerVR (Series 5XT, SGXMP)
And, there is one GPU that is still not supported OpenCL.
  1. Nvidia Tegra (GeForce ULP)
Inside the list, we could see that mostly GPU vendors are already supported OpenCL inside their newest GPU. But it seems that Nvidia is still thinking on adding OpenCL supports, why? In my opinion, it seems that Nvidia still wants to add CUDA supports for Android (CUDA 5.5 is now supporting ARM).

[ROM] Samsung S7 Stock Firmware BRI (Taiwan台灣)

Latest ROM: G930FXXU1DQEU Download: https://kfhost.net/tpl/firmwares.php?record=B7E6DE774E3811E7963AFA163EE8F90B Reference: http://...