Android SQLite multiple table input - android

I have a budget program that uses multiple tables to store information. When I try to add information to more than 1 table at a time, I end up only having the first table receive any information. This is the code I use:
public SQLiteDatabase createBudget(String bname, String bpay, String bamount,
String bmemo) {
// TODO Auto-generated method stub
ContentValues t1 = new ContentValues();
ContentValues t2 = new ContentValues();
ContentValues t4 = new ContentValues();
t1.put(KEY_NAME, bname);
t1.put(KEY_PAYDAY,bpay);
t2.put(KEY_AMOUNT, bamount);
t4.put(KEY_MEMO, bmemo);
ourDatabase.insert(DATABASE_TABLE1, null, t1);
ourDatabase.insert(DATABASE_TABLE2, null, t2);
ourDatabase.insert(DATABASE_TABLE4, null, t4);
return ourDatabase;
}
I'm completely lost on what to do. I have tried looking online but the things I have found are for single table database. I would appreciate any help. This is LogCat content:
11-13 10:14:33.935: E/SQLiteDatabase(662): Error inserting budget_amount=99
11-13 10:14:33.935: E/SQLiteDatabase(662): android.database.sqlite.SQLiteConstraintException: Budget_Items.edit_date may not be NULL (code 19)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:775)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1469)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1339)
11-13 10:14:33.935: E/SQLiteDatabase(662): at budget.app.BudgetDB.createBudget(BudgetDB.java:161)
11-13 10:14:33.935: E/SQLiteDatabase(662): at budget.app.AddBudget$1.onClick(AddBudget.java:40)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.view.View.performClick(View.java:4084)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.view.View$PerformClick.run(View.java:16966)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.os.Handler.handleCallback(Handler.java:615)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.os.Handler.dispatchMessage(Handler.java:92)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.os.Looper.loop(Looper.java:137)
11-13 10:14:33.935: E/SQLiteDatabase(662): at android.app.ActivityThread.main(ActivityThread.java:4745)
11-13 10:14:33.935: E/SQLiteDatabase(662): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 10:14:33.935: E/SQLiteDatabase(662): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 10:14:33.935: E/SQLiteDatabase(662): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-13 10:14:33.935: E/SQLiteDatabase(662): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-13 10:14:33.935: E/SQLiteDatabase(662): at dalvik.system.NativeStart.main(Native Method)
11-13 10:14:33.955: E/SQLiteDatabase(662): Error inserting _memo=for pie
11-13 10:14:33.955: E/SQLiteDatabase(662): android.database.sqlite.SQLiteConstraintException: Budget_Memos.edit_date may not be NULL (code 19)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:775)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1469)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1339)
11-13 10:14:33.955: E/SQLiteDatabase(662): at budget.app.BudgetDB.createBudget(BudgetDB.java:162)
11-13 10:14:33.955: E/SQLiteDatabase(662): at budget.app.AddBudget$1.onClick(AddBudget.java:40)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.view.View.performClick(View.java:4084)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.view.View$PerformClick.run(View.java:16966)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.os.Handler.handleCallback(Handler.java:615)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.os.Handler.dispatchMessage(Handler.java:92)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.os.Looper.loop(Looper.java:137)
11-13 10:14:33.955: E/SQLiteDatabase(662): at android.app.ActivityThread.main(ActivityThread.java:4745)
11-13 10:14:33.955: E/SQLiteDatabase(662): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 10:14:33.955: E/SQLiteDatabase(662): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 10:14:33.955: E/SQLiteDatabase(662): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-13 10:14:33.955: E/SQLiteDatabase(662): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-13 10:14:33.955: E/SQLiteDatabase(662): at dalvik.system.NativeStart.main(Native Method)

I think the problem is "Budget_Items.edit_date may not be NULL". You have a NOT NULL column in your database and try to insert a row without giving a value at the column Budget_Items.edit_date

Your constrain exception is very much visible here
android.database.sqlite.SQLiteConstraintException: Budget_Items.edit_date may not be NULL (code 19)
Try putting a try catch block around your calls to find the exact error.

Related

direct event insert to attendees table exceotion if sdk versio lower than 19

