RSS Application Stops - android

I followed this RSS Reader Tutorial.
So at first I got an error in this line:
Uri uri = Uri.parse(links.get(position));
I got the error, that i have to cast it to a String like this:
Uri uri = Uri.parse((String) links.get(position));
after that it was possible to run the App.
But if I want to open a ListView Element the app is stopped every time....
Does anyone an idea of what's wrong?
and here the logcat:
11-20 19:25:19.027: E/AndroidRuntime(505): FATAL EXCEPTION: main
11-20 19:25:19.027: E/AndroidRuntime(505): java.lang.IndexOutOfBoundsException: Invalid index 2, size is 0
11-20 19:25:19.027: E/AndroidRuntime(505): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
11-20 19:25:19.027: E/AndroidRuntime(505): at java.util.ArrayList.get(ArrayList.java:311)
11-20 19:25:19.027: E/AndroidRuntime(505): at com.rss_reader.MainActivity.onListItemClick(MainActivity.java:111)
11-20 19:25:19.027: E/AndroidRuntime(505): at android.app.ListActivity$2.onItemClick(ListActivity.java:319)
11-20 19:25:19.027: E/AndroidRuntime(505): at android.widget.AdapterView.performItemClick(AdapterView.java:284)
11-20 19:25:19.027: E/AndroidRuntime(505): at android.widget.ListView.performItemClick(ListView.java:3513)
11-20 19:25:19.027: E/AndroidRuntime(505): at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812)
11-20 19:25:19.027: E/AndroidRuntime(505): at android.os.Handler.handleCallback(Handler.java:587)
11-20 19:25:19.027: E/AndroidRuntime(505): at android.os.Handler.dispatchMessage(Handler.java:92)
11-20 19:25:19.027: E/AndroidRuntime(505): at android.os.Looper.loop(Looper.java:123)
11-20 19:25:19.027: E/AndroidRuntime(505): at android.app.ActivityThread.main(ActivityThread.java:3683)
11-20 19:25:19.027: E/AndroidRuntime(505): at java.lang.reflect.Method.invokeNative(Native Method)
11-20 19:25:19.027: E/AndroidRuntime(505): at java.lang.reflect.Method.invoke(Method.java:507)
11-20 19:25:19.027: E/AndroidRuntime(505): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-20 19:25:19.027: E/AndroidRuntime(505): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-20 19:25:19.027: E/AndroidRuntime(505): at dalvik.system.NativeStart.main(Native Method)
after i read the description i think the Uri is maybe null because:
Throws
NullPointerException if uriString is null
but why its null? i have no idea...
edit: the link to the tutorial is the wrong... but now i found the right one.

