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

There is an Application to Receive the Intent or not in Android

Hi friends, For Implicit intent, we dont need to declare the name of the class but we declare the action that we are doing to perform. Like here we make a call Uri callUri = Uri.parse("tel:100"); Intent intent = new Intent(Intent.AC...

Get Country name without using location

Hi... Usually we get country name by using our location via GPS settings. But somehow on situations we need to get country name without using GPS. For these situation, Android provides Locale to get our device's country name. We are us...

How to get IMEI number,serial number and software version of your phone

Hello... Sometimes we need to know the country code, IMEI number, subscriber of a phone. Their is very simple solution, For this android gives facility to know it by providing TelephonyManager class. TelephonyManager have many methods t...

Logging in android

A very nice system is use for logging in android, usually called a centralized system. Developer can filter log statements by using android tools. We can create log statements by using android.util.Log class. Log class have so many methods l...

Generate SHA1 Key in android

In android we need to generate SHA1 key fingerprint to get Google Api key for Google Map. It just a one line command to generate SHA1 key. First of all create your .keystore file and sign to your app and take down this keystore lo...

Check Network Availability on android

We know that Its not possible that our android device should be always connected with a network. It might be a situation when we would not connected with any network, So to check it whether we are connected with any network or not. We check...

How to make listview scrollable inside ScrollView

If you apply ListView inside ScrollView, then the items of ListView will not scroll. By default the scrolling of ListView will not work if defined inside ScrollView. To make the scrolling work, use the onTouchListener. Below is the code to make l...

How to correctly use the AlarmManager class to execute a task at fixed intervals?

This Post ll help you to manage your alarm : AlarmManager am=(AlarmManager)getSystemService(ALARM_SERVICE); Intent alarmintent1=new Intent(MainActivity.this, AlarmReceiver.class); PendingIntent sender1=PendingIntent.getBroadcast(SpeedMotor...

Dp to Px converter and vice-versa

As we all know that Android works with dp size. But what to do if we have px values and want to check corresponding dp value ?. Don't worry try this - public static int pxToDp(int px, Context ctx) { DisplayMetrics displayMetrics = ctx.getRes...

Custom Toast in Android

Android give facility to change the view of a Toast. Sometimes we need to show message on a better way to user . Here I am writing code to implement custom Toast. I make a separate layout for Toast . Here I am showing a ImageView and TextVie...

How to implement a ListView in your Android application ?

This video tutorial describes how to implement ListView A ListView is a view group that displays items in a scrollable list. By the help of adapter, list items are automatically inserted into the list. We just need to set the adapter using setAd...

Scan Wifi networks in your App

Android give facility to access the Wifi Network in your Application. You can access nearly every information of the connection. Android have WifiManager API to handle all Wifi Connectivity.You can use it like this: WifiManager wifiManagerO...

Run Multiple AsyncTask on a Single Time

In android, thread pool pattern is use in AsyncTask. Early the size of the pool was 1 i.e, there was no support for parallel bunching of AsyncTasks.But from HONEYCOMB version Android allows multiple Asynctask at a time. We just have to use...

How to install android apk file on Emulator in Linux

To install apk file on Emulator Follow the below mentioned steps: 1.Go to platform-tools in android-sdk and Copy the apk file in it. 2.From your Terminal navigate to platform-tools folder in android-sdk. 3.Then use this command ./adb ...

Inserting data in android SQLITE table

Hi again, Here we are going to learn how to insert data in the already created table in android SQLITE. You will find it useful if you are aware of the basic terminology of the android SQLITE, if not and you want to create a table so it will be...

Creating a table in android SQLITE

There are situation when we need to maintain(store) data at our application level, this is mainly done when we try to execute functionalists at offline mode. So for these kind scenarios android sdk has provide us class known as SQLiteOpenHelper w...

How to send email using Intent in android

This tutorial is about sending the Email from your android code using implicit intents. Following is the code to send an Email- Intent emailIntent = new Intent(Intent.ACTION_SENDTO , Uri.fromParts("mail...

How to Connect the Android Mobile Device to JMETER?

Pre Conditions: 1. Install the Jmeter in system 2. Mobile & installed Jmeter system should be in same network Follow the Steps to Connect the Android Mobile to Jmeter: Step 1: Open the JMETER in system Step 2: ...

Could not find resource-id field in UI Automator viewer

There are many options to locate the element but the easiest way to locate an element is by its id. In webpages we can easily locate the element by its id but on mobile its very tricky to locate the element by id. I am automating an Android app...

Android Powerful and optimized Image loader - Glide

Hi, Are you still working with Image Loader or Universal Loader library for lazy loading of images in listview. if yes then you should know that sometimes these libraries could give out of memory exception if you are fetching lots of images o...

Activity Context and Application Context in Android

Below are the differences between Application context and Activity context Application context and Activity context are the instances of Context but both of them are tied to different life cycles. Instance of Application context is tied to App...

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...
1 13 15
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: