thobook2014 / ebookdroid

Automatically exported from code.google.com/p/ebookdroid
0 stars 0 forks source link

Use of libjnigraphics in android lower then 2.2 #258

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,
   Now, in ebookdroid, libjnigraphics is only used to access java bitmap datas in android higher then 2.1.

And I found that we can still use libjnigraphics in android lower then 2.2.

1. pull out /system/lib/libjnigraphics.so from any android image with version 
higher then 2.1.

2. put this libjnigraphics.so into lib folder

3. system.loadlibrary(jnigraphics) to manually load libjnigraphics for 2.1 or 
lower.

The reason that we can use libjnigraphics for 2.1 or lower is that in 
libjnigraphics.so, there are only three imported functions and all of them 
exist in all versions of android.

GraphicsJNI::getNativeBitmap
SkBitmap::lockPixels
SkBitmap::unlockPixels

Original issue reported on code.google.com by coolspac...@gmail.com on 18 Jul 2012 at 8:39

GoogleCodeExporter commented 9 years ago
Are you really interested in this tric?

Original comment by Alexander.V.Kasatkin@gmail.com on 18 Jul 2012 at 8:49

GoogleCodeExporter commented 9 years ago
why not.

method is easy. Then we can get lower memory use(do not need temp int array for 
pixel datas). And maybe a little bit speed up(no test yet)

Original comment by coolspac...@gmail.com on 18 Jul 2012 at 8:57

GoogleCodeExporter commented 9 years ago
Yes, but Android 2.1- distribution is lower than 5.5% according to Google. I do 
not think we should spend a lot of time on optimizing application for that 
android versions.

I agree in current case changes are small and possible will not have any impact 
on application stability, but backporting jnigraphics is undocumented. Also 
google has strait guidelines about extra libraries in the apk.

I think we should drop support of old android versions in future release. At 
least 1.5 with distribution 0.2% of devices.

Original comment by Andrei.K...@gmail.com on 19 Jul 2012 at 7:38

GoogleCodeExporter commented 9 years ago
The reason I talked about this is that NOOK Simple Touch only has android 2.1 
available. But, Yes, from the overral market, only a few devices running on 
android below 2.2.

This issue report can be closed now.

Thanks

Original comment by coolspac...@gmail.com on 23 Jul 2012 at 9:19

GoogleCodeExporter commented 9 years ago

Original comment by Andrei.K...@gmail.com on 2 Aug 2012 at 8:46