The important information in your LogCat is:
java.lang.IndexOutOfBoundsException: Invalid index 2, size is 0
which means your links list is empty, and then:
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
at java.util.ArrayList.get(ArrayList.java:311)
at com.rss_reader.MainActivity.onListItemClick(MainActivity.java:111)
You can see that you try to read a value from links (that doesn't exist) in your onListItemClick() method on line 111, which as you said above is:
Uri uri = Uri.parse((String) links.get(position));
You must to add data to your links list with links.add() at some point...

Your culprit is here:
com.rss_reader.MainActivity.onListItemClick(MainActivity.java:111)
in line 111, of MainActivity.java
EDIT
then it means you reaching outside your data, or more precisely
java.lang.IndexOutOfBoundsException: Invalid index 2, size is 0
your links is empty while you try to get 3rd element of out it, hence IndexOutOfBounds exception. Check why links is not initialized correctly or do some other checks to ensure your position is set right for the environment.

Related

loading activities from external dex/jar files

I have a lib.apk that is sent by server and received by my application and then saved on sdcard.now I want run activities of inside my library but when I try do it, it gives me error do you define activity in manifest. I added activity tag to manifest of my lib but it still didn't work. Can anyone give any idea?
manifest file of my lib
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.lib"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.lib.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
</application>
</manifest>
logcat error
11-20 05:16:49.918: W/System.err(6721): java.lang.reflect.InvocationTargetException
11-20 05:16:49.938: W/System.err(6721): at java.lang.reflect.Method.invokeNative(Native Method)
11-20 05:16:49.948: W/System.err(6721): at java.lang.reflect.Method.invoke(Method.java:511)
11-20 05:16:49.948: W/System.err(6721): at com.example.myapp2.MainActivity.onCreate(MainActivity.java:29)
11-20 05:16:49.948: W/System.err(6721): at android.app.Activity.performCreate(Activity.java:5104)
11-20 05:16:49.948: W/System.err(6721): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
11-20 05:16:49.948: W/System.err(6721): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
11-20 05:16:49.958: W/System.err(6721): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
11-20 05:16:49.958: W/System.err(6721): at android.app.ActivityThread.access$600(ActivityThread.java:141)
11-20 05:16:49.958: W/System.err(6721): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
11-20 05:16:49.958: W/System.err(6721): at android.os.Handler.dispatchMessage(Handler.java:99)
11-20 05:16:49.969: W/System.err(6721): at android.os.Looper.loop(Looper.java:137)
11-20 05:16:49.969: W/System.err(6721): at android.app.ActivityThread.main(ActivityThread.java:5041)
11-20 05:16:49.969: W/System.err(6721): at java.lang.reflect.Method.invokeNative(Native Method)
11-20 05:16:49.969: W/System.err(6721): at java.lang.reflect.Method.invoke(Method.java:511)
11-20 05:16:49.969: W/System.err(6721): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
11-20 05:16:49.978: W/System.err(6721): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
11-20 05:16:49.978: W/System.err(6721): at dalvik.system.NativeStart.main(Native Method)
11-20 05:16:49.978: W/System.err(6721): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.myapp2/com.example.lib.MainActivity}; have you declared this activity in your AndroidManifest.xml?
11-20 05:16:49.988: W/System.err(6721): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1618)
11-20 05:16:50.000: W/System.err(6721): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1417)
11-20 05:16:50.008: W/System.err(6721): at android.app.Activity.startActivityForResult(Activity.java:3370)
11-20 05:16:50.008: W/System.err(6721): at android.app.Activity.startActivityForResult(Activity.java:3331)
11-20 05:16:50.008: W/System.err(6721): at android.app.Activity.startActivity(Activity.java:3566)
11-20 05:16:50.019: W/System.err(6721): at android.app.Activity.startActivity(Activity.java:3534)
11-20 05:16:50.028: W/System.err(6721): at com.example.lib.Main.onCreate(Main.java:32)
You cannot run activties that have not been installed on the phone. Just having an APK on the SD-card is not enough. This APK will need to be installed on the device.

Android : Runtime error when using Unboundid LDAP SDK

I downloaded UnboundID LDAP SDK and imported it to my Eclipse Android project. It make use of existing LDAPClient supplied with the SDK.
Build was successful. However, when I attempt to launch the application, it gives below run-time error and application would not launch.
I am new to Android and Eclipse. Hence, any help or tips shall be appreciated.
If there are any details required, please let me know. I can add it.
11-20 19:36:38.395: I/dalvikvm(636): Could not find method com.unboundid.ldap.sdk.Filter.create, referenced from method people.finder.PeopleFinder.goSearch
11-20 19:36:38.395: W/dalvikvm(636): VFY: unable to resolve static method 3247: Lcom/unboundid/ldap/sdk/Filter;.create (Ljava/lang/String;)Lcom/unboundid/ldap/sdk/Filter;
11-20 19:36:38.395: D/dalvikvm(636): VFY: replacing opcode 0x71 at 0x00d4
11-20 19:36:38.395: W/dalvikvm(636): VFY: unable to resolve exception class 451 (Lcom/unboundid/ldap/sdk/LDAPException;)
11-20 19:36:38.395: W/dalvikvm(636): VFY: unable to find exception handler at addr 0x113
11-20 19:36:38.405: W/dalvikvm(636): VFY: rejected people/finder/PeopleFinder;.goSearch (Landroid/view/View;)V
11-20 19:36:38.405: W/dalvikvm(636): VFY: rejecting opcode 0x0d at 0x0113
11-20 19:36:38.405: W/dalvikvm(636): VFY: rejected /people/finder/PeopleFinder;.goSearch (Landroid/view/View;)V
11-20 19:36:38.405: W/dalvikvm(636): Verifier rejected class people/finder/PeopleFinder;
11-20 19:36:38.405: W/dalvikvm(636): Class init failed in newInstance call (people/finder/PeopleFinder;)
11-20 19:36:38.405: D/AndroidRuntime(636): Shutting down VM
11-20 19:36:38.405: W/dalvikvm(636): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
11-20 19:36:38.415: E/AndroidRuntime(636): FATAL EXCEPTION: main
11-20 19:36:38.415: E/AndroidRuntime(636): java.lang.VerifyError: people/finder/PeopleFinder
11-20 19:36:38.415: E/AndroidRuntime(636): at java.lang.Class.newInstanceImpl(Native Method)
11-20 19:36:38.415: E/AndroidRuntime(636): at java.lang.Class.newInstance(Class.java:1319)
11-20 19:36:38.415: E/AndroidRuntime(636): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
11-20 19:36:38.415: E/AndroidRuntime(636): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
11-20 19:36:38.415: E/AndroidRuntime(636): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
11-20 19:36:38.415: E/AndroidRuntime(636): at android.app.ActivityThread.access$600(ActivityThread.java:130)
11-20 19:36:38.415: E/AndroidRuntime(636): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
11-20 19:36:38.415: E/AndroidRuntime(636): at android.os.Handler.dispatchMessage(Handler.java:99)
11-20 19:36:38.415: E/AndroidRuntime(636): at android.os.Looper.loop(Looper.java:137)
11-20 19:36:38.415: E/AndroidRuntime(636): at android.app.ActivityThread.main(ActivityThread.java:4745)
11-20 19:36:38.415: E/AndroidRuntime(636): at java.lang.reflect.Method.invokeNative(Native Method)
11-20 19:36:38.415: E/AndroidRuntime(636): at java.lang.reflect.Method.invoke(Method.java:511)
11-20 19:36:38.415: E/AndroidRuntime(636): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-20 19:36:38.415: E/AndroidRuntime(636): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-20 19:36:38.415: E/AndroidRuntime(636): at dalvik.system.NativeStart.main(Native Method)
You need to make sure that the jar is exported when building .apk file.
In project properties, go to Java Build Path > Order and Export : fill the checkbox corresponding to the LDAP sdk

