Archives for Android - Page 14

Android

Schedule tasks on Android Lollipop with JobScheduler API

Before Android Lollipop , there was just one solution to schedule tasks on Android. You must use the AlarmManager system service acquired thanks to the following method call : (AlarmManager) getSystemService(); The AlarmManager was functional but had some major disadvantages. First, it doesn’t consider if the device is connected to a power plug, idle or connected to a unmetered network.…
Continue Reading
Android

How to use Cryptography in Android applications ?

When you made an Android applications, you must very often store data in file to persist applications state or games state. For example, you can store some data of a game that lets users to restart game to the same state. Major concern comes from advanced that would change these data to cheat in your game ! To avoid this…
Continue Reading
Android

Backup and Restore data from the Cloud thanks to Android Backup API

When Android’s user installs your app on a particular device and start to use it, you can store some data letting him to use easily the application. You can also store high score or other data for a game. If user must make a restore of his system or if user changes his device, it’s great to let him to…
Continue Reading
Android

Getting started with Google Maps Android API V2 – Part 1

Google Maps provides to Android developers a powerful API to display maps in applications. Google Maps API V2 is now part of Google Play Services. 1. Get Google Play Services First, you need to get Google Play Services to use in your Android application. If you use Android Studio, you must simply add the following dependency to your Gradle build…
Continue Reading
Android

How to get user current location with GPS or Network in Android?

Thanks to smartphones, modern mobile applications can benefit from GPS installed to get user current location. This information adds a lot of value to an application. Web’s giants have understood this since long time. So, in your next application, you could use GPS or Network to get user current location and add value to your application. For example, if you…
Continue Reading
Android

How to check if internet connection is enabled in Android ?

Today, a simple article exposing a snippet code lets you to know if user’s internet connection is enabled in Android. It can be very important to know if user is connected before to send internet requests that are useless. First, you must add following permissions to your Android Manifest : <uses-permission android:name="; /> <uses-permission android:name="; /> I presume that you…
Continue Reading
Android

Learn how to parse JSON in Android with Gson

Previously you had learnt to consume a REST Web Service in JSON and parse result to display data in an Android application. To start from basics, I show you raw method that uses only standard SDK and no third-party libraries. I think it's better when you begin to understand how things work. Now, you know raw method so we can…
Continue Reading
Android

Create an Android Weather app step by step – Part 1

In this tutorial serie, you're going to learn how to create an Android Weather app step by step. You could already see the final result of the tutorial :  Current Weather Forecasts The goal is to show you the following steps for the creation of our Android Weather app : Step 1 : Design Step 2 : Architecture Step 3…
Continue Reading
Android

How to pick an image from Gallery and use it in Android ?

In Android applications, it can be useful to offer users the possibility to pick an image from their Gallery. When image is picked, you can then use it in a wallpaper for example or to work on the image depending the purpose of your application. To achieve that, you must first launch the intent ACTION_PICK to let OS prompt dialog…
Continue Reading