Ad

Monday, July 29, 2013

How to install an Android Driver in the Window PC?

Step 1:
   Download the drivers from the website..
   For example: You can get asus drivers from here.

Step 2:
  Connect the device to the system.

Step 3:
   Open the device Manager.
      Win7:help
      WinXP:help

Step 4:
  Select the device(in the Other device).

Step 5:
   Select the button "Reinstall Driver".

   Then choose the driver file.  And install..

How to enable DEVELOPER OPTION in NEXUS 7 (Android 4.2.2)

Step 1:
 Open the settings.

Step 2:
  Tap the "About Tablet"/ "About Phone" in the system..

Step 3:
  Repeatedly tap on Build Number (5+ taps) until you got a message:"you are now a developer!"
  

Sunday, July 7, 2013

How to copy sqlite db from Asset Folder in Android ?

 1. Put the dbfile in the asset folder.

2. Create an instance to the dbFile.

File dbfile=new File(parentfolder,dbfile); (we can choose any folder as parent folder)

3. Check whether db is existing or not. if not copy it to the folder.

if (!dbfile.exists()) {
try {
copyDatabase(dbfile);
} catch (IOException e) {
throw new RuntimeException("Error creating source database", e);
}
}

private void copyDatabase(File dbFile) throws IOException {
InputStream is = context.getAssets().open(DB_NAME);
OutputStream os = new FileOutputStream(dbFile);
 
byte[] buffer = new byte[1024];
while (is.read(buffer) > 0) {
os.write(buffer);
}
 
os.flush();
os.close();
is.close();
}