Skip to content

Instantly share code, notes, and snippets.

View ShreyashPromact's full-sized avatar
🎯
Focusing

Shreyash Mahajan ShreyashPromact

🎯
Focusing
View GitHub Profile
# GOOGLE SAMPLE PACKAGING DATA
#
# This file is used by Google as part of our samples packaging process.
# End users may safely ignore this file. It has no relevance to other systems.
---
status: PUBLISHED
technologies: [Android]
categories: [UI]
languages: [Java]
solutions: [Mobile]
@ShreyashPromact
ShreyashPromact / ApplicationOffline.java
Last active December 16, 2016 06:53
Make your Android app to have Offline support with HttpURLConnection
Android - Make application offline
What is offline mode means?
Offline means to make application capable to load the data and resources from server even when internet connectivity is not available. The resources are like server responses, Image loading from the server, etc..
Why is it required?
If you are developing an android application which required an internet connection to load data from the server then this feature really going to help that developer to give support of access data even when the internet is not available. Now a days most of the client requesting about this feature. They want their customer to show data and information when Internet is not available. It might also possible that some of the area may not have proper internet connectivity. At that time, such feature help users to view information without internet.
Let's checkout, how that can be done
Here we are going to make the API call (Server request) in such a way that, it will load the data even when the internet is not available (
#Below is the example for how to make gradle to have apk file name with version.
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
... SOMETHING LIKE RELEASE SIGNING CONFIG ...
}