PhoneGap 3.x Android - Native Popup/Dialog Theme - android

I have a PhoneGap 3.1 project running on Android which is working fine - compiled with Android API lvl. 19. However, the native dialogs/alerts are using the Froyo/Android 2.x look and feel, whereas I'd like them to use the ICS/Android 4.x look and feel. In an older version of my , I did manage to get the dialog theme using ICS by updating the targetSDKVersion in AndroidManifest.xml. However, this has not worked in my 3.1 project.
This is an example of how they look in the version of my app running PhoneGap 2.5:
This is an example of how they look in my app running PhoneGap 3.1:
I do believe this to be less of a PhoneGap issue, but more an Android Eclipse project setting. But I have the no idea what I need to change to fix this? Could someone advise please? Thanks!

Don't worry - fixed it myself. For those who want to know, there is the following tag set in the default manifest file. By default, this is set to:
android:theme="Theme.Black.NoTitleBar"
Changing it to the following fixed it:
android:theme="Theme.DeviceDefault"
Quite simple I guess :).
Update
As of org.apache.cordova.dialog v2.9.0, the guys on the Cordova project changed the Android source to contain a default theme value to a hard coded value, as follows:
new AlertDialog.Builder(cordova.getActivity(), AlertDialog.THEME_DEVICE_DEFAULT_LIGHT);
It is frustrating, but you can comment out this line and replace it with:
new AlertDialog.Builder(cordova.getActivity());
To restore previous behaviour and have Cordova use the value specified in AndroidManifest.xml.

Related

Flex setting -swf-version manually breaks NetGroup

I have a Fullscreen Immersive ane for a flex mobile android application where I have to set -swf-version=28 to make it compile. Once I do this, the code for my peer2peer communication breaks.
NetConnection.Connect.Success fires then I set up a GroupSpecifier and NetGroup where NetGroup.Connect.Success also fires.
NetGroup.Neighbor.Connect is the event which isn't triggered anymore.
Two questions:
Why do I have to set the -swf-version manually to use the ane?
(included native extension 'com.mesmotronic.ane.fullscreen' includes a SWF version 28 which is greater than the version of the root SWF of this application: 14)
Why does the NetGroup break when I change the swf version?
Thanks in advance for any help
By forcing the newer SDK with the additional compiler argument I of course used a newer SDK. Using the same SDK for the Server Application did the trick. Messaging is working again.
Also I switched to Apache SDK so I don't need the additional argument anymore.

Example NetworkUsage Android Code Crashes On Startup?

I am trying to run the example application in the networkusage.zip file on the Android Developers website (location: http://developer.android.com/training/basics/network-ops/index.html).
I have not made any changes to the code whatsoever. However, it crashes immediately on startup. I have tried setting a breakpoint in the onCreate method of the main activity, but it never gets there....just crashes right away.
I am just starting with Android, but I been able to complete other training sessions and run other example apps, so I believe my configuration works. I am running Windows 7, with Eclipse Juno and the very latest JDK and Android SDK/ADT (both downloaded about a week ago).
I am using an emulator targeting Android 4.1 (API 16).
The emulator shows a messages that says Unfortunately, NetWork Usage has stopped working.
Any help would be greatly appreciated!!
In AndroidManifest.xml file, for this project, substitute absolute android:name for NetworkActivity with relative one.
In other words, change this line:
android:name="com.example.networkusage.NetworkActivity"
to look like this:
android:name=".NetworkActivity"
The problem was that NetworkActivity is not in com.example.networkusage (as was in AndroidManifest.xml file), but in com.example.android.networkusage package. Thus, Android couldn't find the class on runtime.

Scrolling Performance in WebView for Android - Jelly Bean 4.1.x

I'm working on a PhoneGap project and I've noticed that in Jelly Bean (4.1.x), scrolling is laggy and slow. I've tried to add transform3d to the scrollable elements but that didn't help. I can't add hardwareAccerlerated to the manifest because we need to support 2.3.x.
Any suggestions on how to make the WebView scroll better on Android? I've stripped out all the CSS to make it basic.
This occurs on 2.0.0 of PhoneGap.
You can see a video of this here: https://www.dropbox.com/s/j17do2gry8vxhzo/scrollvdeo.mov
I figured you the issue. You need to set the target for your application to 3.0, and then set the minSDK attribute in our manifest file to be your lowest support OS. Then add android:hardwareAccelerated=true to the manifest. Worked like a charm!
What caused this BUG for me was that I was using the phonegap android example (/phonegap/lib/android/example) which has the hardwareAccerlerated=true in the WRONG place in the AndroidManifest.xml.
It SHOULD be in the application element instead of the manifest element
Now this works like a charm.
I'm using Phonegap 2.1
The android developer site below references this as well. Made use of the attribute and it works brilliantly!
http://developer.android.com/guide/topics/graphics/hardware-accel.html

Phonegap App crashes unexpectedly on startup after update from 1.4.1 to 1.9.0

I just excavated a maybe 3 months old Phonegap (for Android) project from my archives. Since I always had little problems with the sound API (sounds playing twice or not stopping - the rest was working just fine) I thought it might be a good idea to update to the latest version of Phonegap / now Cordova, which currently is 1.9.0. Unfortunately the app now crashes on startup (telling me it was forced to stop unexpectedly in an alert box) in all devices that I can test on (virtual and real handsets).
I guess I might have forgotten something in the update process so I'll just list what I actually did during the update:
replaced the JAR file to 1.9.0
replaced the JS library to 1.9.0 (and replaced the reference in the index.html
Edited my AndroidManifest.xml to match this page
Replaced the plugins.xml content with the new version
Replaced the phonegap.xml in the resfolder by the new cordova.xml
changed the imports in the main AppActivity.java file
Updated the all the SDK packages in Eclipse
Somehow this doesn't seem to suffice.
Did I just miss something that still needs to be done or is this some problem with something that I am doing inside my app? I didn't use any Cordova API except for playing Sounds.
minSdkVersion is 8 by the way.
Ok, so what did the trick (kind of) for me was to create a new Project in Eclipse, set it up the exact same way and just incorporate my www folder into the new project.
The two projects look exactly the same but lord only knows that I probably have missed something. In case anyone still has input on this, don't hesitate to share it!

android 2.2 to 1.6?

I have been developing an android app. I had chosen 2.2 as the version. I have not used any advanced features that are specific to 2.2 or above. I want my app to work with 1.6 and above. What should I do?
Thanks.
You should read this http://developer.android.com/guide/publishing/versioning.html
Complement preview answers.
android make upward compatible your code automatically as much as possible (not always).
But lowering the api level of an app. Can be a task from simple to nightmare to execute, all depends if your code use a lot of specific 2.2 ...
That's means changing API level or android.jar in your project may be far to be enough.
good luck
Open the AndroidManifest.xml file and change to :
<uses-sdk android:minSdkVersion="4"/>
At first you should set android:minSdkVersion="4" in the Android Manifest file.
Next step is to do some testing on an android vm with version 1.6.
Even better would be to test on a real device, but the compiler should give you enough hints what to change in your program.

Categories

Resources