I am building an application in which I am inserting events directly to the calendar plus I left the possibility to invite someone else and everything is perfectly fine if I execute it on android sdk version 19 and above, on lower versions I get an exception.
Here is the source:
ContentResolver atend = getContentResolver();
ContentValues val = new ContentValues();
val.put(CalendarContract.Attendees.ATTENDEE_NAME, "Bajo");
val.put(CalendarContract.Attendees.ATTENDEE_EMAIL, someonesEmail);
val.put(CalendarContract.Attendees.ATTENDEE_RELATIONSHIP, CalendarContract.Attendees.RELATIONSHIP_ATTENDEE);
val.put(CalendarContract.Attendees.ATTENDEE_TYPE, CalendarContract.Attendees.TYPE_REQUIRED);
val.put(CalendarContract.Attendees.ATTENDEE_STATUS, CalendarContract.Attendees.ATTENDEE_STATUS_INVITED);
val.put(CalendarContract.Attendees.EVENT_ID, eventID);
Uri muri= atend.insert(CalendarContract.Attendees.CONTENT_URI, val);
Log.d("Atendees URI:",muri.toString());
long Aeventid=Long.parseLong(muri.getLastPathSegment());
the Exception:
03-05 19:45:59.681 1255-1266/? E/DatabaseUtils﹕ Writing exception to parcel
android.database.sqlite.SQLiteDoneException
at android.database.sqlite.SQLiteConnection.nativeExecuteForLong(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLong(SQLiteConnection.java:591)
at android.database.sqlite.SQLiteSession.executeForLong(SQLiteSession.java:652)
at android.database.sqlite.SQLiteStatement.simpleQueryForLong(SQLiteStatement.java:107)
at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:816)
at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:804)
at com.android.providers.calendar.CalendarDatabaseHelper.duplicateEvent(CalendarDatabaseHelper.java:3311)
at com.android.providers.calendar.CalendarProvider2.insertInTransaction(CalendarProvider2.java:2265)
at com.android.providers.calendar.SQLiteContentProvider.insert(SQLiteContentProvider.java:96)
at android.content.ContentProvider$Transport.insert(ContentProvider.java:201)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:148)
at android.os.Binder.execTransact(Binder.java:367)
at dalvik.system.NativeStart.run(Native Method)
03-05 19:45:59.681 1632-1632/? D/AndroidRuntime﹕ Shutting down VM
03-05 19:45:59.681 1632-1632/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0xb2f7e288)
03-05 19:45:59.681 1632-1632/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3591)
at android.view.View.performClick(View.java:4084)
at android.view.View$PerformClick.run(View.java:16966)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
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:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
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:3586)
            at android.view.View.performClick(View.java:4084)
            at android.view.View$PerformClick.run(View.java:16966)
            at android.os.Handler.handleCallback(Handler.java:615)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4745)
            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:786)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
            at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:184)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
at android.content.ContentProviderProxy.insert(ContentProviderNative.java:420)
at android.content.ContentResolver.insert(ContentResolver.java:864)
at com.example.rusev.vetcalendar.MainActivity.insertToCalendarImmunization(MainActivity.java:809)
at com.example.rusev.vetcalendar.MainActivity.syncToCalendar(MainActivity.java:931)
            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:3586)
            at android.view.View.performClick(View.java:4084)
            at android.view.View$PerformClick.run(View.java:16966)
            at android.os.Handler.handleCallback(Handler.java:615)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4745)
            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:786)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
            at dalvik.system.NativeStart.main(Native Method)
Can you help me to identify what I miss?

Titanium Android App Markeplace Build not starting

I made an Android app with Titanium Studio. It works perfecly as long as i run it in debug mode but as soon as i use the apk that's generated by the built in marketplace distribution my app gets stuck when the loading screen is shown. No error Message is displayed.
I created a keystore and verified the apk after it was built. no errors.
Any idea what i need to change?
DDMS:
11-13 21:57:26.142: I/ActivityManager(477): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.xxxx.xxxx/.xxxxActivity bnds=[360,74][536,302]} from pid 767
11-13 21:57:26.142: W/ContextImpl(477): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1078 com.android.server.am.ActivityStack.SendToPermission:2575 com.android.server.am.ActivityStack.startActivityUncheckedLocked:3177 com.android.server.am.ActivityStack.startActivityLocked:2788 com.android.server.am.ActivityStack.startActivityMayWait:3343
11-13 21:57:26.149: D/PowerManagerService(477): acquireWakeLockInternal: lock=1112740064, flags=0x1, tag="ActivityManager-Launch", ws=null, uid=1000, pid=477
11-13 21:57:26.149: D/PowerManagerNotifier(477): onWakeLockAcquired: flags=1, tag="ActivityManager-Launch", ownerUid=1000, ownerPid=477, workSource=null
11-13 21:57:26.149: D/PowerManagerService(477): Update history[5] wakeLock: flags=0x1, tag="ActivityManager-Launch", uid=1000, pid=477, timeStamp=1384376246150, timeSum=8638
11-13 21:57:26.149: D/PowerManagerService(477): updateWakeLockSummaryLocked: mWakefulness=Awake, mWakeLockSummary=0x1
11-13 21:57:26.149: D/PowerManagerService(477): updateScreenStateLocked: mDisplayReady=true, newScreenState=2, mWakefulness=1, mWakeLockSummary=0x1, mUserActivitySummary=0x1, mBootCompleted=true
11-13 21:57:26.156: I/ComBroadcastReceiver(28917): ComBroadcastReceiver action = android.server.am.ActivityStack.taskstatechange
11-13 21:57:26.166: I/ActivityManager(477): Start proc com.xxxx.xxxx for activity com.xxxx.xxxx/.xxxxActivity: pid=10596 uid=10176 gids={50176, 1015, 3003, 1028}
11-13 21:57:26.179: I/dalvikvm(10596): Turning on JNI app bug workarounds for target SDK version 10...
11-13 21:57:26.202: D/Sensors(477): sensors_poll_context_t->activate(handle: 0, enabled: 1)
11-13 21:57:26.202: D/PowerManagerService(477): handleSandman: canDream=false, mWakefulness=Awake
11-13 21:57:26.206: D/Sensors(477): virtual int AccelerometerSensor::enable(int32_t, int): fd (230 ),en (1),flags(1), mEnabled(0),input_sys_path (/sys/class/input/event4/device/device/enable)
11-13 21:57:26.206: D/Sensors(477): sensors_poll_context_t->setDelay(handle: 0, ns: 200000000)
11-13 21:57:26.206: D/Sensors(477): sensors_poll_context_t->setDelay(handle: 0, ns: 66667000)
11-13 21:57:26.206: W/ActivityRecord(477): goujw packagename: com.xxxx.xxxx
11-13 21:57:26.209: W/ActivityRecord(477): goujw userId: 0
11-13 21:57:26.242: D/CubicBezierInterpolator(477): CubicBezierInterpolator mControlPoint1x = 0.5, mControlPoint1y = 0.2, mControlPoint2x = 0.6, mControlPoint2y = 1.0
11-13 21:57:26.249: W/System.err(10596): java.io.FileNotFoundException: /data/cust/xml/hw_launcher_load_icon.xml: open failed: ENOENT (No such file or directory)
11-13 21:57:26.249: W/System.err(10596): at libcore.io.IoBridge.open(IoBridge.java:409)
11-13 21:57:26.252: I/PowerManagerService(477): state=2
11-13 21:57:26.252: W/System.err(10596): at java.io.FileInputStream.<init>(FileInputStream.java:109)
11-13 21:57:26.252: W/System.err(10596): at android.content.res.ResourcesEx.readDefaultConfig(ResourcesEx.java:808)
11-13 21:57:26.252: W/System.err(10596): at android.content.res.ResourcesEx.<init>(ResourcesEx.java:741)
11-13 21:57:26.252: W/System.err(10596): at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1721)
11-13 21:57:26.252: W/System.err(10596): at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:1752)
11-13 21:57:26.256: W/System.err(10596): at android.app.LoadedApk.getResources(LoadedApk.java:485)
11-13 21:57:26.256: W/System.err(10596): at android.app.ContextImpl.init(ContextImpl.java:1911)
11-13 21:57:26.256: W/System.err(10596): at android.app.ContextImpl.init(ContextImpl.java:1904)
11-13 21:57:26.256: W/System.err(10596): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4269)
11-13 21:57:26.256: W/System.err(10596): at android.app.ActivityThread.access$1300(ActivityThread.java:145)
11-13 21:57:26.256: W/System.err(10596): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
11-13 21:57:26.256: W/System.err(10596): at android.os.Handler.dispatchMessage(Handler.java:99)
11-13 21:57:26.256: W/System.err(10596): at android.os.Looper.loop(Looper.java:137)
11-13 21:57:26.256: W/System.err(10596): at android.app.ActivityThread.main(ActivityThread.java:5095)
11-13 21:57:26.256: W/System.err(10596): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 21:57:26.256: W/System.err(10596): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 21:57:26.256: W/System.err(10596): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
11-13 21:57:26.256: W/System.err(10596): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
11-13 21:57:26.256: W/System.err(10596): at dalvik.system.NativeStart.main(Native Method)
11-13 21:57:26.256: W/System.err(10596): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
11-13 21:57:26.259: W/System.err(10596): at libcore.io.Posix.open(Native Method)
11-13 21:57:26.259: W/System.err(10596): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
11-13 21:57:26.259: W/System.err(10596): at libcore.io.IoBridge.open(IoBridge.java:400)
11-13 21:57:26.259: W/System.err(10596): ... 19 more
11-13 21:57:26.272: I/TiApplication(10596): (main) [0,0] checkpoint, app created.
11-13 21:57:26.356: W/System.err(10596): Invalid int: ""
11-13 21:57:26.416: I/TiApplication(10596): (main) [141,141] Titanium 3.1.3 (2013/09/18 12:01 222f4d1)
11-13 21:57:26.482: I/TiApplication(10596): (main) [68,209] Titanium Javascript runtime: v8
11-13 21:57:26.482: D/dalvikvm(10596): Trying to load lib /data/app-lib/com.xxxx.xxxx-2/libstlport_shared.so 0x424249f0
11-13 21:57:26.486: D/dalvikvm(10596): Added shared lib /data/app-lib/com.xxxx.xxxx-2/libstlport_shared.so 0x424249f0
11-13 21:57:26.486: D/dalvikvm(10596): No JNI_OnLoad found in /data/app-lib/com.xxxx.xxxx-2/libstlport_shared.so 0x424249f0, skipping init
11-13 21:57:26.486: D/dalvikvm(10596): Trying to load lib /data/app-lib/com.xxxx.xxxx-2/libkroll-v8.so 0x424249f0
11-13 21:57:26.496: D/dalvikvm(10596): Added shared lib /data/app-lib/com.xxxx.xxxx-2/libkroll-v8.so 0x424249f0
11-13 21:57:26.502: I/TiRootActivity(10596): (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
11-13 21:57:26.502: I/TiApplication(10596): (main) [1,1] Analytics have been disabled
11-13 21:57:26.706: W/V8Object(10596): Runtime disposed, cannot set property 'userAgent'

android google map v.2 : android.view.InflateException: Binary XML file line #739: Error inflating class fragment

I found similar topics in stackoverflow but it didn't help for me. I want to show map, but when i run it, it return force close. Here are the codes :
map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map))
.getMap();
this is my layout :
<fragment
android:id="#+id/map"
android:layout_width="fill_parent"
android:layout_height="300dp"
android:layout_margin="20dp"
class="com.google.android.gms.maps.MapFragment" />
this is my manifest :
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="MY_API_KEY" />
</application>
this my logcat :
11-13 16:03:10.652: E/AndroidRuntime(32202): FATAL EXCEPTION: main
11-13 16:03:10.652: E/AndroidRuntime(32202): java.lang.RuntimeException: Unable to start activity ComponentInfo{id.go.kpp.aplikasipupi/id.go.kpp.aplikasipupi.kartu}: android.view.InflateException: Binary XML file line #739: Error inflating class fragment
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.ActivityThread.access$600(ActivityThread.java:140)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.os.Handler.dispatchMessage(Handler.java:99)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.os.Looper.loop(Looper.java:137)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.ActivityThread.main(ActivityThread.java:4895)
11-13 16:03:10.652: E/AndroidRuntime(32202): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 16:03:10.652: E/AndroidRuntime(32202): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
11-13 16:03:10.652: E/AndroidRuntime(32202): at dalvik.system.NativeStart.main(Native Method)
11-13 16:03:10.652: E/AndroidRuntime(32202): Caused by: android.view.InflateException: Binary XML file line #739: Error inflating class fragment
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:306)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.Activity.setContentView(Activity.java:1912)
11-13 16:03:10.652: E/AndroidRuntime(32202): at id.go.kpp.aplikasipupi.kartu.onCreate(kartu.java:100)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.Activity.performCreate(Activity.java:5163)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
11-13 16:03:10.652: E/AndroidRuntime(32202): ... 11 more
11-13 16:03:10.652: E/AndroidRuntime(32202): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4030500 but found 0. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.maps.internal.q.v(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.maps.internal.q.u(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.maps.MapFragment$b.cE(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.maps.MapFragment$b.a(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.dynamic.a.a(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.app.Activity.onCreateView(Activity.java:4813)
11-13 16:03:10.652: E/AndroidRuntime(32202): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
11-13 16:03:10.652: E/AndroidRuntime(32202): ... 24 more
i don't know why it still error, i hope somebody can help me to solve my problem.
The logcat is clear
You need to add the below to manifest file
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
https://developers.google.com/maps/documentation/android/start#add_the_google_play_services_version_to_your_apps_manifest
Edit your application's AndroidManifest.xml file, and add the following declaration within the <application> element. This embeds the version of Google Play services that the app was compiled with.
I got the same exception as well, but I figured out for Google API v2 to work, you must include these permissions
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
I hope this will help you guys.
P.S I used these permissions for adding a simple map in my app. There are certain other permissions which this link suggests as well.

Android adding adMob not Working

I have been trying to add adMob on my application, but I have naver been able to make it work on my app. Finally I have downloaded a sample adMob app from adMob's web site. However, that doesn't work either. And I get that log below:
11-13 18:24:21.477: D/AndroidRuntime(2225): Shutting down VM
11-13 18:24:21.477: W/dalvikvm(2225): threadid=1: thread exiting with uncaught exception (group=0xb40cb180)
11-13 18:24:21.507: E/AndroidRuntime(2225): FATAL EXCEPTION: main
11-13 18:24:21.507: E/AndroidRuntime(2225): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.example.ads.xml/com.google.example.ads.xml.BannerSample}: android.view.InflateException: Binary XML file line #10: Error inflating class com.google.ads.AdView
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.ActivityThread.access$600(ActivityThread.java:123)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.os.Handler.dispatchMessage(Handler.java:99)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.os.Looper.loop(Looper.java:137)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.ActivityThread.main(ActivityThread.java:4424)
11-13 18:24:21.507: E/AndroidRuntime(2225): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 18:24:21.507: E/AndroidRuntime(2225): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 18:24:21.507: E/AndroidRuntime(2225): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
11-13 18:24:21.507: E/AndroidRuntime(2225): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
11-13 18:24:21.507: E/AndroidRuntime(2225): at dalvik.system.NativeStart.main(Native Method)
11-13 18:24:21.507: E/AndroidRuntime(2225): Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class com.google.ads.AdView
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
11-13 18:24:21.507: E/AndroidRuntime(2225): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.Activity.setContentView(Activity.java:1835)
11-13 18:24:21.507: E/AndroidRuntime(2225): at com.google.example.ads.xml.BannerSample.onCreate(BannerSample.java:14)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.Activity.performCreate(Activity.java:4465)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
11-13 18:24:21.507: E/AndroidRuntime(2225): ... 11 more
11-13 18:24:21.507: E/AndroidRuntime(2225): Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView
11-13 18:24:21.507: E/AndroidRuntime(2225): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
11-13 18:24:21.507: E/AndroidRuntime(2225): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
11-13 18:24:21.507: E/AndroidRuntime(2225): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.createView(LayoutInflater.java:552)
11-13 18:24:21.507: E/AndroidRuntime(2225): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
11-13 18:24:21.507: E/AndroidRuntime(2225): ... 21 more
11-13 18:24:21.798: I/dalvikvm(2225): threadid=3: reacting to signal 3
11-13 18:24:21.808: I/dalvikvm(2225): Wrote stack traces to '/data/anr/traces.txt'
11-13 18:24:22.148: I/dalvikvm(2225): threadid=3: reacting to signal 3
11-13 18:24:22.158: I/dalvikvm(2225): Wrote stack traces to '/data/anr/traces.txt'
I have gotten this error before, when I got it it was because I had accidentally removed the admobSDK.jar from my application. However, it seems more likely that the below solution will work better for you.
If you are using ADT r17 or higher, then you need to create a libs/ folder in your project, and then copy the adMob SDK into that folder.
Here is another similar post
Error inflating class com.google.ads.AdView

LstView findViewByID returning null

I have several objects defined in XML that are returning null when I try to get a handle on them. I saw several post saying to clean the project but that did not help. When I explore the ListView object all the children are null?? So I am at a bit of a loss as to what I am doing wrong. Here is the code that I think is relevant but if you need to see something else let me know and I'll post it.
TIA
JB
<Button
android:id="#+id/btn_NextLift"
android:layout_width="100dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginRight="30dp"
android:layout_marginBottom="40dp"
android:text="#string/str_BtnNxtTxt"
android:onClick="btn_NextLiftClick"
android:longClickable="true" />
In the activity:
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.liftinterface);
...//More code....
...//Still in the OnCreate....
lstvw_LiftData = (ListView)findViewById(R.id.lstvw_LiftData);
...//Image below of this object.....
//Get a handle on our button
Button btn_Nxt = (Button)this.findViewById(R.id.btn_NextLift);
btn_Nxt.setOnLongClickListener(new OnLongClickListener()
{
public boolean onLongClick(View v)
{
SaveAdvance();
return true;
}
});
Here is my logcat errors only:
11-13 22:04:57.798: E/AndroidRuntime(787): FATAL EXCEPTION: main
11-13 22:04:57.798: E/AndroidRuntime(787): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.gpgvm.ironmike/org.gpgvm.ironmike.IcyArmActivity}: java.lang.NullPointerException
11-13 22:04:57.798: E/AndroidRuntime(787): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
11-13 22:04:57.798: E/AndroidRuntime(787): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
11-13 22:04:57.798: E/AndroidRuntime(787): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-13 22:04:57.798: E/AndroidRuntime(787): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
11-13 22:04:57.798: E/AndroidRuntime(787): at android.os.Handler.dispatchMessage(Handler.java:99)
11-13 22:04:57.798: E/AndroidRuntime(787): at android.os.Looper.loop(Looper.java:123)
11-13 22:04:57.798: E/AndroidRuntime(787): at android.app.ActivityThread.main(ActivityThread.java:3683)
11-13 22:04:57.798: E/AndroidRuntime(787): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 22:04:57.798: E/AndroidRuntime(787): at java.lang.reflect.Method.invoke(Method.java:507)
11-13 22:04:57.798: E/AndroidRuntime(787): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-13 22:04:57.798: E/AndroidRuntime(787): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-13 22:04:57.798: E/AndroidRuntime(787): at dalvik.system.NativeStart.main(Native Method)
11-13 22:04:57.798: E/AndroidRuntime(787): Caused by: java.lang.NullPointerException
11-13 22:04:57.798: E/AndroidRuntime(787): at org.gpgvm.ironmike.IcyArmActivity.onCreate(IcyArmActivity.java:83)
11-13 22:04:57.798: E/AndroidRuntime(787): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-13 22:04:57.798: E/AndroidRuntime(787): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
11-13 22:04:57.798: E/AndroidRuntime(787): ... 11 more
When I explore the ListView object all the children are null??
Views are not draw until after onResume() has completed. So the ListView will not have any children in onCreate().
Where is this Button? If it is in the ListView, you need to write a custom adapter to override it's listeners.
Addition
It is in the ListView layout.
You need to extend you current adapter and override getView() to give each row unique listeners like this. Please watch Android's Romain Guy discussion this exact topic in fabulous detail at multiple Google Talk events.

Categories

Resources