MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
12/18/12 04:36 PM (13 years ago)

Error going into one of my menu button screens

So I have a few 'Button Menus' in my app. One of them is for pictures. For some reason, when I go into the picture menu, my app crashes. I've updated the configuration data, and remade the picture menu. Still with the same results. Here is a link to my app uploaded to MediaFire: http://www.mediafire.com/?aou0yfv5llcp781 Thanks in advance!
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
12/18/12 10:04 PM (13 years ago)
Downloading now. Will report back soon:) ian
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
12/18/12 11:26 PM (13 years ago)
Hi MM2000, this is a v2.0 app correct? You are using the Image Gallery Plugin? When trying to Refresh the app it crashes When choosing Photo Gallery it crashes When choosing Social Media it crashes Can you see what Eclipse is telling you in LogCat for these errors? Let me know if you need help with tracking down the errors and we can fix from there. Keep me posted:) ian
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
12/19/12 07:39 AM (13 years ago)
It's an out of memory error. A possible solution is to reduce the image sizes, most of them appear to be over 1mb. Some similar issues are here: https://www.google.co.uk/#hl=en&safe=off&tbo=d&sclient=psy-ab&q=buzztouch+java.lang.OutOfMemoryError&oq=buzztouch+java.lang.OutOfMemoryError&gs_l=hp.3...12694.12694.1.14090.1.1.0.0.0.0.148.148.0j1.1.0.les%3B..0.0...1c.1.HA2e1chQlmY&pbx=1&bav=on.2,or.r_gc.r_pw.r_cp.r_qf.&bvm=bv.1355534169,d.d2k&fp=fc7fe2b45ce62c75&bpcl=40096503&biw=1024&bih=605 The logcat output: 12-19 14:20:13.760: D/libhardware_legacy(280): ***************** GPSC_RESULT_PROT_MEASUREMENT ********************** 12-19 14:20:13.760: D/gpsc_msg(150): p_zGPSCControl->p_zGPSCState->injectSvdirectionColdstart 0 12-19 14:20:13.760: D/gpsc_msg(150): ASYNC EVT: NO NEW POS 12-19 14:20:13.760: D/gpsc_msg(150): Status: EvtNoFix 12-19 14:20:13.760: D/gpsc_msg(150): Session Information: Session TagId=0xa0000fe Timeout but no good position 12-19 14:20:13.760: D/gpsc_msg(150): gpsc_send_position_result 12-19 14:20:13.760: D/gpsc_msg(150): Status: Timed Out 12-19 14:20:13.760: D/gpsc_msg(150): gpsc_populate_raw_pos: Lat=**, Lon=**, Ht=** 12-19 14:20:13.760: D/gpsc_msg(150): SessLog: [20121219142013.768]0x00000003:19, 1030.474162,90.717654,147.000000,132.253418,0.402850, #Position Lat, Lang, height, orientation, Speed 12-19 14:20:13.760: D/libhardware_legacy(280): ===>>> entryFunctionForHandler: Blocking on read - 2 12-19 14:20:13.760: D/libhardware_legacy(280): ***************** GPSC_RESULT_RAW_POSITION ********************** 12-19 14:20:13.760: D/gpsc_msg(150): ==>> gpsc_send_position_result: Current Pos mode is 1 <<== 12-19 14:20:13.760: D/gpsc_msg(150): w_SessionTagId = 167772414 12-19 14:20:13.760: D/gpsc_msg(150): s_NoSessions = 1 12-19 14:20:13.760: D/gpsc_msg(150): Status: Already present Node with TagId a0000fe or got a Local 12-19 14:20:13.760: D/gpsc_msg(150): Status: Tx Success Received 12-19 14:20:13.760: D/libhardware_legacy(280): ===>>> entryFunctionForHandler: Blocking on read - 2 12-19 14:20:13.760: D/libhardware_legacy(280): ***************** GPSC_RESULT_PROT_POSITION ********************** 12-19 14:20:13.760: D/libhardware_legacy(280): NO FIX REPORTED 12-19 14:20:13.760: D/libhardware_legacy(280): [GPS_INFO] lat=** lon=** alt=0.000000 acc=27.250137 12-19 14:20:13.760: D/libhardware_legacy(280): [GPS_INFO] speed=0.402850 bearing=334.462280 timestamp=1355926809000 flags=1c 12-19 14:20:13.760: D/dalvikvm(24259): GC_BEFORE_OOM freed 9K, 20% free 48367K/60131K, paused 42ms 12-19 14:20:13.760: E/dalvikvm-heap(24259): Out of memory on a 15282928-byte allocation. 12-19 14:20:13.760: I/dalvikvm(24259): "main" prio=5 tid=1 RUNNABLE 12-19 14:20:13.760: I/dalvikvm(24259): | group="main" sCount=0 dsCount=0 obj=0x40a5e490 self=0x2b39a8 12-19 14:20:13.760: I/dalvikvm(24259): | sysTid=24259 nice=0 sched=0/0 cgrp=default handle=1075070248 12-19 14:20:13.760: I/dalvikvm(24259): | schedstat=( 10039839000 3976726000 10050 ) utm=871 stm=132 core=1 12-19 14:20:13.760: I/dalvikvm(24259): at android.graphics.Bitmap.nativeCreate(Native Method) 12-19 14:20:13.760: I/dalvikvm(24259): at android.graphics.Bitmap.createBitmap(Bitmap.java:922) 12-19 14:20:13.760: I/dalvikvm(24259): at android.graphics.Bitmap.createBitmap(Bitmap.java:897) 12-19 14:20:13.760: I/dalvikvm(24259): at com.mm2000androidapp.BT_viewUtilities.getRoundedImage(BT_viewUtilities.java:360) 12-19 14:20:13.760: I/dalvikvm(24259): at com.mm2000androidapp.BT_screen_menuButtons.getButton(BT_screen_menuButtons.java:775) 12-19 14:20:13.760: I/dalvikvm(24259): at com.mm2000androidapp.BT_screen_menuButtons.layoutButtons(BT_screen_menuButtons.java:449) 12-19 14:20:13.760: I/dalvikvm(24259): at com.mm2000androidapp.BT_screen_menuButtons.parseScreenData(BT_screen_menuButtons.java:944) 12-19 14:20:13.760: I/dalvikvm(24259): at com.mm2000androidapp.BT_screen_menuButtons.onStart(BT_screen_menuButtons.java:238) 12-19 14:20:13.760: I/dalvikvm(24259): at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1195) 12-19 14:20:13.760: I/dalvikvm(24259): at android.app.Activity.performStart(Activity.java:4553) 12-19 14:20:13.760: I/dalvikvm(24259): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198) 12-19 14:20:13.760: I/dalvikvm(24259): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2260) 12-19 14:20:13.760: I/dalvikvm(24259): at android.app.ActivityThread.access$600(ActivityThread.java:139) 12-19 14:20:13.760: I/dalvikvm(24259): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277) 12-19 14:20:13.760: I/dalvikvm(24259): at android.os.Handler.dispatchMessage(Handler.java:99) 12-19 14:20:13.760: I/dalvikvm(24259): at android.os.Looper.loop(Looper.java:156) 12-19 14:20:13.760: I/dalvikvm(24259): at android.app.ActivityThread.main(ActivityThread.java:5045) 12-19 14:20:13.760: I/dalvikvm(24259): at java.lang.reflect.Method.invokeNative(Native Method) 12-19 14:20:13.760: I/dalvikvm(24259): at java.lang.reflect.Method.invoke(Method.java:511) 12-19 14:20:13.760: I/dalvikvm(24259): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 12-19 14:20:13.760: I/dalvikvm(24259): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 12-19 14:20:13.760: I/dalvikvm(24259): at dalvik.system.NativeStart.main(Native Method) 12-19 14:20:13.770: E/dalvikvm(24259): Out of memory: Heap Size=60131KB, Allocated=48367KB, Limit=65536KB 12-19 14:20:13.770: E/dalvikvm(24259): Extra info: Footprint=60131KB, Allowed Footprint=60131KB, Trimmed=2952KB 12-19 14:20:13.770: D/AndroidRuntime(24259): Shutting down VM 12-19 14:20:13.770: W/dalvikvm(24259): threadid=1: thread exiting with uncaught exception (group=0x40a5d228) 12-19 14:20:13.770: E/AndroidRuntime(24259): FATAL EXCEPTION: main 12-19 14:20:13.770: E/AndroidRuntime(24259): java.lang.OutOfMemoryError: (Heap Size=60131KB, Allocated=48367KB) 12-19 14:20:13.770: E/AndroidRuntime(24259): at android.graphics.Bitmap.nativeCreate(Native Method) 12-19 14:20:13.770: E/AndroidRuntime(24259): at android.graphics.Bitmap.createBitmap(Bitmap.java:922) 12-19 14:20:13.770: E/AndroidRuntime(24259): at android.graphics.Bitmap.createBitmap(Bitmap.java:897) 12-19 14:20:13.770: E/AndroidRuntime(24259): at com.mm2000androidapp.BT_viewUtilities.getRoundedImage(BT_viewUtilities.java:360) 12-19 14:20:13.770: E/AndroidRuntime(24259): at com.mm2000androidapp.BT_screen_menuButtons.getButton(BT_screen_menuButtons.java:775) 12-19 14:20:13.770: E/AndroidRuntime(24259): at com.mm2000androidapp.BT_screen_menuButtons.layoutButtons(BT_screen_menuButtons.java:449) 12-19 14:20:13.770: E/AndroidRuntime(24259): at com.mm2000androidapp.BT_screen_menuButtons.parseScreenData(BT_screen_menuButtons.java:944) 12-19 14:20:13.770: E/AndroidRuntime(24259): at com.mm2000androidapp.BT_screen_menuButtons.onStart(BT_screen_menuButtons.java:238) 12-19 14:20:13.770: E/AndroidRuntime(24259): at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1195) 12-19 14:20:13.770: E/AndroidRuntime(24259): at android.app.Activity.performStart(Activity.java:4553) 12-19 14:20:13.770: E/AndroidRuntime(24259): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198) 12-19 14:20:13.770: E/AndroidRuntime(24259): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2260) 12-19 14:20:13.770: E/AndroidRuntime(24259): at android.app.ActivityThread.access$600(ActivityThread.java:139) 12-19 14:20:13.770: E/AndroidRuntime(24259): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1277) 12-19 14:20:13.770: E/AndroidRuntime(24259): at android.os.Handler.dispatchMessage(Handler.java:99) 12-19 14:20:13.770: E/AndroidRuntime(24259): at android.os.Looper.loop(Looper.java:156) 12-19 14:20:13.770: E/AndroidRuntime(24259): at android.app.ActivityThread.main(ActivityThread.java:5045) 12-19 14:20:13.770: E/AndroidRuntime(24259): at java.lang.reflect.Method.invokeNative(Native Method) 12-19 14:20:13.770: E/AndroidRuntime(24259): at java.lang.reflect.Method.invoke(Method.java:511) 12-19 14:20:13.770: E/AndroidRuntime(24259): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 12-19 14:20:13.770: E/AndroidRuntime(24259): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 12-19 14:20:13.770: E/AndroidRuntime(24259): at dalvik.system.NativeStart.main(Native Method) 12-19 14:20:13.780: E/EmbeddedLogger(280): App crashed! Process: com.mm2000androidapp 12-19 14:20:13.780: E/EmbeddedLogger(280): App crashed! Package: com.mm2000androidapp v3 (2.0) 12-19 14:20:13.780: E/EmbeddedLogger(280): Application Label: The Official MM2000 App 12-19 14:20:13.780: W/ActivityManager(280): Force finishing activity com.mm2000androidapp/.BT_screen_menuButtons 12-19 14:20:13.780: W/ActivityManager(280): Force finishing activity com.mm2000androidapp/.BT_screen_menuButtons 12-19 14:20:13.790: D/ViewRootImpl(280): @@@- disable SystemServer HW acceleration 12-19 14:20:13.790: V/PhoneStatusBar(383): setLightsOn(true) 12-19 14:20:14.010: W/CpuWake(280): >>releaseCpuPerfWakeLock 12-19 14:20:14.010: W/CpuWake(280): <<releaseCpuPerfWakeLock 12-19 14:20:14.280: W/ActivityManager(280): Activity pause timeout for ActivityRecord{40db9a18 com.mm2000androidapp/.BT_screen_menuButtons} 12-19 14:20:14.310: D/ConnectivityService(280): onUidRulesChanged(uid=9999, uidRules=0)
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
12/19/12 10:16 AM (13 years ago)
thanks for the help guys! I will try and make the images smaller! I was planing on doing that anyways as my app is like 34mbs and shouldn't be nearly that size! I'll report back!
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
12/19/12 10:20 AM (13 years ago)
Ahh yes. Android is very finicky about memory. @raveyd, did you debug from device or load his .apk file into the emulator to get LogCat output? I was messing around with this a bit and couldn't get it to work. Thanks as always! ian
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
12/19/12 10:26 AM (13 years ago)
How big should I be making these files? Any recommendations?
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
12/19/12 10:35 AM (13 years ago)
Try saving images as .jpg You might have to play with the size to see what you think looks acceptable. but see what the image looks like at say 100kb for the .jpg you may be able to go smaller or larger in file size Also look at the dimensions of your pics. They may be much larger than ipad size? keep us posted:) ian
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
12/19/12 10:36 AM (13 years ago)
@MM2000, Hard to say. If it IS the problem, I guess try reducing them a bit at a time till you get no force closes. For a menu button 1mb+ is a bit excessive! For a button you might be looking at 100kb or less. If you look at the images that bt provide, they're tiny, 4kb in some cases. @ianjamespiano, yes, installed to the emulator (my phone) via the command line. It's very useful sometimes. I'll post how if you're interested.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
12/19/12 10:36 AM (13 years ago)
jpg, yes! Will reduce them considerably.
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
12/19/12 10:50 AM (13 years ago)
As opposed to png's. I thought png's were the smallest image file type you could have...which is why google used them in android...
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
12/19/12 10:58 AM (13 years ago)
.jpg uses a "lossy" compression which results in smaller files. .png retain more information so the file size is usually bigger. Do a test against both and see which you prefer at the same file size. Let me know if you need more help with it:) Ian
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
12/19/12 11:00 AM (13 years ago)
Thanks guys for all your help! I'm not really a programmer so figuring these things out, without the help from the community would be a nightmare!
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
12/19/12 11:01 AM (13 years ago)
I think png's can resize better in different sized screens, ie less pixilation, which is why they're preferred, but they're generally a bigger file size than an equivalent jpg image file. Also, jpg's are a flat file, png's are layered, ie more data contained in a png file = larger file size. *edit lol! like Ian says! I've gotta learn to type faster!
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
12/19/12 11:06 AM (13 years ago)
@raveyd if you have time would love a little tutorial on installing via the command line. unless there is alrady something online? I have read and tried a few but no luck? thanks!! ian
 
MM2000
Aspiring developer
Profile
Posts: 207
Reg: Sep 06, 2011
Los Angeles
2,820
like
12/19/12 11:22 AM (13 years ago)
Hey guys that solved the problem! they are slightly pixilated, just gotta find the perfect size! Thanks again!
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
12/19/12 11:26 AM (13 years ago)
Sweet! Keep playing around a bit with the sizing and quality. You'll be amazed how much smaller your app size can get. Awesome job! Ian
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
12/19/12 12:16 PM (13 years ago)
Here you are Ian: https://dl.dropbox.com/u/56760890/apk2emulator.pdf Sometimes, which may be the problem you're having?, the emulator doesn't get detected and needs a few goes to find it. Also, spaces in the path to the apk can cause problems. The double quotes (see pdf) is supposed to fix that issue but doesn't every time. It's spaces in the location that aren't system spaces if you see what I mean? 'Documents and Settings' is ok as that's a system location but 'my new folder' might cause problems. @MM2000 - sorry to hijack the thread! And great news that the app's working!
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
12/19/12 04:09 PM (13 years ago)
Thanks raveyd! Gonna get on this as soon as i get home:) cheers! ian
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
12/19/12 05:08 PM (13 years ago)
No problem!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.