Question: I'm doing Android app using web services. As of now each time getting response from server. If network fails i can't to get data. Activity showing empty screen. Instead of showing empty screen i want to save all data locally.

If network fails i want to get it from locally and show.

How to do that. Please share your valuable ideas.

`IOS` have core data to save values. Is `Android` have any option like that

Answer: 
Create sqlite databse save all data u fetching from server. 

SQLiteDatabase db = getWritableDatabse();

```
ContentValues contentValues = new ContentValues();
contentValues.put("ID", offlineData.getKey());
contentValues.put("RESPONSE_JSON", offlineData.getJson());
contentValues.put("LAST_UPDATED_TIME",
        String.valueOf(offlineData.getUpdatedTime()));
if(recordId==-1) {
    recordId = db.insert(TABLE_NAME, null, contentValues);
}else{
    recordId = db.update(TABLE_NAME, contentValues, "ID " + "="+offlineData.getKey(), null);
}
db.close();

```
If you mean when your app fetches the data for the first time you want to store it locally and when it fails next time you want to show locally stored data. If i am right 

You can store the fetched data into MySqlite database. [android Database Tutorials](http://www.androidhive.info/2013/09/android-sqlite-database-with-multiple-tables/)

and note that whenever new data is reveveid from web service update it locally. Else you will have old data in your database.