Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

How to create a transparent Activity in Android

You have to add a theme attribute in the Android manifest file under activity section. So that only that particular activity will become transparent. After the above step, add background attribute to your layout file as shown below: &l...

Playing sounds in Android

Playing sounds in Android Copy your sounds in raw/ folder in res/ . If you do not have raw/ folder then make one by right clicking on res/ folder, click on Android resource directory and then giving directory name as raw and selecting resou...

Play Device's default Notification sound

You can play android device's default notification sound using RingtoneManager: Get the path url of the notification sound from the getDefaultUri() method. Pass this url to getRingtone() method which will return the Ringtone Object Play tha...

Email validation using regex

Email validation using regex The Email Id such as adam.sandler@findnerd.com is made up of local-part, an @ symbol and then a domain part. Hence, Email Id is of the form : local_part@domain *TLD = Top Level Domain Some Valid Emails ...

Binding JavaScript code to Android code

Binding JavaScript code to Android code When Building a WebView based Web App in Android, you can communicate with your android client side code through your Javascript code.You can call any method of Android client side code on any triggered ev...

Android - basic gesture detection using MotionEventCompat class

Android - basic gesture detection using MotionEventCompat class A touch gesture occurs when a user places one or more fingers on the touch screen. In order to get a touch gesture of a touch event we can use GestureDetectorCompat or MotionEven...

Programatically close/hide Android Soft Keyboard on Events

When there are one or more EditText in the activity, a soft keyboard automatically appears when the activity is launched, which hides some visible portion of the screen and we don't always have a requirement to automatically pop-up the soft inp...

Custom Progress Bar with Timer

Custom Progress bar with timer Generally we use this splash screen to make our app dynamic and stylish.We can also use to show some process is doing internally. For this we just customize ProgressBar by defining custom style . <progress...

Put scrollable view inside a scrollable view

We should not put scrollable view inside scrollable view (and most developers say we should never put ListView inside ScrollView). But there are cases where we have to put the scrollable view inside Scrollable view inspite of these design guideli...

Save a file on Internal storage in Android

There are two types of storage in Android device, one is external storage and another is internal storage. You should be aware that the file you try to store in internal storage of Android device will gets completely removed if you uninstall the ...

Handle Sliding Tab layout properly

Hello guys, as we all have worked on Tabs widget and Tabs host but now Tab widget and host have been deprecated. Android lollipop provides a new interface to implement Tabs that are SlidingTabLayout.java & SlidingTabStrip.java classes. These...

How to use SharedPreferences in Android to store, fetch and edit values

SharedPreferences are used to store primitive data types in Android such as int, long, float, string. SharedPreferences have an added advantage over storing data in singleton class as Singleton class can store data and available throughout the ap...

Layout for tablets in Android

To target your some designs to other devices like tablets, there are solution for typical screen width: For every case, your UI might not look perfect specially for the case of tablet, so you need to adjust your layouts/designs. Then you have ...

How to touch UI from background or seperate thread ?

