Archives for Tutorials - Page 18
How to generate a Random alpha-numeric String ?
When you develop some applications in Java or on Android platform, you can sometimes need to generate a random alpha-numeric String to generate a session id, a unique temporary id or simply to generate sample string data. Use cases are multiples and to make that there are a lot of possibilities. In the following of this tutorial, we’re going to…
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…
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…
Is Java pass parameters by value or by reference ?
Today, we go back to the basics and we’re going to understand to a simple but sometimes hard to answer for some developers. Are Java parameters passed by value or by reference ? Before to answer, it seems important to define what is the difference between these two kinds of methods to pass arguments in methods. From Wikipedia, we get the…
What is a Java Bean and a Java POJO ?
As a Java developer, you are surely used to read these terms in Java articles or blogs. Often, authors speak you about Java Bean or POJO (Plain Old Java Objects). But, some developers don’t know really what is behind these acronyms. To be clear, this is the definition for both terms. POJO The term of POJO has been used the…
How to send an Email in Android ?
Last week, I shown you how to send an Email in Android thanks to JavaMail API by using GMail SMTP. This week, you're going to learn how to send an Email in Android by using Intent and so applications installed on the Android OS. Code snippet is very simple compared to solution using JavaMail API : String to = "To";…
Learn to consume a REST Web Service and parse JSON result in Android
In mobiles applications, very often you should get data from a Web Service to update content displayed to users. For example, you can imagine a weather application that needs to request weather data from a remote server. Content getted can be under different formats but JSON format is one of the most used format with REST Web Service. So, you're…
How to use Asynchronous Tasks in Android ?
In Android like in others platforms, it can be useful to use asynchronous tasks to process long operations like download a file or consume a web service. In Java, you know that the entry point is the Thread class. Android using a part of Java API, you can also use Thread class but it's to you to manage synchronization with…
First steps with Android Wear
Announced during Google I/O 2014, Android Wear is the Android platform for wearable devices. It extends the Android platform to a new generation of devices with a user experience targeting wearables' specifities. Actually only Smart Watches are supported by Android Wear but trust that Google will extend the platform into other forms of wearables in the near future. Actually, Android Wear…
How to send an email with JavaMail API in Android ?
As an Android developer, you're used to send email thanks to Android standard API provided in standard SDK. To achieve that, you use and call startActivity method to delegate to OS the sending email process. Perhaps, you would like to manage the entire process in your application when you send an email in Android. If you want to make this,…