integrate EMF generated java classes into an Android project - android

I would like to know if I can include a set of classes generated from an EMF (ecore) model into an Android project.
I am trying to do this, it compiles fine, but in run-time I get errors like the following ones:
06-07 11:37:04.261: INFO/dalvikvm(649): Failed resolving Lorg/mmi/events/Event; interface 318 'Lorg/eclipse/emf/ecore/EObject;'
06-07 11:37:04.261: WARN/dalvikvm(649): Link of class 'Lorg/mmi/events/Event;' failed
06-07 11:37:04.261: WARN/dalvikvm(649): VFY: unable to find class referenced in signature (Lorg/mmi/events/Event;)
and like this:
06-07 12:11:54.953: WARN/dalvikvm(721): threadid=1: thread exiting with uncaught exception (group=0x40014760)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): FATAL EXCEPTION: main
06-07 12:11:55.157: ERROR/AndroidRuntime(721): java.lang.NoClassDefFoundError: org.mmi.model.instantiator.MmiModelInstantiator
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at org.mmi.facades.MmiFacade.<init>(MmiFacade.java:30)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at com.mmi_android.instrumentation.InstrumentationContext.<init>(InstrumentationContext.java:15)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at com.mmi_android.instrumentation.InstrumentationContext.get(InstrumentationContext.java:21)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at com.example.helloandroid.HelloAndroid.onCreate(HelloAndroid.java:46)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1700)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1752)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:993)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.os.Looper.loop(Looper.java:126)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at android.app.ActivityThread.main(ActivityThread.java:3997)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at java.lang.reflect.Method.invokeNative(Native Method)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at java.lang.reflect.Method.invoke(Method.java:491)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
06-07 12:11:55.157: ERROR/AndroidRuntime(721): at dalvik.system.NativeStart.main(Native Method)
Thanks for your help!!!

At the end I solved this problem using a modified version of the classes compounding the EMF core packages. You can find these classes here:
forum thread:
http://dev.eclipse.org/mhonarc/lists/emf-dev/msg01001.html
project homepage and repository:
http://code.google.com/p/smatrt/source/browse/#svn%2Ftrunk%2Ftmp%2Forg%253Fstate%253Dclosed
I needed also the XML classes included in the javax.xml.* package. I removed the corresponding comments, added the javax.xml jar file and now everything compiles in Android.
Hope it can be helpful for you in the future.
Cheers!

In a recent comment on the related Eclipse bug, Paul Allen wrote the following:
Just thought I'd post a note that things are working. If I jar up the un-modified classes from the org.eclipse.emf.common, org.eclipse.emf.ecore, and org.eclipse.emf.ecore.xmi plugins along with my model's generated classes, and import that into the libs folder of my Android project, things just work. The compiler's happy. The app runs on my Nexus 7. Life is good.
That seems preferrable, as it doesn't involve patching core EMF classes. I haven't tried it myself yet, though.

Related

Having issues integrating Scandit SDK into my app

Decided to use Scandit SDK to get the barcode scanning feature in my app. Unfortunately, since I'm relatively new to Android development and Java in general I've run into a few issues that I can't seem to work out. The demo that Scandit provided doesn't give any errors(runs fine) but crashes when I try to start it up (pressing a button from one activity is meant to start it up). I've tried reading the logcat and googling a solution to the problems but I'm not getting the right solutions. Does anyone have an idea of what I'm doing wrong?
Logcat is provided below:
10-08 23:30:00.807 21563-21563/com.kwesimbia.management D/AndroidRuntime? Shutting down VM
10-08 23:30:00.807 21563-21563/com.kwesimbia.management W/dalvikvm? threadid=1: thread exiting with uncaught exception (group=0x40aa4228)
10-08 23:30:00.817 21563-21563/com.kwesimbia.management E/AndroidRuntime? FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3082)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3077)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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.NoClassDefFoundError: com.kwesimbia.management.ScanditSDKDemoSimple
at com.kwesimbia.management.Activity_D.initiateCodeScan(Activity_D.java:63)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3077)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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)
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger? App crashed!
Process: com.kwesimbia.management
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger? App crashed!
Package: com.kwesimbia.management v1 (1.0)
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger?
Application Label: firstapp
10-08 23:30:00.827 32726-587/? W/ActivityManager?
Force finishing activity com.kwesimbia.management/.Activity_D
I came across this problem as well, my solution was to extract the library files and put them as their files in the lib folder
The library basically isn't being exported with it
EDIT
So I checked out my project, basically I did these things:
In the libs folder I have a new folder called armeabi and inside that I have libscanditsdk-android-3.3.1.so
Then in my build path I have also referenced the jar file that they provide:
<classpathentry exported="true" kind="lib" path="C:/GIT/Android/FwayScannerProject/FwayScanner/libs/scanditsdk-barcodepicker-android-3.3.1.jar"/>

Exception while extend DroidGap

