We are evaluating Delphi XE5 specifically to see how easy it is to develop mobile apps. We have developed a simple Android app that scrolls through a TClientDataset using a DBNavigator. The application comprises a few input fields, labels and slider controls (TSwitch).
Everything works ok and sliders (animations) are responsive, except on a Google Nexus 10 (Android 4.3) where everything happens in slow motion. It is like the app is still running in emulator mode. (A sliding button takes over 2 seconds to move from left to right!)
We have successfully tested the app on a Samsung Galaxy S3 (Android 4.1.2) and a HTC One (4.2.2) and the UI is as responsive as one would expect.
Update.
We asked the question at Code Rage 8 and they are referring it to the R&D Department. Will update when or if we get an answer.
I see mention of the screen resolution in comments. Has it actually been determined that it is the screen resolution that is the issue here?
Can you go into the developer options on the Nexus and try anything there that forces GPU usage or whatever might potentially help things along graphics-wise?
And is there anything clue-like in logcat? Run monitor.bat in the Android SDK tools directory or, if the path to it has spaces in, then that won't work so run ddms.bat instead from the same location (DDMS doesn't abort due to spaces in the path).
It would be good to get more evidence on the problem, rather than (educated) guesswork.
If it turns out to be screen size, well that will be interesting for Embo.
Related
I have developed an application which uses Cordova/Phonegap on Android to display Open Layers 3 maps.
It is quite similar to this project:
https://github.com/netgis/ol3
I have found that the application runs smoothly on the Samsung Note 4 running Kitkat V4.4.4, and runs fine on an old S2 running Jellybean (almost equally well in fact), but it runs terribly slowly on a bran new Galaxy Tab Pro 12.2 running KitKat V4.4.2.
I was wondering if there is any Cordova/Phonegap expert out there who might know why.
The only difference between them that I can see is the version of android! V4.4.4 and V4.4.2.
I have discovered threads on SO which generically say that WebView can be a problem and cause slow performance, but I'm getting great performance on my Note 4, and the S2 runs better than the tablet does using Jellybean.
I'm not sure code would be useful to show here, essentially I have a Cordova Android application with a single HTML document with Open Layers 3 map embedded, that's it.
The problem turns out to lie with WebView, which uses the default Android browser. For some reason this browser restricts CPU support if you're trying to use GPU acceleration (enabled by default), but doesn't provide GPU acceleration itself (it's really strange but true).
Apparently KitKat has this problem prior to Android V4.4.3. So if you're running V4.4.4 you won't encounter this performance problem as it has been fixed (as it uses Chromium instead of the default browser).
Here's one of many references I've found which corroborate this:
https://code.google.com/p/chromium/issues/detail?id=315111
Some devices haven't yet been updated to this level, here are my completely up to date devices:
The tablet uses Android V4.4.2
The S2 uses Android V4.0.2
The Note 4 uses Android V4.4.4
The S2 uses Jelly Bean and is therefore fine, the Note 4 uses the updated KitKat and also runs fine, but the tablet struggles with the application to such an extent it is unusable owing to it being below V4.4.3.
For me, the majority of suggested solutions on SO are to disable hardware acceleration, but these suggestions are unsuitable as my application really does require hardware acceleration to render maps efficiently.
The solution is to take this problem away completely by forcing the use of Chromium irrespective of the OS Version through the use of Crosswalk.
There are plenty of resources I've found to use Cordova in synergy with crosswalk:
https://crosswalk-project.org/documentation/cordova.html
https://blog.nraboy.com/2014/10/use-crosswalk-ionic-framework-android-apps/
I working on my first Android app (published on iOS and Windows Phone before). When testing the app on a Nexu 5 eveything works fine but on a Kindle Fire the app crashes:
java.lang.IllegalStateException: Cannot add header view to list -- setAdapter has already been called.
This is NOT about the exception itself. I could easily solve the problem by simple using listView.addHeaderView(...) before using listView.setAdapter(...). Not a big deal, but why does the same code runs without any problem on one device but crashes on the other?
I would understand the problem if the devices would use different Android/SDK versions but this is not the case. Both devices run Android 4.2.2 with SDK Level 17...
I would understand the problem if it would be related to something close to the hardware or some vendor specific system calls, but this not the case. It is just about setting up a ListView...
So, what is the difference?
Of course I have only a limited set of test devices. How can I be sure that the app will work on all devices that are running a supported SDK Level?
EDIT:
Of course one device is a phone and the other a tablet. To app uses different layouts for large screens at some places but problem also shows up in Activities/Fragments that have the same layout on both devices. Additionally no separated code for large devices is used. Using the same code and the same layout on both devices leads to a crash on the Kindle but runs on the Nexus...
I followed the documentation (http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html#application-development-with-static-initialization) to initialize opencv in static initialization and it is working well so far on my phone.
However, some of my friends who helped testing my app, says the performance is very bad when they use the 'photo enhancement' feature, where I used openCV to apply some adaptive threshold filtering to sharpen the text in the images (example here: How to use OpenCV to process image so that the text become sharp and clear?). I still couldn't figure out why is that so.
Phone models that I tried it on:
1) My phone (samsung galaxy s3) - smooth (instant)
2) friend no.1 (samsung galaxy s2) - smooth (instant)
3) friend no.2 (samsung galaxy s2) - super laggy (takes few seconds for UI to regain responsiveness)
4) friend no.3 (htc one) - super laggy (takes few seconds for UI to regain responsiveness)
5) friend no.4 (samsung galaxy s4) - super laggy (takes few seconds for UI to regain responsiveness)
I recalled that my phone and friend no.1's phone installed older version of my app before, where the app was still using async initialization method (and have to install OpenCV manager from play store in order to use) and I can't think of anything different between the phones tested above..
Does anyone has similar experience? Any advice on what to look for?
There's a number of reasons why this could be happening. To make a fair evaluation you would have to restore each device to it's factory settings and execute profiling/benchmarking tools to figure out what's going on.
For instance, the phones that were found to be super laggy:
Could have too many widgets running on your homescreen, thus causing the device’s performance to slow down;
Could be using different Android versions;
Could be using Live Wallpapers (which require extra CPU cicles to run);
Generally speaking, a device could be running other background processes that are stealing CPU processing away from your app.
There is an official document for Android developers with performance tips. It's pretty interesting to read. They recommend a few tools for measure the performance of an application:
Caliper for Java microbenchmarking;
Traceview for profiling;
Systrace to analyze how the execution of your application fits into the larger Android environment, letting you see system and applications process execution on a common timeline.
There's also a nice article on vogella.com about analyzing Android performance issues. It's a must-read!
My app runs with many devices but 2 users have send me simular images as below.
As far as I know the behaviour is only seen on Android 4.2.2 (Samsung S4).
On the full HD screen there seem to be 3 compressed tiles of 160x600 pixels.
I have tried an AVD with full HD screen but that fails to start.
On 4.03 devices I don't see this. I don't use tiles.
Does anybody have a hint what or where this goes wrong ?
This looks like a possible bug in the Android platform on Samsung's S4 devices with that particular Android version. My experience tells me that it's a very real possibility. It could also be that you do something wrong in your app that only causes actual problems on that version (and maybe even only on that device), but there is no indication of that from what you tell. Android 4.2.2 should be backwards compatible with 4.0.3, so in general it should work on the later version too, of course.
I would advice you (or anyone in the same situation) to try it out on other devices with the same Android version if possible. Also, double check that you're not violating anything in the Android API documentation.
Please add more info about what you're doing and how if you need more detailed answers. I guess you've probably found a solution or workaround by now, but still adding my answer here.
I am developing an app in Android that I hope to release. I've got most of my GUI done, but it does not look even close to correct on the device when installed and opened. I have a screenshot of how it looks, and a screengrab of how it should look (taken from the Emulator in Eclipse) at the links at the bottom of this post. It's best to take a look at the two images rather than me try to describe how screwed up the app becomes on my device.
I had a friend with the exact same device, including hardware and Android version, and his loads up just fine. Does anyone have any idea what's going on here? Both devices are Galaxy Nexuses, running Android 4.0.2, GSM on AT&T (unlocked).
Installed on my device: http://i.stack.imgur.com/x66Jo.png
In the emulator: http://i.stack.imgur.com/qE0J6.png
I've seen this occur in some Galaxy Nexus' and I put it down to a bug/glitch in the OS on that Galaxy Nexus. Try a Factory Reset of your Galaxy Nexus, if that fails, try reinstalling the current OS version you have (if you can get your hands on it), if that fails, get it fixed under warranty.
Does your app use multiple activities?
Can you compare on your two devices if this setting is the same?
Settings > Developer Options > Don't keep activities checkbox.
I realise this is an old question now but I was having the same problem as you and stumbled across a solution. I didn't particularly want to factory reset my phone as per straya's instructions, so I started playing around options in the Settings > Developer Options menu.
As it turns out, this problem occurs for some applications if you have the Force GPU rendering option checked. Disable this (I'm not sure why it was enabled anyway) and everything displays as it should.