We know that Android UI or views can be touch from Main thread only , but if we want to update some UI from background or separate thread then we have to use one of the following way :- AsyncTask has 4 override methods that are onPreExecute(...

What is AQuery or Android Query ?

Do you want to make your code easy ? Are you looking for library that have powerful HTTP requests ? Do you want to do lots of things in a single line ? etc etc..... There is only a single solution for all these problems i.e AQuery or A...

Testing Web Service response using Junit in Android

Unit Testing plays an important role in software development process, basically this testing is done by Developers as they test smallest piece of codes and test whether it gives accurate output or not.Each unit can be tested separately and can be...

Use ORMLite to Optimize your sqlite database

Hey, are you working with large database having many columns and many queries . Is this working slow with sqlite? Thanks to ORMLite that manages your database very efficiently as well as no need to manage lots of queries.... ORMLite supports ...

Parcelable vs Serializable

If we want to send some data over the network or from one place to another place then we have to serialize it first using Serialization in java. Serialization is a process of Marshalling and Unmarshalling of data. Basically the conversion of Obje...

Optimize memory with MAT

We know that Garbage Collectoris a program that automatically removes unwanted data held temporarily in memory during processing. Android also have its own garbage collector but this is not always guarantee all the times so we can't ignore heap ...

Connection string for connecting Android(java) app to MariaDB

Here is the simple connection string to connect the android with Maria DB on linux. you need to have MariaDB configured to the default port:3306 try { Class.forName("org.mariadb.jdbc.Driver"); Connection cntn = DriverManager.getConne...

Find your lost android device using android device manager

if your android device is lost, and you use another android device, you can locate it using Android device manager app, what all you need to do is to follow the simple steps. Step 1:On your device that you have, open the Android Device Manager ...

Autostart service after device reboot in android

Sometime you need to register your own android application or service to start automatically when the device has been Rebooted to perform particular task. Here we will learn the simplest way to start an Android service or an application at dev...

Solution of EditText font in password mode

When an EditText is in password mode, It looks that its font is different. When we change typeface in xml , It dosent work. There is a solution : We should change it from java like this <EditText android:id...

Custom Dialogs in android using DialogFragment

Custom Dialogs in android using DialogFragment: DialogFragment is the fragment that shows dialog window on top of your activity. We have to override DialogFragment class and implement onCreateView(LayoutInflater, ViewGroup, Bundle) to use ...

How to identify the network usage of your particular application in android?

If you wanted to monitor the data usage of your particular application than you need to know the pakage name of that application which you want to monitor. So just add the method getDataUsage given below in your utility class and pass the conte...

SmsManager to Send SMS

SmsManager use for SMS operations like sending information to the any given mobile device. We create this object by the below method. SmsManager.getDefault() SmsManager sManager = SmsManager.getDefault(); Then we can send any data by u...

How to identify the current opened application name in android devices?

If you need to monitor your android device activities and you want to identify the current opened application name in that case you can simply create the method given below in your utility class. And call it whenever you want to get the current ...

how to identify the network type in android?

There are various network type available in android, for example- 2G,3G GPRS etc. If you need to find-out the current network type of your android device, than you just need to implement the method given below in your utility class :- pu...

How to Get/Crop the visible portion of ImageView

In many application we set the scaleType of large image to "CENTER" or the scaleType is set to "MATRIX" and the bitmap is translated and scaled. Therefore parts of the image are not visible. Now in order to get the visible part you just need to e...

PayPal Integration in Android

PayPal Integration : I am introducing step by step points for integrating paypal into your application with understanding of different terms used in programing. Creating developer account in paypal : a. For development purpo...

Hide/Show a View with slide up/down animation in Android

In android, we simply hide a view by setting its visibility. We can do this either in programming or in xml. In programming (we can say in Activity, Fragment etc) there is setVisibility(int) method to set or control the visibility of the view. ...

How to make Bluetooth Connection in Android?

Bluetooth connectivity in Android is achieved through the APIs provided by Android itself. You need a broadcast receiver to keep checking for the Bluetooth devices. With the help of broadcast you will get to know whether your device get connect...

App Submissions On Google Play Now Reviewed By Staff

App Submissions On Google Play Now Reviewed By Staff, Will Include Age-Based Ratings  Google Play, Googles marketplace for Android applications which now reaches a billion people in over 190 countries, has historically differentiated...

Sell digital content in Android through Google Play In-app Billing Service Version 3

Products which you can sell in your application falls into these categories : 1.Standard in-app products(one time billing) eg: Premium Upgrade, Ads free version of the app. 2.Subscription(recurring,automated billing) eg: Game currency, music ...

Google Now card full api for Developers

Hi Developer, Google is coming with the new set of api with Google Now card,Api was released some time before in January this year. Check below url for more information on this. Google Plans To Release Open API For Google Now Cards At So...

Material design in lollipop

Designing the perfect Lollipop. I found this blog interesting, Please have more information on this link given below. http://officialandroid.blogspot.com/feeds/4671909951652311934/comments/default

How to write a test case using Robotium in android

Today we are going to learn something about J-Unit testing in android. We will be implementing an automation library known as Robotium, for genreating the test cases for testing the various functionalities in our app. First of all you need to add...

Monetize your Application by adding Ad banners in your android application

Adding ad banners into you app To monetize your app you can add advertisements and earn revenues based on viewers visiting the ads. You'll see below how easily you can add advertisement banners through Admob. Admobs is a Google acquired company...

How to deal with Out of Memory Exception in Android ?

How to deal with Out of Memory exception in android: In android we encounter with out of memory exception many times. The reasons are we don't have expanding memory and completely dependent on device the memory available on phone. So we don't...

Push Notification using GCM in Android

For Push Notification using GCM in Android, use the following steps: Create the Google Api Project on Google Console. Note down the project number which will be used as GCM Sender Id. Enable the GCM service by turn on the toggle for Google...

Getting the connected Wi-Fi name in Android.

If you need to display the connected Wi-Fi name in your application than you just have put this method getConnectedWiFiName in your utility class and call it whenever you need the Wi-Fi network name. public static String getConnectedWiFiName...

Android create custom edittext with clear button.

In android there is no default text clear button functionality in EditText so here is a simple example of implementing text clear button in edit-text, You just have to follow instruction given below to make it in your edit-text. 1)- First you...

Storing and retrieving String[ ] Array using SharedPreferences in Android.

I came across to the many questions asking about to store some kind data in Shared-preferences such as String[] array. Many of these questions are answered with "Use a database". But here i will show you a perfect piece of code by which you ...

How to hide title bar and status bar in android

In many application we need to hide the title bar of Activity/Fragment Activity. For this we need to add following line in onCreate() method before calling setContentView() requestWindowFeature(Window.FEATURE_NO_TITLE); Example:- publi...

Convert a Drawable into Bitmap

Following method tells how to convert a drawable into bitmap // method to convert a drawable into Bitmap public static Bitmap drawableToBitmap (Drawable drawable) { // check if drawable is the instance of BitmapDrawable if (draw...

Set or Get phone wallpaper from your Application

To set or get the wallpaper of android phone from your application, we used WallpaperManager. This class provides access to the system wallpaper. By the help of this class you can get the current wallpaper of your phone inside your app and even c...

Implement Gesture listener on listview item

This blog gives a simple example to implement Gesture listener ( or horizontal swipe) on ListView item. public class MainActivity extends Activity implements OnGestureListener{ private ListView listView; private ArrayList LIST; ...

How to check if your device is connected to Internet

We need to check if device is connected to Internet on making every API call (or call to Remote server). The function below returns true if device is connected to Internet. //**This function tells whether the device having an Internet connec...

How to get Rounded Corner bitmap ?

In many android applications, we need to set rounded corner image in ImageView. The bad part is that ImageView does not provide any property for this. So for this the following method will help you get rounded corner Bitmap:- public static Bit...

Saving an image into SDcard in Android

Sometime we need to save images on SDcard that we click or get from server in many applications, and you can do it very easily by using the below code. To save Images on SDcard on Android Device, write the following code: ByteArrayOutputStr...
1 13
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: