O'Reilly logo

Bulletproof Android™: Practical Advice for Building Secure Apps by Godfrey Nolan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Backing Up the Database Using adb

Let’s look at how to write to a SQLite application and how someone can pull the database off the phone. To begin, we need to add a SQLite database to the Android HelloWorld app. Listing 5-1 shows how to add a SQLite database to your Android app.

Listing 5-1 Adding SQLite to your code

package com.riis.sqlite3;import java.io.File;import android.os.Bundle;import android.app.Activity;import android.database.sqlite.SQLiteDatabase;                         // line 7public class MainActivity extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {          super.onCreate(savedInstanceState);          setContentView(R.layout.activity_main);          InitializeSQLite3();                                       // ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required