Can I use renderscript in an application that is meant to be for android 2.2 and up?
Because I know that it has been used for wallpapers, but only internal. Did that change, because renderscript is public now?
I am building an application for the tablet, and i am writing it in renderscript, but i want to be able to release it for mobile phones as well. Porting the renderscript code to open gl es 2.0 or sth would be very very hard work for me.
Renderscript is a 3.0+ API only. Renderscript was present in 2.2 but the API (and language and compiler) changed a lot in 3.0.
Google has published a compatibility library for Renderscript, which allows you to use it starting from Android 2.2 (API8).
The disadvantage is that it uses the CPU unless the OS version is 4.3 and above.
more information about it is available on the android developers blog, here
Related
I have published an instant app, which can be downloaded from android marshmallow, nougat, etc. but openGL is only being rendered on android pie, the normal app works fine on all android versions, both APK's are the same actually it is an app bundle.
https://issuetracker.google.com/issues/132952558
Quoting the answer here so it helps others as well:
OpenGL ES 1.0 is only partially supported, we do not recommend you to
use this.
OpenGL ES 2.0 is fully supported for Instant Apps.
Additionally, OpenGL ES 3.0 is not supported on pre-O Instant Apps.
This was previously documented somewhere, but not anymore, so we’re
working on getting these details back in.
So, I'm current trying to learn and become a programmer. I've recently worked with C# but I really want to get into mobile apps, since most small projects really tend to fit better as mobile apps, rather than desktop apps.
The easiest, for me, seems to be the Android platform, but I'm having a problem... I don't own an android phone, but I could possibly purchase an old model. Naturally these will have an older version of Android, so here is my question...
How compatible are these different versions? Like, are there major differences when moving from Icecream Sandwich to Jelly Bean, or from KitKat to Lollipop?
How do app developers deal with this array of Android versions?
When you develop an app for an old version of Android, it will run without errors on all newer version of Android, unless you do something involving low-level stuff like direct kernel calls, but you will never encounter such issues if you only use Java.
Worst issue you'll see is your app visual style looking outdated on newer devices.
If you target API level 23 / Android 6.0 Marshmallow, you will still need to run your app on Android 6.0 emulator, to be sure that it won't crash when using new Android permission dialogs to ask for SD card access etc.
I am programming a native app on Android using Opencv4Android. I am using the Opencv Manager. At the staup of the app, I receive these logs:
But how to know if openCv is really using OpenCl for acceleration or not ?
Unfortunately Google dropped OpenCL support for Android, for quite a while. This was done in favor of RenderScript.
So the first thing to do is to check your OpenCL availability on your platform. You could use OpenCL-Z. The tool will likely tell you if OpenCL runtime is present and if it can use both the GPU and the CPU.
The fact that OpenCV4Android is compiled with OpenCL support means that you can use the OpenCL specific namespaces. So if your platform has OpenCL, and in your code you use OpenCL specific objects (e.g. oclMat) your native code will use OpenCL.
Finally, you cannot be sure what OpenCL device (GPU / CPU) will be used by the OpenCV implementation. You can browse through the source of OpenCV and see the specific implementation for your kernels, or you could use the system profilers that are available for your Android device, and watch for GPU and CPU activity.
Thanks to VAndrei, I am now sure that I was not using OpenCL. I was not using the ocl package. Moreover I then tried the ocl package but I got an error at running at the first ocl code line. Then I checked with OpenCl-z and it seems that OpenCL is not available on the device (Rk3188).
I am quite surprised by the performance of the system (ARM Cortex-A9). For these lines, with a resolution of 160x120 on grayscale:
cv::absdiff(_inputMat, _previousMat, _outputMat);
_inputMat.copyTo(_previousMat);
cv::GaussianBlur(_outputMat, _outputMat, cv::Size(3,3), 2.0, 2.0);
cv::threshold(_outputMat, _outputMat, 100, 255, 0);
the system requires ~1.5ms. That is why I was wondering if OpenCl was used or not. Seems that Rk3288 is supporting OpenCl. I will have to check the improvements on htis other system.
I'm a CS student and with my team we're going to realize an android application for our Software Engineering course. We're not Android developers and we using this opportunity to learn how to do it.
We know it's available the 3.0 version but that basically has tablets as target. Our target is smartphones, so the question is: should we stick with 2.3 or should we use 3.0 API.
I know the natural answer would be "2.3" but it's not really clear to us where "3.0" is going.
I would even go for 2.1 or 2.2 - 60% of the market uses 2.2, 20% 2.1 and 6% 2.3.
3.0 is atm only available for tablets - targeting this will limit your target market a lot, as no mobile handsets will have 3.0 any time soon.
See also this q&a: What version of Android should I develop for?
3.0 is the future, no doubt. But 3.0 is currently just available for some tablets. Almost all smartphones are currently using some 2.x version.
As you can see here, the version 2.1 and above are widely used. So I personally would target 2.1 and above.
Depends on your application's scope.
If you want to aim at as many people as possible, you should go for 2.1, or 2.2, if you don't use any specificity from the 2.3 SDK (NFC for example).
It is important to know that, because only about 10% of Android phones are running 2.3 (and even less I think). More than 70% have 2.1 or superior, so if your target is mass distribution, 2.1 would be nice. (You can develop an app under 2.3 SDK aiming at lower version as well, just add it in the manifest)
Otherwise, if your application is tablet-aimed, use 3.0. Otherwise go for 2.3.
I'm developing a simple app for Android-2.2. What are some key features that can make the app not work for 1.6?
That's a big topic. The move from 1.6 to 2.0 saw some pretty big changes and then there were some significant changes from 2.1 to 2.2. I would check out the Android 2.2 platform highlights to get an idea of what's new in 2.2 for starters. If you're building a "simple" app, I would imagine it will still work without much trouble. AFAIK, the biggest changes to the platform from a developer standpoint is the media framework additions. I would also check out the Android 2.0 platform highlights as well to get an idea of what changed from 1.6 to 2.0.