Android mediaplayback service binding causes SecurityException? - android

While binding the MediaPlaybackService in android 4.0.3 throws an exception as follows :
03-09 09:51:08.399: ERROR/AndroidRuntime(664): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sudarmuthu.android.adjustvolume/com.sudarmuthu.android.adjustvolume.AdjustVolume}: java.lang.SecurityException: Not allowed to bind to service Intent { cmp=com.android.music/.MediaPlaybackService }
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at android.app.ActivityThread.access$600(ActivityThread.java:123)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at android.os.Handler.dispatchMessage(Handler.java:99)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at android.os.Looper.loop(Looper.java:137)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at android.app.ActivityThread.main(ActivityThread.java:4424)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at java.lang.reflect.Method.invokeNative(Native Method)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at java.lang.reflect.Method.invoke(Method.java:511)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at dalvik.system.NativeStart.main(Native Method)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): Caused by: java.lang.SecurityException: Not allowed to bind to service Intent { cmp=com.android.music/.MediaPlaybackService }
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at android.app.ContextImpl.bindService(ContextImpl.java:1135)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at android.content.ContextWrapper.bindService(ContextWrapper.java:370)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at com.sudarmuthu.android.adjustvolume.AdjustVolume.onStart(AdjustVolume.java:153)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1133)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at android.app.Activity.performStart(Activity.java:4475)
03-09 09:51:08.399: ERROR/AndroidRuntime(664): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1929)
This application is smoothly running in android 2.1 versions.
Any Help!!

Please refer this link http://groups.google.com/group/android-developers/browse_thread/thread/a03ea845989a49ba , I think this will help you...

Related

How to diplay image from firebase using only its name

FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference gsReference = storage.getReferenceFromUrl("gs://bacpoche-5ecb0.appspot.com/natio/agr-svt-2009-6-cr.jpg");
Glide.with(this )
.using(new FirebaseImageLoader())
.load(gsReference)
.into(t);
But it shows "Unfortunately YourApp has stopped".
I already have internet permission in manifest file. Below is the Error
The moniteur//E/
AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.aitelred.redouane.tstv7/com.aitelred.redouane.tstv7.MainActivity}: java.lang.IllegalArgumentException: The supplied bucketname is not available to this project.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
at android.app.ActivityThread.access$600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalArgumentException: The supplied bucketname is not available to this project.
at com.google.android.gms.common.internal.zzac.zzb(Unknown Source)
at com.google.firebase.storage.FirebaseStorage.zzz(Unknown Source)
at com.google.firebase.storage.FirebaseStorage.getReferenceFromUrl(Unknown Source)
at com.aitelred.redouane.tstv7.MainActivity.onCreate(MainActivity.java:49)
at android.app.Activity.performCreate(Activity.java:4466)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
at android.app.ActivityThread.access$600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)

Android application Error Opening Trace File: No such file or directory