I done few phone gap projects before, This time a new exception raised in my code .
In my new project i include phonegap jar(cordova 1.5) and in the manifest i declared droidgap class(tried with both com.hb.DroidGap and org.apache.cordova.DroidGap).
now if i extend to Activity the debugger entering to onCreate method but if i extend to DroidGap
the below exception is coming and app geting force close (Debugger in not coming to onCreate) ...
Is there any thing i am missing ?
Thanks in advance and sorry for my poor English
06-07 10:03:54.954: E/AndroidRuntime(554): FATAL EXCEPTION: main
06-07 10:03:54.954: E/AndroidRuntime(554): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.hiddenbrains/com.hiddenbrains.HBPluginsActivity}: java.lang.ClassNotFoundException: com.hiddenbrains.HBPluginsActivity in loader dalvik.system.PathClassLoader[/data/app/com.hiddenbrains-1.apk]
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.os.Looper.loop(Looper.java:123)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.ActivityThread.main(ActivityThread.java:4627)
06-07 10:03:54.954: E/AndroidRuntime(554): at java.lang.reflect.Method.invokeNative(Native Method)
06-07 10:03:54.954: E/AndroidRuntime(554): at java.lang.reflect.Method.invoke(Method.java:521)
06-07 10:03:54.954: E/AndroidRuntime(554): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
06-07 10:03:54.954: E/AndroidRuntime(554): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
06-07 10:03:54.954: E/AndroidRuntime(554): at dalvik.system.NativeStart.main(Native Method)
06-07 10:03:54.954: E/AndroidRuntime(554): Caused by: java.lang.ClassNotFoundException: com.hiddenbrains.HBPluginsActivity in loader dalvik.system.PathClassLoader[/data/app/com.hiddenbrains-1.apk]
06-07 10:03:54.954: E/AndroidRuntime(554): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
06-07 10:03:54.954: E/AndroidRuntime(554): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
06-07 10:03:54.954: E/AndroidRuntime(554): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
06-07 10:03:54.954: E/AndroidRuntime(554): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
06-07 10:03:54.954: E/AndroidRuntime(554): ... 11 more
I have this exact problem too. Everything was working until a specific time last night, then I started getting these errors. App crashes every time. I have traced the problem to the .java file in src>MyApp.name... if I remove the cordova line, eg. class MyApp extends DroidGap and set it to the default the app doesn't crash, but it doesn't work either.

Why Is This Crashing? Android AdView Problems?

I am trying to setup ad in my game but I am having a problem. It seems to be crashing. I have included the logcat below and it has something to do with the ad it seems.
06-07 18:49:54.594: E/dalvikvm(308): Could not find class 'com.google.ads.AdView', referenced from method com.blockyblaine.bobhoil.BlockyBlaine.onCreate
06-07 18:49:54.594: W/dalvikvm(308): VFY: unable to resolve check-cast 17 (Lcom/google/ads/AdView;) in Lcom/blockyblaine/bobhoil/BlockyBlaine;
06-07 18:49:54.603: D/dalvikvm(308): VFY: replacing opcode 0x1f at 0x0011
06-07 18:49:54.603: D/dalvikvm(308): VFY: dead code 0x0013-0069 in Lcom/blockyblaine/bobhoil/BlockyBlaine;.onCreate (Landroid/os/Bundle;)V
06-07 18:49:54.933: D/AndroidRuntime(308): Shutting down VM
06-07 18:49:54.933: W/dalvikvm(308): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
06-07 18:49:55.014: E/AndroidRuntime(308): FATAL EXCEPTION: main
06-07 18:49:55.014: E/AndroidRuntime(308): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.blockyblaine.bobhoil/com.blockyblaine.bobhoil.BlockyBlaine}: android.view.InflateException: Binary XML file line #8: Error inflating class com.google.ads.AdView
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.os.Looper.loop(Looper.java:123)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.ActivityThread.main(ActivityThread.java:4627)
06-07 18:49:55.014: E/AndroidRuntime(308): at java.lang.reflect.Method.invokeNative(Native Method)
06-07 18:49:55.014: E/AndroidRuntime(308): at java.lang.reflect.Method.invoke(Method.java:521)
06-07 18:49:55.014: E/AndroidRuntime(308): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
06-07 18:49:55.014: E/AndroidRuntime(308): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
06-07 18:49:55.014: E/AndroidRuntime(308): at dalvik.system.NativeStart.main(Native Method)
06-07 18:49:55.014: E/AndroidRuntime(308): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class com.google.ads.AdView
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
06-07 18:49:55.014: E/AndroidRuntime(308): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.Activity.setContentView(Activity.java:1647)
06-07 18:49:55.014: E/AndroidRuntime(308): at com.blockyblaine.bobhoil.BlockyBlaine.onCreate(BlockyBlaine.java:27)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
06-07 18:49:55.014: E/AndroidRuntime(308): ... 11 more
06-07 18:49:55.014: E/AndroidRuntime(308): Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView in loader dalvik.system.PathClassLoader[/data/app/com.blockyblaine.bobhoil-2.apk]
06-07 18:49:55.014: E/AndroidRuntime(308): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
06-07 18:49:55.014: E/AndroidRuntime(308): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
06-07 18:49:55.014: E/AndroidRuntime(308): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
06-07 18:49:55.014: E/AndroidRuntime(308): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
06-07 18:49:55.014: E/AndroidRuntime(308): ... 20 more
06-07 18:50:01.593: I/Process(308): Sending signal. PID: 308 SIG: 9
This link will take you to the admob developers docs. You will need to be sure to follow the directions to have the admob JAR included in your project.
I found a couple of other mentions related to other google api's. The issue there (giving a similar logcat) was this step was missed:
2. Declare com.google.ads.AdActivity in AndroidManifest.xml.
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