Update old android project

I am following this tutorial and I can make it work just fine, but when I try to update the UI to fit the new Holo.Light in android 4.2 the app crashes at launch, and I don't know why.
I have been searching for a way to update the UI but I could not get it to work.
I wonder if anybody could help me? tell me how? Give me a link that you know would work?
or even do it yourself?
i get this error log:
11-20 09:50:39.523: I/dalvikvm(1460): threadid=3: reacting to signal 3
11-20 09:50:39.682: I/dalvikvm(1460): Wrote stack traces to '/data/anr/traces.txt'
11-20 09:50:39.892: I/dalvikvm(1460): threadid=3: reacting to signal 3
11-20 09:50:40.003: I/dalvikvm(1460): Wrote stack traces to '/data/anr/traces.txt'
11-20 09:50:40.102: D/AndroidRuntime(1460): Shutting down VM
11-20 09:50:40.102: W/dalvikvm(1460): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
11-20 09:50:40.132: E/AndroidRuntime(1460): FATAL EXCEPTION: main
11-20 09:50:40.132: E/AndroidRuntime(1460): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.androidhive.jsonparsing/com.androidhive.jsonparsing.AndroidJSONParsingActivity}: android.os.NetworkOnMainThreadException
11-20 09:50:40.132: E/AndroidRuntime(1460): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
11-20 09:50:40.132: E/AndroidRuntime(1460): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
11-20 09:50:40.132: E/AndroidRuntime(1460): at android.app.ActivityThread.access$600(ActivityThread.java:123)
11-20 09:50:40.132: E/AndroidRuntime(1460): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
11-20 09:50:40.132: E/AndroidRuntime(1460): at android.os.Handler.dispatchMessage(Handler.java:99)
11-20 09:50:40.132: E/AndroidRuntime(1460): at android.os.Looper.loop(Looper.java:137)
11-20 09:50:40.132: E/AndroidRuntime(1460): at android.app.ActivityThread.main(ActivityThread.java:4424)
11-20 09:50:40.132: E/AndroidRuntime(1460): at java.lang.reflect.Method.invokeNative(Native Method)
11-20 09:50:40.132: E/AndroidRuntime(1460): at java.lang.reflect.Method.invoke(Method.java:511)
11-20 09:50:40.132: E/AndroidRuntime(1460): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
11-20 09:50:40.132: E/AndroidRuntime(1460): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
11-20 09:50:40.132: E/AndroidRuntime(1460): at dalvik.system.NativeStart.main(Native Method)
11-20 09:50:40.132: E/AndroidRuntime(1460): Caused by: android.os.NetworkOnMainThreadException
11-20 09:50:40.132: E/AndroidRuntime(1460): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1099)
11-20 09:50:40.132: E/AndroidRuntime(1460): at java.net.InetAddress.lookupHostByName(InetAddress.java:391)
11-20 09:50:40.132: E/AndroidRuntime(1460): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:242)
11-20 09:50:40.132: E/AndroidRuntime(1460): at java.net.InetAddress.getAllByName(InetAddress.java:220)
11-20 09:50:40.132: E/AndroidRuntime(1460): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:137)
11-20 09:50:40.132: E/AndroidRuntime(1460): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
11-20 09:50:40.132: E/AndroidRuntime(1460): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
11-20 09:50:40.132: E/AndroidRuntime(1460): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
11-20 09:50:40.132: E/AndroidRuntime(1460): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
11-20 09:50:40.132: E/AndroidRuntime(1460): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
11-20 09:50:40.132: E/AndroidRuntime(1460): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
11-20 09:50:40.132: E/AndroidRuntime(1460): at com.androidhive.jsonparsing.JSONParser.getJSONFromUrl(JSONParser.java:38)
11-20 09:50:40.132: E/AndroidRuntime(1460): at com.androidhive.jsonparsing.AndroidJSONParsingActivity.onCreate(AndroidJSONParsingActivity.java:53)
11-20 09:50:40.132: E/AndroidRuntime(1460): at android.app.Activity.performCreate(Activity.java:4465)
11-20 09:50:40.132: E/AndroidRuntime(1460): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
11-20 09:50:40.132: E/AndroidRuntime(1460): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
11-20 09:50:40.132: E/AndroidRuntime(1460): ... 11 more
11-20 09:50:40.392: I/dalvikvm(1460): threadid=3: reacting to signal 3
11-20 09:50:40.412: I/dalvikvm(1460): Wrote stack traces to '/data/anr/traces.txt'
11-20 09:50:40.791: I/dalvikvm(1460): threadid=3: reacting to signal 3
11-20 09:50:40.962: I/dalvikvm(1460): Wrote stack traces to '/data/anr/traces.txt'
You are making a network call on the main thread. This is not allowed on Android 4.2, and is a really bad idea on earlier versions which do permit this. I have blogged about various mechanisms for moving network and other heavy calls off the main thread at http://blog.stylingandroid.com/archives/833.
Without seeing your code, I cannot begin to suggest which approach is the right one for you to use, but hopefully the information in my articles will help you in deciding upon the correct approach.
There are two Solution of this Problem.
1) Don't write network call in Main UIThread, Use Async Task for that.
2) Write below code into your MainActivity file after setContentView(R.layout.activity_main);
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
}
And below import statement into your java file.
import android.os.StrictMode;
and see below link for more information.
Twitter connect error