Here is a link to a question i posted before with my code:
https://stackoverflow.com/questions/22277864/grid-view-open-one-layout-form-another-causes-the-prograam-to-crash
The error happens right as I click on the button2 'Ornaments' on the main form .
Log Cat:
03-09 10:08:20.308: E/Trace(640): error opening trace file: No such file or directory (2)
03-09 10:08:21.158: D/libEGL(640): loaded /system/lib/egl/libEGL_emulation.so
03-09 10:08:21.158: D/(640): HostConnection::get() New Host Connection established 0x2a072918, tid 640
03-09 10:08:21.218: D/libEGL(640): loaded /system/lib/egl/libGLESv1_CM_emulation.so
03-09 10:08:21.229: D/libEGL(640): loaded /system/lib/egl/libGLESv2_emulation.so
03-09 10:08:21.338: W/EGL_emulation(640): eglSurfaceAttrib not implemented
03-09 10:08:21.378: D/OpenGLRenderer(640): Enabling debug mode 0
03-09 10:08:26.648: D/dalvikvm(640): GC_FOR_ALLOC freed 125K, 3% free 8250K/8455K, paused 118ms, total 130ms
03-09 10:08:26.648: I/dalvikvm-heap(640): Forcing collection of SoftReferences for 31961104-byte allocation
03-09 10:08:26.838: D/dalvikvm(640): GC_BEFORE_OOM freed 13K, 3% free 8236K/8455K, paused 184ms, total 185ms
03-09 10:08:26.838: E/dalvikvm-heap(640): Out of memory on a 31961104-byte allocation.
03-09 10:08:26.838: I/dalvikvm(640): "main" prio=5 tid=1 RUNNABLE
03-09 10:08:26.848: I/dalvikvm(640): | group="main" sCount=0 dsCount=0 obj=0x40a14568 self=0x2a00b9e0
03-09 10:08:26.848: I/dalvikvm(640): | sysTid=640 nice=0 sched=0/0 cgrp=apps handle=1073870640
03-09 10:08:26.848: I/dalvikvm(640): | schedstat=( 1310216641 1726854966 299 ) utm=92 stm=39 core=0
03-09 10:08:26.858: I/dalvikvm(640): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
03-09 10:08:26.858: I/dalvikvm(640): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:500)
03-09 10:08:26.858: I/dalvikvm(640): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:353)
03-09 10:08:26.873: I/dalvikvm(640): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:781)
03-09 10:08:26.878: I/dalvikvm(640): at android.content.res.Resources.loadDrawable(Resources.java:1930)
03-09 10:08:26.878: I/dalvikvm(640): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
03-09 10:08:26.878: I/dalvikvm(640): at android.widget.ImageView.<init>(ImageView.java:120)
03-09 10:08:26.878: I/dalvikvm(640): at android.widget.ImageView.<init>(ImageView.java:110)
03-09 10:08:26.878: I/dalvikvm(640): at java.lang.reflect.Constructor.constructNative(Native Method)
03-09 10:08:26.878: I/dalvikvm(640): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
03-09 10:08:26.878: I/dalvikvm(640): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
03-09 10:08:26.888: I/dalvikvm(640): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
03-09 10:08:26.888: I/dalvikvm(640): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
03-09 10:08:26.888: I/dalvikvm(640): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
03-09 10:08:26.888: I/dalvikvm(640): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
03-09 10:08:26.888: I/dalvikvm(640): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
03-09 10:08:26.888: I/dalvikvm(640): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-09 10:08:26.898: I/dalvikvm(640): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
03-09 10:08:26.898: I/dalvikvm(640): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
03-09 10:08:26.898: I/dalvikvm(640): at android.app.Activity.setContentView(Activity.java:1867)
03-09 10:08:26.898: I/dalvikvm(640): at edu.ajh161.designs.Ornaments.onCreate(Ornaments.java:13)
03-09 10:08:26.898: I/dalvikvm(640): at android.app.Activity.performCreate(Activity.java:5008)
03-09 10:08:26.910: I/dalvikvm(640): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
03-09 10:08:26.910: I/dalvikvm(640): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
03-09 10:08:26.910: I/dalvikvm(640): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
03-09 10:08:26.910: I/dalvikvm(640): at android.app.ActivityThread.access$600(ActivityThread.java:130)
03-09 10:08:26.910: I/dalvikvm(640): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
03-09 10:08:26.910: I/dalvikvm(640): at android.os.Handler.dispatchMessage(Handler.java:99)
03-09 10:08:26.910: I/dalvikvm(640): at android.os.Looper.loop(Looper.java:137)
03-09 10:08:26.918: I/dalvikvm(640): at android.app.ActivityThread.main(ActivityThread.java:4745)
03-09 10:08:26.918: I/dalvikvm(640): at java.lang.reflect.Method.invokeNative(Native Method)
03-09 10:08:26.918: I/dalvikvm(640): at java.lang.reflect.Method.invoke(Method.java:511)
03-09 10:08:26.918: I/dalvikvm(640): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
03-09 10:08:26.918: I/dalvikvm(640): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
03-09 10:08:26.918: I/dalvikvm(640): at dalvik.system.NativeStart.main(Native Method)
03-09 10:08:26.928: D/skia(640): --- decoder->decode returned false
03-09 10:08:26.948: D/AndroidRuntime(640): Shutting down VM
03-09 10:08:26.958: W/dalvikvm(640): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
03-09 10:08:27.138: E/AndroidRuntime(640): FATAL EXCEPTION: main
03-09 10:08:27.138: E/AndroidRuntime(640): java.lang.RuntimeException: Unable to start activity ComponentInfo{edu.ajh161.designs/edu.ajh161.designs.Ornaments}: android.view.InflateException: Binary XML file line #34: Error inflating class <unknown>
03-09 10:08:27.138: E/AndroidRuntime(640): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.app.ActivityThread.access$600(ActivityThread.java:130)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.os.Handler.dispatchMessage(Handler.java:99)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.os.Looper.loop(Looper.java:137)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.app.ActivityThread.main(ActivityThread.java:4745)
03-09 10:08:27.138: E/AndroidRuntime(640): at java.lang.reflect.Method.invokeNative(Native Method)
03-09 10:08:27.138: E/AndroidRuntime(640): at java.lang.reflect.Method.invoke(Method.java:511)
03-09 10:08:27.138: E/AndroidRuntime(640): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
03-09 10:08:27.138: E/AndroidRuntime(640): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
03-09 10:08:27.138: E/AndroidRuntime(640): at dalvik.system.NativeStart.main(Native Method)
03-09 10:08:27.138: E/AndroidRuntime(640): Caused by: android.view.InflateException: Binary XML file line #34: Error inflating class <unknown>
03-09 10:08:27.138: E/AndroidRuntime(640): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
03-09 10:08:27.138: E/AndroidRuntime(640): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
03-09 10:08:27.138: E/AndroidRuntime(640): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.app.Activity.setContentView(Activity.java:1867)
03-09 10:08:27.138: E/AndroidRuntime(640): at edu.ajh161.designs.Ornaments.onCreate(Ornaments.java:13)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.app.Activity.performCreate(Activity.java:5008)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
03-09 10:08:27.138: E/AndroidRuntime(640): ... 11 more
03-09 10:08:27.138: E/AndroidRuntime(640): Caused by: java.lang.reflect.InvocationTargetException
03-09 10:08:27.138: E/AndroidRuntime(640): at java.lang.reflect.Constructor.constructNative(Native Method)
03-09 10:08:27.138: E/AndroidRuntime(640): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
03-09 10:08:27.138: E/AndroidRuntime(640): ... 24 more
03-09 10:08:27.138: E/AndroidRuntime(640): Caused by: java.lang.OutOfMemoryError
03-09 10:08:27.138: E/AndroidRuntime(640): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:500)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:353)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:781)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.content.res.Resources.loadDrawable(Resources.java:1930)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.widget.ImageView.<init>(ImageView.java:120)
03-09 10:08:27.138: E/AndroidRuntime(640): at android.widget.ImageView.<init>(ImageView.java:110)
03-09 10:08:27.138: E/AndroidRuntime(640): ... 27 more
03-09 10:08:31.238: I/Process(640): Sending signal. PID: 640 SIG: 9
Here, you are getting 3 Exceptions:
android.view.InflateException
java.lang.reflect.InvocationTargetException
java.lang.OutOfMemoryError
The problem starts to occurring from OutOfMemoryError Exception. The drawable, you are trying to set in the ImageView with the id imageview2, may be too large. So, when system trying to process that drawable it exceeds memory limit...then OutOfMemoryError Exception occurring.
Since, due to the OutOfMemoryError, system can't set that drawable to tha ImageView then its throwing other Exceptions as InvocationTargetException and InflateException.
Now, try to reduce the drawable's size...may be your problem will be solved.