java.lang.ClassNotFoundException on my android app but I have no idea why

I've been trying to get started with Android programming for a while now. I'm mainly a .NET developer with no Java experience for 8 years (university).
I can compile and run samples no problem but the moment I try and rename my package/class it fails. I believe I've updated the manifest and triple checked it (Copied and pasted name, selected it with Eclipse) yet it always fails with a java.lang.ClassNotFoundException:
12-02 09:12:21.088: ERROR/AndroidRuntime(233): Uncaught handler: thread main exiting due to uncaught exception
12-02 09:12:21.178: ERROR/AndroidRuntime(233): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.anddev.cheesemp.helloandworld/org.anddev.cheesemp.helloandworld.HelloAndEngine}: java.lang.ClassNotFoundException: org.anddev.cheesemp.helloandworld.HelloAndEngine in loader dalvik.system.PathClassLoader#43d0c0d0
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at android.os.Handler.dispatchMessage(Handler.java:99)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at android.os.Looper.loop(Looper.java:123)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at android.app.ActivityThread.main(ActivityThread.java:4363)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at java.lang.reflect.Method.invokeNative(Native Method)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at java.lang.reflect.Method.invoke(Method.java:521)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at dalvik.system.NativeStart.main(Native Method)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): Caused by: java.lang.ClassNotFoundException: org.anddev.cheesemp.helloandworld.HelloAndEngine in loader dalvik.system.PathClassLoader#43d0c0d0
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
12-02 09:12:21.178: ERROR/AndroidRuntime(233): ... 11 more
Manifest is here:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="1.0" package="org.anddev.cheesemp.helloandworld">
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:label="#string/app_name" android:name="org.anddev.cheesemp.helloandworld.HelloAndEngine">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4" \>
</manifest>
Class definition is here:
package org.anddev.cheesemp.helloandworld;
import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.scene.background.ColorBackground;
import org.anddev.andengine.entity.text.Text;
import org.anddev.andengine.entity.util.FPSLogger;
import org.anddev.andengine.opengl.font.Font;
import org.anddev.andengine.opengl.texture.Texture;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.ui.activity.BaseGameActivity;
import org.anddev.andengine.util.HorizontalAlign;
import android.graphics.Color;
import android.graphics.Typeface;
/**
* #author Nicolas Gramlich
* #since 11:54:51 - 03.04.2010
*/
public class HelloAndEngine extends BaseGameActivity
This sample is from AndEngine but I've had the same issue with every sample I modify. I can't help but feel I've missed something and nothing I found searching has helped.
Any advice appreciated!
Try this.
<activity android:label="#string/app_name" android:name=".HelloAndEngine">
You don't need the fully qualified class name. Also, if you are working with Eclipse and rename a package go to Project → Clean and let it clean up your project, fixing up references and so on if anything is broken.
This is a bug in eclipse android tools
http://code.google.com/p/android/issues/detail?id=2824
To Fix -> Right click on the project go to Android tools -> Rename application package..
And also check AndroidManifest.xml if it updated correctly, in my case it didn't, that should solve this problem

Android 2.1 - Video issue

Why does my video playing app crash when I try to run on a Droid 2.1 device, but works fine with myTouch 1.6?
Thanks
Chris
LogCat shows
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): java.lang.IllegalStateException
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.media.MediaPlayer.getVideoWidth(Native Method)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.widget.VideoView$2.onPrepared(VideoView.java:290)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.media.MediaPlayer$EventHandler.handleMessage(MediaPlayer.java:1152)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.os.Handler.dispatchMessage(Handler.java:99)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.os.Looper.loop(Looper.java:123)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at android.app.ActivityThread.main(ActivityThread.java:4363)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at java.lang.reflect.Method.invokeNative(Native Method)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at java.lang.reflect.Method.invoke(Method.java:521)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
06-07 18:13:13.444: ERROR/AndroidRuntime(4252): at dalvik.system.NativeStart.main(Native Method)
This VideoView-based sample works fine on all Android devices I have tested it upon, including the Magic and DROID. Experiment with it and your media clip and see what happens.

Categories

Resources