Floating widgets float over the screen over any app that is currently running. Here we will make a floating action button that you can drag around the screen to position and do actions on it. Add Permission For drawing over the other apps, you need “android.permission.SYSTEM_ALERT_WINDOW” permission. So add this entry in your manifest. Our… Read More »
Here is a simple CardView Demo in Android. This demo shows how you can apply Corner radius and Shadow in Android L. Here is the Activity. This is the Fragment that adds the CardView. The Layout for the Activity. Fragment for placing CardView. You can download the complete Android Studio Source Code from here..
Hello all, In Today’s article we will be discussing about the SyncAdapters in Android. SyncAdapter is just a simple plugin like structure for syncing your server and Device. Check out this post about Account authenticator before proceeding. Why do we use SyncAdapter instead of Using Alarm Manger to Sync? Automated execution Sync can be requested… Read More »
Sometimes you have the need to set up some app-wide configuration information in an Android app or need to create a class that can be used in multiple projects with a generic way of setting configuration values. This is particularly useful for things like API keys that will probably be different across apps but should… Read More »
Here is a simple example showing how to load a database values in a spinner in android. OK we will start. This is the layout for the spinner row. spinner_row.xml This is the layout for the interface. activity_main.xml Now this is the MainActivity.java file that uses the spinner and the database. Join the Forum discussion… Read More »
Here is a complete example of How to read and write files to SDCARD and application SandBox in Android. First create a new project and inside the mainActivity paste this code. Now create another class named MyFile.java and copy this code into it. Now the layout for the xml file. Note you should give this… Read More »
Actually this is really simple. I have already posted an example for how to download a file in this post. How to Download an image in ANDROID programatically? This is another one little different with a progressbar included. Previously I have shown three other methods to upload files to a server. Check these posts to… Read More »
Many of our application reqiures sending data from one intent to another. This is done by putting data into one intent using putExtras() and getting it in the other intent using the getExtras() which matches the string value. However you can pass string, boolean, integer etc between intents. For passing data between intents you need… Read More »
Hello all… In today’s tutorial I will show you how to add different layouts one over another in android through java code. For this we use the function addContentView() which is a variation on setContentView(View, android.view.ViewGroup.LayoutParams) to add an additional content view to the screen. Here I will create an xml with a textView and… Read More »
Hello all… Today I will show you how to use preferences in android? First we will create preferences using Create a folder named “xml” inside the “res” folder and inside that create an xml named “preferences.xml”. Now create a java file named “PreferenceDemo.java” in your src folder and copy this code into it. Now in… Read More »
Here is a simple example showing alert in android cocos2D. For this I am using an example from my previous android cocos2D tutorial.. So please read that tutorial before reading this because the I am using the classes and files from it. I am only changing the Gamelayer.java file to show an Alert Dialog when… Read More »
Hello all.. Today I will show you how to align the message text to center in an AlertDialog. By default it is left aligned, so we have to get a reference to it to align it to center. This is how we do it. Check this code. Please leave your valuable comments on this post.
Hello all….. In the previous post I have shown you how to parse a Simple JSON String in ANDROID. In today’s tutorial I will show you how to parse a complex JSON String. Take a look at the example Here the JSON String used is Now let’s dothe operation……….. Please check the Logcat for the… Read More »
JSON are alternative to XML and easy to understand than XML. As other languages Java also supports JSON parsing. Here is a simple example of JSON parsing in ANDROID. This is the JSON String that I am going to parse. And this JSON is same as this xml. Here is the code for this parsing.… Read More »
Hi all……. All of you may be familiar with TextViews in ANDROID. But how many of you know that we have have html as text in a textView. This post is a simple example to show this. Create a fresh project and copy this code to the main java file. The main.xml The AndroidManifest.xml file
Hi all….. Splitting a string in android is really easy.checkout the following snippet. Check the Logcat for output. Note: Make sure to put the escape character before the delimiter for splitting,otherwise the output may be each character.
This is a simple example showing email validation in ANDROID. This example uses regex for email validation. Create a button and an edittext in your main.xml file and try this code. Check this link to find how you can send email from android programatically. Please leave your valuable comments……
Hi all……. In today’s tutorial I will show you how to get the incoming phone number inside your application. In many situation we may need this. For this we need to have BoradCastReceivers. Inside this class we create an object of the TelephonyManager class ang register with the sytem service.Now we have to make another… Read More »
When you are working on an Android application that stores data in a SQLite database.There arise many questions like where does this database file get stored on the filesystem ? How can we access the database? I will give solution to all these problems. I created the SQLite database from my previous post about Using… Read More »
Hello ANDROID Lovers…….. In today’s tutorial I will show you how to deal with SQLite Databases in ANDROID. You know that SQLite are Lightweight databases which is maintained only on the client side. They don’t need a server. The SQLite databases are simply a file wrapped around with some stuff which helps us deal with… Read More »
Hello everyone…….. In this simple example I will show you how to use Text To Speech in ANDROID. This is one of the unique features in ANDROID. Unlike iPhone , ANDROID has a built in TTS Library which supports many languages. But iPhone doesn’t have this feature. They have to depend on third-party software for… Read More »
Hi all,In this tutorial I will show you how to open browser from an ANDROID application. This is done through intents. You know that intents are used to invoke other activities. So we here invoke the browser activity. The following code will open the default browser in your ANDROID phone. This is the manifest file… Read More »
Below is a straight forward example of how to deal with SQLite database in ANDROID. Go ahead and copy and paste the following code to your java file. The example has one database and performs functions like insert delete and listing of values in a textView. In the XML file set up a TableLayout with… Read More »