[android-developers] Audio Book
Hi Guys, I am working on an application where i need to download large audio files(30 mb). After purchasing user can download the audio files. So i am wondering that if i download the files from server there might be internet connection problem midle of the download(files are big). Because these files are paid(in app purchase) what should be the proper way of doing this. I need suggessions. Is there any audio book in google play like Iphone have? If yes please send me the link. Thanks Plabon Modak -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Multiple sqlite db upgrade
Actually I need to add some new data to all the databases and want to keep the previous data inserted by the user. Now the problem is in the onUpgrade() method i get only one db as a input parameter so how can i get the previous data of user of other db. On Sun, Jun 3, 2012 at 12:04 AM, lbendlin l...@bendlin.us wrote: what exactly do you need to upgrade? Can't you just run a few scripts in onUpgrade ? On Saturday, June 2, 2012 8:02:22 AM UTC-4, RawCoder wrote: Hi guys, I am working on an android application where i have to use multiple databases. I have used previously created db file. Actually i am copying the db file from asset folder. Now there is option to add data for the user(add favorites). The user data will be added in all three db. Now the problem is i need to upgrade all the db when there is a new version of the app. I have to keep the user data inserted by the user and add the changes of the new db. I have done some googling and find solution to upgrade one db but i can not find a solution to upgrade all the databases and keep the old versions user data. Here is my dbhelper class: //**//** //** package riskycoder.database.helper; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Locale; import riskycoder.utils.**AppStaticValues; import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.**SQLiteDatabase; import android.database.sqlite.**SQLiteException; import android.database.sqlite.**SQLiteOpenHelper; import android.util.Log; public class DataBaseHelper extends SQLiteOpenHelper { private static String DB_PATH = /data/data/riskycoder.login/** databases/; public static String DB_NAME = datenbank_EN.sqlite; private SQLiteDatabase myDataBase; private final Context myContext; private static final int DATABASE_VERSION = 1; private static final String DB_NAME_ENG = datenbank_EN.sqlite; private static final String DB_NAME_GER = datenbank_DE.sqlite; private static final String DB_NAME_SPA = datenbank_SP.sqlite; private Cursor updateCursor; public static void setDataBaseName(String lan) { if(lan.equals(ENG)) { DB_NAME=DB_NAME_ENG; } else if(lan.equals(GER)) { DB_NAME=DB_NAME_GER; } else if(lan.equals(SPA)) { DB_NAME=DB_NAME_SPA; } } public DataBaseHelper(Context context) { super(context, DB_NAME, null, DATABASE_VERSION); this.myContext = context; updateCursor=null; } public void createDataBase() throws IOException { boolean dbExist = checkDataBase(); if (dbExist) { this.getWritableDatabase(); } else { this.getWritableDatabase(); try { this.close(); copyDataBase(); } catch (IOException e) { throw new Error(Error copying database); } } } private boolean checkDataBase() { SQLiteDatabase checkDB = null; try { String myPath = DB_PATH + DB_NAME; checkDB = SQLiteDatabase.openDatabase(**myPath, null,SQLiteDatabase.OPEN_ **READWRITE); } catch (SQLiteException e) { } if (checkDB != null) checkDB.close(); return checkDB != null ? true : false; } private void copyDataBase() throws IOException { InputStream myInput = myContext.getAssets().open(DB_**NAME); String outFileName = DB_PATH + DB_NAME; OutputStream myOutput = new FileOutputStream(outFileName); byte[] buffer = new byte[2048]; int length; while ((length = myInput.read(buffer)) 0) { myOutput.write(buffer, 0, length); } myOutput.flush(); myOutput.close(); myInput.close(); //myDataBase.setVersion(**DATABASE_VERSION); } public void openDataBase() throws SQLException { String myPath = DB_PATH + DB_NAME; myDataBase = SQLiteDatabase.openDatabase(**myPath, null,SQLiteDatabase.OPEN_**READWRITE); Log.d(Test, Database version: +myDataBase.getVersion()); if(updateCursor!=null updateCursor.getCount()!=0) { updateCursor.moveToFirst(); do{ myDataBase.execSQL(UPDATE Content SET is_favourite='1' WHERE content_id ='+updateCursor.getInt(**updateCursor.getColumnIndex(**content_id))+' AND category_id = '+updateCursor.getInt(**updateCursor.getColumnIndex( **category_id))+'); }while(updateCursor.**moveToNext()); updateCursor.close(); } } @Override public synchronized void close() { if (myDataBase != null) myDataBase.close(); super.close(); } public Cursor Get_Header_Cursor(){ Cursor cursor; cursor = myDataBase.rawQuery(select * from Headers ORDER BY header_orderId,null); return cursor; } public Cursor Get_Group_Cursor(int id){ Cursor cursor = myDataBase.rawQuery(select * from Categories where header_id = +id+ ORDER BY category_orderId,null); return cursor; } public Cursor Get_Content_Cursor(int id){ Cursor cursor = myDataBase.rawQuery(select * from Content where category_id = +id,null); return cursor; } public Cursor
[android-developers] Multiple sqlite db upgrade
Hi guys, I am working on an android application where i have to use multiple databases. I have used previously created db file. Actually i am copying the db file from asset folder. Now there is option to add data for the user(add favorites). The user data will be added in all three db. Now the problem is i need to upgrade all the db when there is a new version of the app. I have to keep the user data inserted by the user and add the changes of the new db. I have done some googling and find solution to upgrade one db but i can not find a solution to upgrade all the databases and keep the old versions user data. Here is my dbhelper class: // package riskycoder.database.helper; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Locale; import riskycoder.utils.AppStaticValues; import android.content.Context; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteException; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; public class DataBaseHelper extends SQLiteOpenHelper { private static String DB_PATH = /data/data/riskycoder.login/databases/; public static String DB_NAME = datenbank_EN.sqlite; private SQLiteDatabase myDataBase; private final Context myContext; private static final int DATABASE_VERSION = 1; private static final String DB_NAME_ENG = datenbank_EN.sqlite; private static final String DB_NAME_GER = datenbank_DE.sqlite; private static final String DB_NAME_SPA = datenbank_SP.sqlite; private Cursor updateCursor; public static void setDataBaseName(String lan) { if(lan.equals(ENG)) { DB_NAME=DB_NAME_ENG; } else if(lan.equals(GER)) { DB_NAME=DB_NAME_GER; } else if(lan.equals(SPA)) { DB_NAME=DB_NAME_SPA; } } public DataBaseHelper(Context context) { super(context, DB_NAME, null, DATABASE_VERSION); this.myContext = context; updateCursor=null; } public void createDataBase() throws IOException { boolean dbExist = checkDataBase(); if (dbExist) { this.getWritableDatabase(); } else { this.getWritableDatabase(); try { this.close(); copyDataBase(); } catch (IOException e) { throw new Error(Error copying database); } } } private boolean checkDataBase() { SQLiteDatabase checkDB = null; try { String myPath = DB_PATH + DB_NAME; checkDB = SQLiteDatabase.openDatabase(myPath, null,SQLiteDatabase.OPEN_READWRITE); } catch (SQLiteException e) { } if (checkDB != null) checkDB.close(); return checkDB != null ? true : false; } private void copyDataBase() throws IOException { InputStream myInput = myContext.getAssets().open(DB_NAME); String outFileName = DB_PATH + DB_NAME; OutputStream myOutput = new FileOutputStream(outFileName); byte[] buffer = new byte[2048]; int length; while ((length = myInput.read(buffer)) 0) { myOutput.write(buffer, 0, length); } myOutput.flush(); myOutput.close(); myInput.close(); //myDataBase.setVersion(DATABASE_VERSION); } public void openDataBase() throws SQLException { String myPath = DB_PATH + DB_NAME; myDataBase = SQLiteDatabase.openDatabase(myPath, null,SQLiteDatabase.OPEN_READWRITE); Log.d(Test, Database version: +myDataBase.getVersion()); if(updateCursor!=null updateCursor.getCount()!=0) { updateCursor.moveToFirst(); do{ myDataBase.execSQL(UPDATE Content SET is_favourite='1' WHERE content_id ='+updateCursor.getInt(updateCursor.getColumnIndex(content_id))+' AND category_id = '+updateCursor.getInt(updateCursor.getColumnIndex(category_id))+'); }while(updateCursor.moveToNext()); updateCursor.close(); } } @Override public synchronized void close() { if (myDataBase != null) myDataBase.close(); super.close(); } public Cursor Get_Header_Cursor(){ Cursor cursor; cursor = myDataBase.rawQuery(select * from Headers ORDER BY header_orderId,null); return cursor; } public Cursor Get_Group_Cursor(int id){ Cursor cursor = myDataBase.rawQuery(select * from Categories where header_id = +id+ ORDER BY category_orderId,null); return cursor; } public Cursor Get_Content_Cursor(int id){ Cursor cursor = myDataBase.rawQuery(select * from Content where category_id = +id,null); return cursor; } public Cursor Get_Favourite_Cursor(){ Cursor cursor = myDataBase.rawQuery(select * from Content where is_favourite = 1,null); return cursor; } @Override public void onCreate(SQLiteDatabase db) { } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { if(newVersionoldVersion) { updateCursor = db.rawQuery(select * from Content where is_favourite = 1,null); Log.d(Test, is fav+updateCursor.getCount()); try { copyDataBase(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } /// Please help how to upgrade all the databases...
[android-developers] About image
Hi all, I have a image of a map. I want to place other images(pin) in a specific position(x and y) of that map image(Like google map). Is that possible? Please help.. Thanks Plabon Modakj -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] About image
I have a image of a map. I want to place other images(pin) in a specific position(x and y) of that map image(Like google map).How to do this? On Wed, Jan 18, 2012 at 1:54 PM, TreKing treking...@gmail.com wrote: On Wed, Jan 18, 2012 at 5:13 AM, Plabon Modak plabonmo...@gmail.comwrote: Is that possible? Yes. Please help.. With what? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Android Calender help needed
Hi, I want to make a android calender application. I want to use calendar in my android application in grid view format and it will show events and images on a specific date. Is there any jar or any kind of calender widget or anything else please help me. Regards, Plabon Modak -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Android Widget update problem
Hi, I have made a android widget for my application. I have used a layout(linear) in the xml of the widget. There is a textview showing some text in that layout. Now i want to change the text of the textview on tapping or clicking the layout. Can any one help me to do that. Thanks, RawCoder -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Android Widget update problem
But there is only views.setOnClickPendingIntent(R.id.tipslayout, actionPendingIntent); this method for widget. I didnot get any setonclicklistener(). Can u please provide an example code for me? On Mon, Sep 26, 2011 at 6:19 PM, tamil maran tam.mara...@gmail.com wrote: write the onclick event for layout ,and inside of click event we can set the text -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en