Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Discussion > Android Applications

Android Applications All the information you could ever want about Android Applications. Learn about apps and get help with them... all here! New apps can be found and announced in the Applications Announcements forum linked below.



Reply
 
LinkBack Thread Tools
Old September 8th, 2011, 01:10 PM   #1 (permalink)
New Member
 
Join Date: Sep 2011
Location: San Diego
Posts: 1
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help in app

Hi,

I am new to android apps development. I tried to submit my app in amazon but facing some issues. Will really appreciate if somebody helps me to some this issue.

Thanks


The error log from amazon team,

08-11 10:41:29.136 W/dalvikvm(3898): VFY: rejecting call to Lcom/amazon/android/Kiwi;.onActivityResult (Landroid/app/Activity;IILandroid/content/IntentZ
08-11 10:41:29.136 W/dalvikvm(3898): VFY: rejecting opcode 0x71 at 0x0000
08-11 10:41:29.136 W/dalvikvm(3898): VFY: rejected Lcom/android/mygroceries/DataBaseHelper;.onActivityResult (IILandroid/content/IntentV
08-11 10:41:29.136 W/dalvikvm(3898): Verifier rejected class Lcom/android/mygroceries/DataBaseHelper;
08-11 10:41:29.136 D/AndroidRuntime(3898): Shutting down VM
08-11 10:41:29.136 W/dalvikvm(3898): threadid=1: thread exiting with uncaught exception (group=0x400259f8)
08-11 10:41:29.136 E/AndroidRuntime(3898): FATAL EXCEPTION: main
08-11 10:41:29.136 E/AndroidRuntime(3898): java.lang.VerifyError: com.android.mygroceries.DataBaseHelper
08-11 10:41:29.136 E/AndroidRuntime(3898): at com.android.mygroceries.mainmenu.onCreatemainmenu( mainmenu.java)
08-11 10:41:29.136 E/AndroidRuntime(3898): at com.android.mygroceries.mainmenu.onCreate(mainmenu .java)
08-11 10:41:29.136 E/AndroidRuntime(3898): at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1069)
08-11 10:41:29.136 E/AndroidRuntime(3898): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:2751)
08-11 10:41:29.136 E/AndroidRuntime(3898): at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:2803)
08-11 10:41:29.136 E/AndroidRuntime(3898): at android.app.ActivityThread.access$2300(ActivityThr ead.java:135)
08-11 10:41:29.136 E/AndroidRuntime(3898): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:2136)
08-11 10:41:29.136 E/AndroidRuntime(3898): at android.os.Handler.dispatchMessage(Handler.java:99 )
08-11 10:41:29.136 E/AndroidRuntime(3898): at android.os.Looper.loop(Looper.java:144)
08-11 10:41:29.136 E/AndroidRuntime(3898): at android.app.ActivityThread.main(ActivityThread.jav a:4937)
08-11 10:41:29.136 E/AndroidRuntime(3898): at java.lang.reflect.Method.invokeNative(Native Method)
08-11 10:41:29.136 E/AndroidRuntime(3898): at java.lang.reflect.Method.invoke(Method.java:521)
08-11 10:41:29.136 E/AndroidRuntime(3898): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:868)
08-11 10:41:29.136 E/AndroidRuntime(3898): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:626)
08-11 10:41:29.136 E/AndroidRuntime(3898): at dalvik.system.NativeStart.main(Native Method)
08-11 10:41:29.146 W/ActivityManager(97): Force finishing activity com.android.mygroceries/.mainmenu



my database activity file:


public class DataBaseHelper extends SQLiteOpenHelper {

private static String DB_PATH = "/data/data/com.android.mydatabase/databases/";
private static String DB_NAME = "knowLanguage.db";

private SQLiteDatabase db;
private final Context myContext;


/**
* Constructor
* Takes and keeps a reference of the passed context in order to access to the application assets and resources.
* @param context
*/
public DataBaseHelper(Context context) {

super(context, DB_NAME, null, 1);
this.myContext = context;
}

public void createDataBase() throws IOException{

try {
if(!this.checkDataBase()){
try {
this.getWritableDatabase();
/*Log.i("DATABASE:", "WRITABLE");*/
} catch(SQLiteException ex) {
this.getReadableDatabase();
/*Log.i("DATABASE:", "READABLE");*/
}
this.close();
try {
this.copyDataBase(myContext);
/*Log.i("DATABASE:", "COPY");*/
} catch (IOException e) {
Log.e("Database Error:", "Error copying database");
}
}
this.close();
} catch(SQLException eSQL){
Log.e("log_tag","Can not open database");
}
}

private boolean checkDataBase(){

File dbFile = new File(DB_PATH+DB_NAME);
return dbFile.exists();
}


public SQLiteDatabase copyDataBase(Context context) throws IOException,SQLiteException{

if (db != null && db.isOpen()) {
db.close();
}

File fileTest = context.getFileStreamPath(DB_NAME);
boolean exists = fileTest.exists();

if(exists==false)
{
InputStream myInput = context.getAssets().open(DB_NAME, Context.MODE_PRIVATE);
OutputStream myOutput = new FileOutputStream(DB_PATH + DB_NAME);
byte[] buffer = new byte[1024];
int length;

while ((length = myInput.read(buffer)) > 0) {
myOutput.write(buffer, 0, length);
}

myOutput.flush();
myOutput.close();
myInput.close();
}

return db = SQLiteDatabase.openDatabase(DB_PATH + DB_NAME, null, SQLiteDatabase.NO_LOCALIZED_COLLATORS);
}

public void openDataBase() throws SQLException{
String myPath = DB_PATH + DB_NAME;
db = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);
}

@Override
public synchronized void close() {
if(db != null && db.isOpen())
db.close();
super.close();
}

@Override
public void onCreate(SQLiteDatabase db) {

}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

}

}

reshmavt is offline  
Reply With Quote
Sponsors
Reply

Bookmarks

Tags
android, apps, error


Go Back   Android Forums > Android Discussion > Android Applications User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 08:48 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo