Reputation: 523
for the last month i have try to finish an app for mi android cel, when i finally finish i run using the virtual device and it work like i charm, how ever when i try to run using a real device the app starts but then show a black screen this is the first app y try using a real device and have no idea the reason for why in virtual device it works and not in a real device can anyone tell where i can find a reason for since the logcat in eclipse is not explicit of why it wont work.
this is the logcat when it wont works:
10-12 13:39:07.578: D/dalvikvm(9995): Late-enabling CheckJNI
10-12 13:39:07.593: I/dalvikvm(9995): Turning on JNI app bug workarounds for target SDK version 9...
10-12 13:39:08.188: D/dalvikvm(9995): GC_CONCURRENT freed 138K, 3% free 9507K/9735K, paused 2ms+2ms
10-12 13:39:08.488: D/AndroidRuntime(9995): Shutting down VM
10-12 13:39:08.488: W/dalvikvm(9995): threadid=1: thread exiting with uncaught exception (group=0x40c671f8)
10-12 13:39:08.498: E/AndroidRuntime(9995): FATAL EXCEPTION: main
10-12 13:39:08.498: E/AndroidRuntime(9995): java.lang.NumberFormatException: Invalid double: "350,32"
10-12 13:39:08.498: E/AndroidRuntime(9995): at java.lang.StringToReal.invalidReal(StringToReal.java:63)
10-12 13:39:08.498: E/AndroidRuntime(9995): at java.lang.StringToReal.parseDouble(StringToReal.java:269)
10-12 13:39:08.498: E/AndroidRuntime(9995): at java.lang.Double.parseDouble(Double.java:295)
10-12 13:39:08.498: E/AndroidRuntime(9995): at java.lang.Double.valueOf(Double.java:332)
10-12 13:39:08.498: E/AndroidRuntime(9995): at com.example.mezcla2.MainActivity$9.hoja1_Tb1(MainActivity.java:484)
10-12 13:39:08.498: E/AndroidRuntime(9995): at com.example.mezcla2.MainActivity$9.onItemSelected(MainActivity.java:444)
10-12 13:39:08.498: E/AndroidRuntime(9995): at android.widget.AdapterView.fireOnSelected(AdapterView.java:882)
10-12 13:39:08.498: E/AndroidRuntime(9995): at android.widget.AdapterView.access$200(AdapterView.java:48)
10-12 13:39:08.498: E/AndroidRuntime(9995): at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:848)
10-12 13:39:08.498: E/AndroidRuntime(9995): at android.os.Handler.handleCallback(Handler.java:605)
10-12 13:39:08.498: E/AndroidRuntime(9995): at android.os.Handler.dispatchMessage(Handler.java:92)
10-12 13:39:08.498: E/AndroidRuntime(9995): at android.os.Looper.loop(Looper.java:137)
10-12 13:39:08.498: E/AndroidRuntime(9995): at android.app.ActivityThread.main(ActivityThread.java:4518)
10-12 13:39:08.498: E/AndroidRuntime(9995): at java.lang.reflect.Method.invokeNative(Native Method)
10-12 13:39:08.498: E/AndroidRuntime(9995): at java.lang.reflect.Method.invoke(Method.java:511)
10-12 13:39:08.498: E/AndroidRuntime(9995): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
10-12 13:39:08.498: E/AndroidRuntime(9995): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
10-12 13:39:08.498: E/AndroidRuntime(9995): at dalvik.system.NativeStart.main(Native Method)
Upvotes: 0
Views: 139
Reputation: 11
First of all you must make sure that your physical device(phone) is enabled for the running android apps in areal device. steps:-
Upvotes: 0
Reputation: 35661
I suspect you are not allowing for the number formatting of different locales.
For example, in the UK a number would be written as 350.32 but in Spain it would be 350,32
Trying to use a specific number format when it is not supported by the locale would throw the exception you are experiencing.
Your device is likely using a locale that is not supported for the number you have used but your emulator is not.
The error is being thrown in an anonymous inner class (hoja1_Tb1) in your MainActivity. Line 484
EDIT:
Logcat Analysis:
Looking back through the logcat for code that is in your classes and not in a built in class.
com.example.mezcla2.MainActivity$9.onItemSelected(MainActivity.java:444)
then
com.example.mezcla2.MainActivity$9.hoja1_Tb1(MainActivity.java:484)
Then the code attempts to convert "something" to a Double.
This tells us that you have an inner class calling "onItemSelected" which then calls "hoja1_Tb1" at line 484
Then you get the actual error. Something at this location is trying to use a number that is not a valid number for the locale you are using.
The best thing you can do is learn how to read and interpret logcat. You have no hope of producing anything in code if you cannot find where you are going wrong.
Upvotes: 2