How can my Android app open a port for listening?

I want my Android app to behave as a client and listen on a particular port. None of the code I've tried works. I tried this tutorial to create a small chat app. The server side works fine, but the app crashes on my device. I have both my phone and server comp on VPN.
logcat text returned:
11-20 12:39:12.789: W/dalvikvm(12045): threadid=1: thread exiting with uncaught exception (group=0x4017c560)
11-20 12:39:12.799: E/AndroidRuntime(12045): FATAL EXCEPTION: main
11-20 12:39:12.799: E/AndroidRuntime(12045): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.android_port/com.example.android_port.MainActivity}: java.lang.ClassNotFoundException: com.example.android_port.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.android_port-1.apk]
11-20 12:39:12.799: E/AndroidRuntime(12045): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
11-20 12:39:12.799: E/AndroidRuntime(12045): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
11-20 12:39:12.799: E/AndroidRuntime(12045): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-20 12:39:12.799: E/AndroidRuntime(12045): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
11-20 12:39:12.799: E/AndroidRuntime(12045): at android.os.Handler.dispatchMessage(Handler.java:99)
11-20 12:39:12.799: E/AndroidRuntime(12045): at android.os.Looper.loop(Looper.java:130)
11-20 12:39:12.799: E/AndroidRuntime(12045): at android.app.ActivityThread.main(ActivityThread.java:3687)
11-20 12:39:12.799: E/AndroidRuntime(12045): at java.lang.reflect.Method.invokeNative(Native Method)
11-20 12:39:12.799: E/AndroidRuntime(12045): at java.lang.reflect.Method.invoke(Method.java:507)
11-20 12:39:12.799: E/AndroidRuntime(12045): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
11-20 12:39:12.799: E/AndroidRuntime(12045): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
11-20 12:39:12.799: E/AndroidRuntime(12045): at dalvik.system.NativeStart.main(Native Method)
11-20 12:39:12.799: E/AndroidRuntime(12045): Caused by: java.lang.ClassNotFoundException: com.example.android_port.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.android_port-1.apk]
11-20 12:39:12.799: E/AndroidRuntime(12045): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
11-20 12:39:12.799: E/AndroidRuntime(12045): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
11-20 12:39:12.799: E/AndroidRuntime(12045): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
11-20 12:39:12.799: E/AndroidRuntime(12045): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
11-20 12:39:12.799: E/AndroidRuntime(12045): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
11-20 12:39:12.799: E/AndroidRuntime(12045): ... 11 more

