Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to store notification into local storage when network connection is off and receive atleast 10 notification after network is on .

I have used cordova push plugins and android sdk.

What I have tried:

I am new in android developer.Please help me
Posted
Updated 22-Jul-16 5:26am
Comments
Richard MacCutchan 14-Jul-16 4:10am    
What have you tried? Where are you stuck?

1 solution

You might want to consider using a BroadcastReceiver for ConnectivityManager.CONNECTIVITY_ACTION instead. From the docs:

A change in network connectivity has occurred. A connection has either been established or lost. The NetworkInfo for the affected network is sent as an extra; it should be consulted to see what kind of connectivity event occurred.

This receiver works for both WiFi and cellular data connectivity, unlike PhoneStateListener.LISTEN_DATA_CONNECTION_STATE,
which will only notify you for changes in cellular networks.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900