App crash, How to resolve?

I have a problem when I run my app and select an item from my spinner instead of opening a new class like it is supposed to the app crashes, I was wondering if anyone could help me with why this is happening. I am not sure what part of the code to include, so I will include the Logcat and if you request any code I will edit this post.
Thanks.
Logcat:
03-09 15:36:53.814: E/AndroidRuntime(13429): FATAL EXCEPTION: main
03-09 15:36:53.814: E/AndroidRuntime(13429): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.famouspeople/com.example.famouspeople.SeanConnery}: java.lang.NullPointerException
03-09 15:36:53.814: E/AndroidRuntime(13429): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)
03-09 15:36:53.814: E/AndroidRuntime(13429): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
03-09 15:36:53.814: E/AndroidRuntime(13429): at android.app.ActivityThread.access$600(ActivityThread.java:140)
03-09 15:36:53.814: E/AndroidRuntime(13429): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
03-09 15:36:53.814: E/AndroidRuntime(13429): at android.os.Handler.dispatchMessage(Handler.java:99)
03-09 15:36:53.814: E/AndroidRuntime(13429): at android.os.Looper.loop(Looper.java:137)
03-09 15:36:53.814: E/AndroidRuntime(13429): at android.app.ActivityThread.main(ActivityThread.java:4898)
03-09 15:36:53.814: E/AndroidRuntime(13429): at java.lang.reflect.Method.invokeNative(Native Method)
03-09 15:36:53.814: E/AndroidRuntime(13429): at java.lang.reflect.Method.invoke(Method.java:511)
03-09 15:36:53.814: E/AndroidRuntime(13429): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
03-09 15:36:53.814: E/AndroidRuntime(13429): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
03-09 15:36:53.814: E/AndroidRuntime(13429): at dalvik.system.NativeStart.main(Native Method)
03-09 15:36:53.814: E/AndroidRuntime(13429): Caused by: java.lang.NullPointerException
03-09 15:36:53.814: E/AndroidRuntime(13429): at com.example.famouspeople.SeanConnery.initialize(SeanConnery.java:44)
03-09 15:36:53.814: E/AndroidRuntime(13429): at com.example.famouspeople.SeanConnery.onCreate(SeanConnery.java:28)
03-09 15:36:53.814: E/AndroidRuntime(13429): at android.app.Activity.performCreate(Activity.java:5206)
03-09 15:36:53.814: E/AndroidRuntime(13429): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
03-09 15:36:53.814: E/AndroidRuntime(13429): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
03-09 15:36:53.814: E/AndroidRuntime(13429): ... 11 more
Normally when app crashes with the click on spinner, the problem lies with the adapter you are using to populate the spinner, check carefully the length of apapter you defined. Follow this code
int num = SpinnerData.length;
SpinnerData = new String[num];
Log.d("ArrayAdapter",""+ SpinnerData.length);
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(CurrentActivity.this, android.R.layout.simple_list_item_1, SpinnerData);
//spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(spinnerArrayAdapter);
check carefully length ..I hope this help

