Here you can not fetch data without internet. But it is possible to use old data. Once you are downloading data from internet store it into database.
Here most people suggest SQLite database
. My suggestion use anyone database (SQLite or SQLCipher
) . After that before uploading your data just insert it into database and post from database. Because once network failure data will not be lost.
Broadcast Receiver
:
This broadcast receiver is used to notify you the network changes. Once network is connected write your post code. Maybe here also possible to the network failure. But data still in database so it won't loss.