I have written for tables creation but when i am trying to access the table from one of my screen its throwing exception .
Even when i went do shell in commannd prompt i was not able to find that table . Any clue that i need to do .
logs :
W/System.err( 275): at java.lang.Thread.run(Thread.java:1096)
I/Database( 275): sqlite returned: error code = 1, msg = no such table: woman_registration
D/AndroidRuntime( 275): Shutting down VM
W/dalvikvm( 275): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
E/AndroidRuntime( 275): FATAL EXCEPTION: main
E/AndroidRuntime( 275): android.database.sqlite.SQLiteException: no such table: woman_registration: , while compiling: SELECT DISTINCT
* FROM woman_registration WHERE (m_name = ? AND f_name = ? and m_age_range = ?)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteCompiledSql.native_compile(Native Method)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:64)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:80)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:46)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:42)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1229)
E/AndroidRuntime( 275): at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1184)
E/AndroidRuntime( 275): at org.atl.db.DBAdapter.isWomanAlreadyRegisgtered(DBAdapter.java:376)
E/AndroidRuntime( 275): at com.accenturelabs.idoc.RegisterWoman.registerMother(RegisterWoman.java:237)
E/AndroidRuntime( 275): at com.accenturelabs.idoc.RegisterWoman.access$1(RegisterWoman.java:223)
E/AndroidRuntime( 275): at com.accenturelabs.idoc.RegisterWoman$4.onClick(RegisterWoman.java:141)
E/AndroidRuntime( 275): at android.view.View.performClick(View.java:2408)
E/AndroidRuntime( 275): at android.view.View$PerformClick.run(View.java:8816)
E/AndroidRuntime( 275): at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 275): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 275): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 275): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 275): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 275): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 275): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 275): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 275): at dalvik.system.NativeStart.main(Native Method)
D/dalvikvm( 58): GC_FOR_MALLOC freed 18388 objects / 947880 bytes in 106ms
W/ActivityManager( 58): Force finishing activity com.accenturelabs.idoc/.RegisterWoman
I/ARMAssembler( 58): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x34d7b0:0x34d86c] in 7148901 ns
Try to chek from your ddms data -> data -> your package ->database
here you will find that table is created of not.
also it you pull it out and open with SQllite browser u will get all the table list in it.
Hope this will help you
You should be extending SQLiteOpenHelper for your database code if you are not already.
Then check that your onUpgrade() method also calls back to your onCreate() method. You may be dropping all your tables and then not re-creating them. Make sure you bump the database version number every time you make a change to your tables.
The google iosched app has a complete, if not slightly complex example of how to do this.
http://code.google.com/p/iosched/source/browse/android/src/com/google/android/apps/iosched/provider/ScheduleDatabase.java
Actually i had to uninstall the application from the emulator .it worked fine after that
Related
I have been having issues with an application I am developing on Unity, so to make sure that it wasn't a problem with any of my work I started a new project and only installed the Tango plugin. After following the instructions to create a basic application and run it on my device the application still crashes on start up. Any help is appreciated!
I/ActivityManager( 898): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.test.test cmp=com.test.test/com.google.unity.GoogleUnityActivity} from pid 4198
W/art ( 164): Could not get current activity
I/ActivityManager( 898): Start proc com.test.test for activity com.test.test/com.google.unity.GoogleUnityActivity: pid=4691 uid=10073 gids={50073, 3003, 1028, 1015}
W/FlurryAgent( 4382): Flurry session paused for context:com.mobisystems.files.FileBrowser#64adfb28
E/cutils ( 156): Failed to mkdirat(/storage/sdcard1/Android): Read-only file system
W/Vold ( 156): Returning OperationFailed - no handler for errno 30
W/ContextImpl( 4691): Failed to ensure directory: /storage/sdcard1/Android/obb/com.test.test
E/cutils ( 156): Failed to mkdirat(/storage/sdcard1/Android): Read-only file system
W/Vold ( 156): Returning OperationFailed - no handler for errno 30
W/ContextImpl( 4691): Failed to ensure directory: /storage/sdcard1/Android/data/com.test.test/files
W/NativeActivity( 4691): ANativeActivity_onCreate not found
D/AndroidRuntime( 4691): Shutting down VM
E/AndroidRuntime( 4691): FATAL EXCEPTION: main
E/AndroidRuntime( 4691): Process: com.test.test, PID: 4691
E/AndroidRuntime( 4691): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.test/com.google.unity.GoogleUnityActivity}: java.lang.IllegalArgumentException: Unable to load native library: /data/app-lib/com.test.test-1/libmain.so
E/AndroidRuntime( 4691): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2196)
E/AndroidRuntime( 4691): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2246)
E/AndroidRuntime( 4691): at android.app.ActivityThread.access$800(ActivityThread.java:136)
E/AndroidRuntime( 4691): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1197)
E/AndroidRuntime( 4691): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 4691): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 4691): at android.app.ActivityThread.main(ActivityThread.java:5030)
E/AndroidRuntime( 4691): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 4691): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
E/AndroidRuntime( 4691): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
E/AndroidRuntime( 4691): Caused by: java.lang.IllegalArgumentException: Unable to load native library: /data/app-lib/com.test.test-1/libmain.so
E/AndroidRuntime( 4691): at android.app.NativeActivity.onCreate(NativeActivity.java:186)
E/AndroidRuntime( 4691): at com.google.unity.GoogleUnityActivity.onCreate(GoogleUnityActivity.java:44)
E/AndroidRuntime( 4691): at android.app.Activity.performCreate(Activity.java:5231)
E/AndroidRuntime( 4691): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime( 4691): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2160)
E/AndroidRuntime( 4691): ... 9 more
W/ActivityManager( 898): Force finishing activity com.test.test/com.google.unity.GoogleUnityActivity
I/art ( 898): Heap trim of managed (duration=14.793833ms, advised=2MB) and native (duration=3.858334ms, advised=556KB) heaps. Managed heap utilization of 65%.
I am creating a new account using AccountManager and it works fine for android 2.3+ but for android 2.1 it makes the phone's address-book crash when trying to view a contact details.
The account is defined like this:
type: com.example.android.authenticators.ABCAuthenticator.account
name: Contacts ABC
The crash I see when trying to open a contact's detail activity (not on my app, which works fine, but on the Motorola 2.1's native contacts app) is:
V/ContactsListActivity( 1667): onListItemClick :Uri = content://com.android.contacts/contacts/lookup/0r42-29292929/42
I/ActivityManager( 1017): Starting activity: Intent { act=android.intent.action.VIEW dat=content://com.android.contacts/contacts/lookup/0r42-29292929/42 cmp=com.android.contacts/.ViewContactActivity }
D/AndroidRuntime( 1667): Shutting down VM
W/dalvikvm( 1667): threadid=1: thread exiting with uncaught exception (group=0x4001ac68)
E/AndroidRuntime( 1667): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 1667): java.lang.IllegalStateException: Couldn't find authenticator for specific account type
E/AndroidRuntime( 1667): at com.android.contacts.model.Sources.findAuthenticator(Sources.java:253)
E/AndroidRuntime( 1667): at com.android.contacts.model.Sources.queryAccounts(Sources.java:193)
E/AndroidRuntime( 1667): at com.android.contacts.model.Sources.<init>(Sources.java:109)
E/AndroidRuntime( 1667): at com.android.contacts.model.Sources.getInstance(Sources.java:93)
E/AndroidRuntime( 1667): at com.android.contacts.ViewContactActivity.buildEntries(ViewContactActivity.java:1372)
E/AndroidRuntime( 1667): at com.android.contacts.ViewContactActivity.bindData(ViewContactActivity.java:681)
E/AndroidRuntime( 1667): at com.android.contacts.ViewContactActivity.considerBindData(ViewContactActivity.java:674)
E/AndroidRuntime( 1667): at com.android.contacts.ViewContactActivity.onQueryComplete(ViewContactActivity.java:542)
E/AndroidRuntime( 1667): at com.android.contacts.util.NotifyingAsyncQueryHandler.onQueryComplete(NotifyingAsyncQueryHandler.java:65)
E/AndroidRuntime( 1667): at android.content.AsyncQueryHandler.handleMessage(AsyncQueryHandler.java:408)
E/AndroidRuntime( 1667): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1667): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 1667): at android.app.ActivityThread.main(ActivityThread.java:4695)
E/AndroidRuntime( 1667): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1667): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 1667): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
E/AndroidRuntime( 1667): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:663)
E/AndroidRuntime( 1667): at dalvik.system.NativeStart.main(Native Method)
I/Process ( 1017): Sending signal. PID: 1667 SIG: 3
I/dalvikvm( 1667): threadid=3: reacting to signal 3
It seems like it tries to find the authenticator but it does not find it... but why? Are there any limitations on the name / type of the authenticator for Android 2.1? Any ideas?
Turns out my sync-adapter was using a #string reference for the android:accountType attribute and for Android 2.1 it needs to be a hardcoded string, not the reference.
When I try running the default "Mono for Android Application", I get an error that the application has stopped unexpectedly.
After, (sometimes) I would get an exception in MonoDevelop: System.IO.IOException: DWP Handshake failed.
I'm not sure what could be wrong - I haven't made any changes to the application. Any help would be greatly appreciated - I've been trying to get this running all day.
TIA
Stacktrace:
D/AndroidRuntime( 2066): Shutting down VM
E/AndroidRuntime( 2066): FATAL EXCEPTION: main
E/AndroidRuntime( 2066): java.lang.UnsatisfiedLinkError: Couldn't load monodroid: findLibrary returned null
E/AndroidRuntime( 2066): at java.lang.Runtime.loadLibrary(Runtime.java:429)
E/AndroidRuntime( 2066): at java.lang.System.loadLibrary(System.java:554)
E/AndroidRuntime( 2066): at mono.MonoPackageManager.LoadApplication(MonoPackageManager.java:24)
E/AndroidRuntime( 2066): at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:25)
E/AndroidRuntime( 2066): at android.app.ActivityThread.installProvider(ActivityThread.java:3554)
E/AndroidRuntime( 2066): at android.app.ActivityThread.installContentProviders(ActivityThread.java:3309)
E/AndroidRuntime( 2066): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:3265)
E/AndroidRuntime( 2066): at android.app.ActivityThread.access$2200(ActivityThread.java:117)
E/AndroidRuntime( 2066): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:969)
E/AndroidRuntime( 2066): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2066): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2066): at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime( 2066): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2066): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 2066): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime( 2066): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime( 2066): at dalvik.system.NativeStart.main(Native Method)
I/Process ( 2066): Sending signal. PID: 2066 SIG: 9
I had a similar problem not long after going with the paid version. Simply clean and rebuild to update the references to the new monodroid library.
See also: http://www.mail-archive.com/monodroid#lists.ximian.com/msg00531.html
This is very probably Android bug 21670: sometimes native libraries are not extracted from the .apk, but the installation is still reported as successful:
W/NativeHelper( 98): Failed to cache package shared libs
W/NativeHelper( 98): java.io.IOException: Couldn't create cached binary /data/data/Mono.Android.DebugRuntime/lib/libmonosgen-2.0.so in /data/data/Mono.Android.DebugRuntime/lib
W/NativeHelper( 98): at com.android.internal.content.NativeLibraryHelper.copyNativeBinaryLI(NativeLibraryHelper.java:289)
Check your Android Debug Logs for a message similar to the above to confirm that this is the case.
If you see the above, you need to uninstall your app and as many other packages as possible to free up storage space, then reinstall your app.
While running the Navit code for car navigation, I am getting the following exception, i thought that navit library is not available. please any one help me.
E/AndroidRuntime( 365): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 365): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 365): at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 365): at java.lang.Class.newInstance(Class.java:1472)
E/AndroidRuntime( 365): at android.app.Instrumentation.newActivity(Instrumentation.java:1097)
E/AndroidRuntime( 365): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2316)
E/AndroidRuntime( 365): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
E/AndroidRuntime( 365): at android.app.ActivityThread.access$2100(ActivityThread.java:116)
E/AndroidRuntime( 365): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
E/AndroidRuntime( 365): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 365): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 365): at android.app.ActivityThread.main(ActivityThread.java:4203)
E/AndroidRuntime( 365): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 365): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 365): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime( 365): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
E/AndroidRuntime( 365): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 365): Caused by: java.lang.UnsatisfiedLinkError: Library navit not found
E/AndroidRuntime( 365): at java.lang.Runtime.loadLibrary(Runtime.java:489)
E/AndroidRuntime( 365): at java.lang.System.loadLibrary(System.java:557)
i downloaded the Navit code from , navit svn.ttps://navit.svn.sourceforge.net/svnroot/navit/trunk/navit But unable to run the code.
i want to run this code in Eclipse for Android Project.
You need to download Android NDK
Create standalong tools for your ARCH
Cross compile to ARM
Run make apkg
This error is due to missing libnavit.so.
Put libnavit.so it in /data/local
Change System.LoadLibrary to System.Load("/data/local/libnavit.so");
make apkg
Install
This exception should go away.
This question already has answers here:
How to read contacts on Android 2.0
(9 answers)
Closed 5 years ago.
The following is my code:
Cursor mCursor = this.getContentResolver().query(
ContactsContract.Contacts.CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.HAS_PHONE_NUMBER + "==1", null, null);
startManagingCursor(mCursor);
ListAdapter adapter = new SimpleCursorAdapter(this,
R.layout.two_line_list_item, mCursor, new String[] {
PhoneLookup.DISPLAY_NAME, PhoneLookup.NUMBER}, new int[] {R.id.text1, R.id.text2});
setListAdapter(adapter);
I'm able to see the DISPLAY_NAME, but whenever I add PhoneLookup.NUMBER, the application crashes. I also added a condition to select only contacts that have a phone number assuming its crashing due to null data. Still no luck. Is there any permissions I need to add to get the phone number? I already have android.permission.READ_CONTACTS in my manifest.
Logcat output:
I/ActivityManager( 58): Starting activity: Intent { cmp=fourth.app/.food }
D/AndroidRuntime( 335): Shutting down VM
W/dalvikvm( 335): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
E/AndroidRuntime( 335): FATAL EXCEPTION: main
E/AndroidRuntime( 335): java.lang.RuntimeException: Unable to start activity ComponentInfo{fourth.app/fourth.app.food}: java.lang.Ille
galArgumentException: column 'number' does not exist
E/AndroidRuntime( 335): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
E/AndroidRuntime( 335): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime( 335): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime( 335): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime( 335): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 335): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 335): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 335): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 335): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 335): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 335): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 335): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 335): Caused by: java.lang.IllegalArgumentException: column 'number' does not exist
E/AndroidRuntime( 335): at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:314)
E/AndroidRuntime( 335): at android.database.CursorWrapper.getColumnIndexOrThrow(CursorWrapper.java:99)
E/AndroidRuntime( 335): at android.widget.SimpleCursorAdapter.findColumns(SimpleCursorAdapter.java:312)
E/AndroidRuntime( 335): at android.widget.SimpleCursorAdapter.<init>(SimpleCursorAdapter.java:87)
E/AndroidRuntime( 335): at fourth.app.food.onCreate(food.java:21)
E/AndroidRuntime( 335): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 335): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
E/AndroidRuntime( 335): ... 11 more
W/ActivityManager( 58): Force finishing activity fourth.app/.food
W/ActivityManager( 58): Force finishing activity fourth.app/.four
W/ActivityManager( 58): Activity pause timeout for HistoryRecord{43f54e88 fourth.app/.food}
java.lang.IllegalArgumentException: column 'number' does not exist
You are using an invalid name of column.
have a look at this question: How to read contacts on Android 2.0