Storing string byte representations of multiple files

I need to do an HTTP post of information including String byte representations of multiple files in a single HTTP Post. I'm getting quite a lot of byte allocation errors and was wondering if there was a better way of storing this information for later post to server?
I've basically taken quite a few picture files, and I'm packaging them up into a single HTTP Post string of the format:
name="string byte representation of picture file"&timestamp="time"&gps="latitude""longitude",etc.
Logcat:
03-09 22:26:41.329: E/dalvikvm-heap(8716): Out of memory on a 5932438-byte allocation.
03-09 22:26:41.329: I/dalvikvm(8716): "main" prio=5 tid=1 RUNNABLE
03-09 22:26:41.329: I/dalvikvm(8716): | group="main" sCount=0 dsCount=0 s=N obj=0x40020ba0 self=0xddd0
03-09 22:26:41.329: I/dalvikvm(8716): | sysTid=8716 nice=0 sched=0/0 cgrp=unknown handle=-1345025972
03-09 22:26:41.329: I/dalvikvm(8716): at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:~97)
03-09 22:26:41.329: I/dalvikvm(8716): at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:157)
03-09 22:26:41.329: I/dalvikvm(8716): at java.lang.StringBuilder.append(StringBuilder.java:217)
03-09 22:26:41.329: I/dalvikvm(8716): at mfc.generalguixapi8.SaveData2.saveData(SaveData2.java:169)
03-09 22:26:41.329: I/dalvikvm(8716): at mfc.generalguixapi8.SaveData2.onCreate(SaveData2.java:34)
03-09 22:26:41.329: I/dalvikvm(8716): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-09 22:26:41.329: I/dalvikvm(8716): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
03-09 22:26:41.329: I/dalvikvm(8716): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
03-09 22:26:41.329: I/dalvikvm(8716): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-09 22:26:41.329: I/dalvikvm(8716): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-09 22:26:41.329: I/dalvikvm(8716): at android.os.Handler.dispatchMessage(Handler.java:99)
03-09 22:26:41.329: I/dalvikvm(8716): at android.os.Looper.loop(Looper.java:123)
03-09 22:26:41.329: I/dalvikvm(8716): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-09 22:26:41.339: I/dalvikvm(8716): at java.lang.reflect.Method.invokeNative(Native Method)
03-09 22:26:41.339: I/dalvikvm(8716): at java.lang.reflect.Method.invoke(Method.java:521)
03-09 22:26:41.339: I/dalvikvm(8716): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
03-09 22:26:41.339: I/dalvikvm(8716): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
03-09 22:26:41.339: I/dalvikvm(8716): at dalvik.system.NativeStart.main(Native Method)
03-09 22:26:41.339: W/dalvikvm(8716): threadid=1: thread exiting with uncaught exception (group=0x40020ac0)
03-09 22:26:41.339: E/AndroidRuntime(8716): FATAL EXCEPTION: main
03-09 22:26:41.339: E/AndroidRuntime(8716): java.lang.OutOfMemoryError
03-09 22:26:41.339: E/AndroidRuntime(8716): at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:97)
03-09 22:26:41.339: E/AndroidRuntime(8716): at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:157)
03-09 22:26:41.339: E/AndroidRuntime(8716): at java.lang.StringBuilder.append(StringBuilder.java:217)
03-09 22:26:41.339: E/AndroidRuntime(8716): at mfc.generalguixapi8.SaveData2.saveData(SaveData2.java:169)
03-09 22:26:41.339: E/AndroidRuntime(8716): at mfc.generalguixapi8.SaveData2.onCreate(SaveData2.java:34)
03-09 22:26:41.339: E/AndroidRuntime(8716): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-09 22:26:41.339: E/AndroidRuntime(8716): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
03-09 22:26:41.339: E/AndroidRuntime(8716): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
03-09 22:26:41.339: E/AndroidRuntime(8716): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-09 22:26:41.339: E/AndroidRuntime(8716): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-09 22:26:41.339: E/AndroidRuntime(8716): at android.os.Handler.dispatchMessage(Handler.java:99)
03-09 22:26:41.339: E/AndroidRuntime(8716): at android.os.Looper.loop(Looper.java:123)
03-09 22:26:41.339: E/AndroidRuntime(8716): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-09 22:26:41.339: E/AndroidRuntime(8716): at java.lang.reflect.Method.invokeNative(Native Method)
03-09 22:26:41.339: E/AndroidRuntime(8716): at java.lang.reflect.Method.invoke(Method.java:521)
03-09 22:26:41.339: E/AndroidRuntime(8716): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
03-09 22:26:41.339: E/AndroidRuntime(8716): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
03-09 22:26:41.339: E/AndroidRuntime(8716): at dalvik.system.NativeStart.main(Native Method)
The problem can be solved using Sending file > 1MB using HTTP POST
I was getting an OutofMemory issue in the above link, and solved it by saving the data to a FileOutputStream and sending the information to the server in chunks.