VerifyError, class being rejected, VFY: register1 v6 type 12, wanted 11

I'm currently working on a Wrapper for Android, Which wraps an android
apk with some DRM related stuff.. which are by the way Android
activities..
The activities i had created worked perfectly when I tested them in an
Emulator as well as on a Device.
I tried integrating it with an Application from our org's apps
store... Steps below
Extracted the apk with apktool
* Extracted class files with dex2jar
* added the class files to an Eclipse android project as classes
folder
* Added the activity def from the original app manifest to my manifest
* Compiled and Launched the app from eclipse*
Note : The activities I had created are working very fine.. They load
complete their work and try to launch the game application i was using
to Test Integration.
here's when I come across the VerifyError
11-20 22:44:07.670: W/System.err(281): at
***java.lang.Thread.run(Thread.java:1096)
11-20 22:44:08.050: W/dalvikvm(281): VFY: register1 v0 type 12, wanted
10
11-20 22:44:08.050: W/dalvikvm(281): VFY: register1 v1 type 12, wanted
10
11-20 22:44:08.050: W/dalvikvm(281): VFY: rejecting opcode 0x71 at
0x0016
11-20 22:44:08.050: W/dalvikvm(281): VFY: rejected Lao;.a (Ldh;)I
11-20 22:44:08.050: W/dalvikvm(281): Verifier rejected class Lao;***
11-20 22:44:08.060: D/AndroidRuntime(281): Shutting down VM
11-20 22:44:08.060: W/dalvikvm(281): threadid=1: thread exiting with
uncaught exception (group=0x4001d800)
11-20 22:44:08.170: E/AndroidRuntime(281): FATAL EXCEPTION: main
11-20 22:44:08.170: E/AndroidRuntime(281): java.lang.VerifyError: ao
11-20 22:44:08.170: E/AndroidRuntime(281): at
ca.jamdat.flight.trivialpursuit_hvga_eu.FlAndroidApp.onCreate(Unknown
Source)
11-20 22:44:08.170: E/AndroidRuntime(281): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
11-20 22:44:08.170: E/AndroidRuntime(281): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2627)
11-20 22:44:08.170: E/AndroidRuntime(281): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
11-20 22:44:08.170: E/AndroidRuntime(281): at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-20 22:44:08.170: E/AndroidRuntime(281): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-20 22:44:08.170: E/AndroidRuntime(281): at
android.os.Handler.dispatchMessage(Handler.java:99)
11-20 22:44:08.170: E/AndroidRuntime(281): at
android.os.Looper.loop(Looper.java:123)
11-20 22:44:08.170: E/AndroidRuntime(281): at
android.app.ActivityThread.main(ActivityThread.java:4627)
11-20 22:44:08.170: E/AndroidRuntime(281): at
java.lang.reflect.Method.invokeNative(Native Method)
11-20 22:44:08.170: E/AndroidRuntime(281): at
java.lang.reflect.Method.invoke(Method.java:521)
11-20 22:44:08.170: E/AndroidRuntime(281): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-20 22:44:08.170: E/AndroidRuntime(281): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-20 22:44:08.170: E/AndroidRuntime(281): at
dalvik.system.NativeStart.main(Native Method)
And now I have worked around the problem..
The problem probably is dex2jar tool i used to extract the .class files from the apk (classes probably being corrupt).
I created smali files of my implementation and pasted them into smali folder of the actual application extracted using the apktool and loaded the classes using reflecion rather than directly importing them into my compiled bytecode.
Offfffffff resolved... :)

Categories

Resources