Android code for rate us and more apps


First we look at Rate Us : Code Snippet: final String appPackageName = getPackageName(); // getPackageName() from Context or Activity object try { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(“market://details?id=” + appPackageName))); } catch (android.content.ActivityNotFoundException anfe) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(“http://play.google.com/store/apps/details?id=” + appPackageName))); } Here the app actually search for the certain package name in the market. So, if your…

Parsing json with Retrofit


Retrofit Android Retrofit is type-safe REST client for Android and Java which aims to make it easier to consume RESTful web services. We’ll not go into the details of Retrofit 1.x versions and jump onto Retrofit 2 directly which has a lot of new features and a changed internal API compared to the previous versions….

Simple JSON Parsing Using Volley


first install valley to your project : Volley is now officially available on JCenter: Add this line to your gradle dependencies for your Android project’s app module: compile ‘com.android.volley:volley:1.0.0’   create android project Click on Start a New Android Studio Project. Write your Application Name “JsonVolley”. Leave other fields blank as it is. Click NEXT. Write the activity name…

Android JSON Parser Tutorial


JSON (Javascript Object Notation) is a programming language . It is minimal, textual, and a subset of JavaScript. It is an alternative to XML. Android provides support to parse the JSON object and array. Advantage of JSON over XML 1) JSON is faster and easier than xml for AJAX applications. 2) Unlike XML, it is…

Android Upload file to Server


creat a New Project Named UploadFileToServer. Now first declare the permissions required in our Android Manifest file. 1 2 3     <uses–permission android:name=“android.permission.INTERNET”/>     <uses–permission android:name=“android.permission.ACCESS_NETWORK_STATE”/>     <uses–permission android:name=“android.permission.READ_EXTERNAL_STORAGE”/> The above permissions are required to access Internet and to Read Android External Storage files. write the following code in activity_main.xml: 1 2 3 4 5 6 7 8…

Fragments in android (multi-pane)


1. Fragments 1.1. What are single-pane or multi-pane layouts? A panel or pane represents a part of the user interface. The term pane is a general term used to describe the concept that multiple views are combined into one compound view depending on the actual available space. If not enough space is available only one…

Some of the hidden android devices codes


  Best Android Secret Codes List     Codes      Functioning *#*#778O#*#*  Factory Data Reset *#*#2664#*#* Test the touchscreen *#*#I472365#*#* Quick GPS Test *#*#0673#*#* Audio Test *#*#0289#*#* Audio Test *#*#0283#*#* Packet Loopback Test *#*#232339#*#* wireless Lan Test *#*#526#*#* wireless Lan Test *2767*3855# Format Your Phone & Reinstalls The Phones Firmware #’#273283*255*663282*#*#* Backup Media Files…

Integration of Admob banner and InterstitialAd to your app


GETTING STARTED Sign up as an Admob Publisher here. Log in to your dashboard once you have your account approved. Identify your publisher ID on the top right of your dashboard. Open the Monetize tab and create an ad unit for your application. You should be able to see your ad unit after selecting an app on…

Intro slider (onetime Intro)


Introduction one time slider for android apps: 1.create a android project intro slide 2.create activity – MainActivity 3.Add some images in Drawable folder : 4.Open colors.xml located under res ⇒ values and add the below color values. <?xml version=”1.0″ encoding=”utf-8″?> <resources> <!– Screens background color–> <color name=”bg_screen1″>#f64c73</color> <color name=”bg_screen2″>#20d2bb</color> <color name=”bg_screen3″>#3395ff</color> <color name=”bg_screen4″>#c873f4</color> <!– dots…

Android StartActivityForResult Example


Let’s see the simple example of android startActivityForResult method. activity_main.xml Drag one textview and one button from the pallete, now the xml file will look like this. File: activity_main.xml <RelativeLayout xmlns:androclass=“http://schemas.android.com/apk/res/android&#8221;     xmlns:tools=“http://schemas.android.com/tools&#8221;     android:layout_width=“match_parent”     android:layout_height=“match_parent”     android:paddingBottom=“@dimen/activity_vertical_margin”     android:paddingLeft=“@dimen/activity_horizontal_margin”     android:paddingRight=“@dimen/activity_horizontal_margin”     android:paddingTop=“@dimen/activity_vertical_margin”     tools:context=“.MainActivity” >     <TextView         android:id=“@+id/textView1”         android:layout_width=“wrap_content”         android:layout_height=“wrap_content”         android:layout_alignLeft=“@+id/button1”         android:layout_alignParentTop=“true”         android:layout_marginTop=“48dp”         android:text=“Default Message” />     <Button         android:id=“@+id/button1”         android:layout_width=“wrap_content”         android:layout_height=“wrap_content”         android:layout_below=“@+id/textView1”         android:layout_centerHorizontal=“true”         android:layout_marginTop=“42dp”         android:text=“GetMessage” /> </RelativeLayout>…

Add google map in your app


This post provides step-by-step guideline for adding Google Map in your application. Whether you want to show some location or provide directions to some place or any other usage of a map in your application, you need to follow these steps first to just add a simple map in your application. (This post provides information…