Class Loader Exception while working with Maps in android

I got the following Class not found exception while working with map based application
09-26 15:33:19.810: ERROR/AndroidRuntime(27866):
java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.zyksatwo/com.zyksatwo.MapRouteActivity}:
java.lang.ClassNotFoundException: com.zyksatwo.MapRouteActivity in
loader dalvik.system.PathClassLoader[/data/app/com.zyksatwo-1.apk]
09-26 15:33:19.810: ERROR/AndroidRuntime(27866): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1618)
09-26 15:33:19.810: ERROR/AndroidRuntime(27866): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1716)
09-26 15:33:19.810: ERROR/AndroidRuntime(27866): at
android.app.ActivityThread.access$1500(ActivityThread.java:124) 09-26
15:33:19.810: ERROR/AndroidRuntime(27866): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:968)
09-26 15:33:19.810: ERROR/AndroidRuntime(27866): at
android.os.Handler.dispatchMessage(Handler.java:99) 09-26
15:33:19.810: ERROR/AndroidRuntime(27866): at
android.os.Looper.loop(Looper.java:130) 09-26 15:33:19.810:
ERROR/AndroidRuntime(27866): at
android.app.ActivityThread.main(ActivityThread.java:3806) 09-26
15:33:19.810: ERROR/AndroidRuntime(27866): at
java.lang.reflect.Method.invokeNative(Native Method) 09-26
15:33:19.810: ERROR/AndroidRuntime(27866): at
java.lang.reflect.Method.invoke(Method.java:507) 09-26 15:33:19.810:
ERROR/AndroidRuntime(27866): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-26 15:33:19.810: ERROR/AndroidRuntime(27866): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 09-26
15:33:19.810: ERROR/AndroidRuntime(27866): at
dalvik.system.NativeStart.main(Native Method) 09-26 15:33:19.810:
ERROR/AndroidRuntime(27866): Caused by:
java.lang.ClassNotFoundException: com.zyksatwo.MapRouteActivity in loader dalvik.system.PathClassLoader[/data/app/com.zyksatwo-1.apk
Please help me to figure out the mistake I did here
did you add <uses-library android:name="com.google.android.maps" /> in your menifest file?
if not then plz add this Tag inside your Application Tag in your Menifest.xml file

Categories

Resources