Monday, March 23, 2015

TEMPLE RUN 2 PATCH (UNLIMITED COINS)

ENJOYED TEMPLE RUN 2,
BUT, DON'T HAVE ENOUGH COINS,
DON'T UPSET,
HERE IS A TEMPLE RUN 2 PATCH (UNLIMITED COINS) 



"LET ENHANCE OUR GAME PLAYING EXPERIENCE"

                  SPECIAL THANKS TO TECHEEZ INC.
FOR THE PATCH DOWNLOAD LINK,-
VISIT THE FOLLOWING LINK
                       www.youtube.com/watch?v=dEnsfbvDEm4
SEE THE ADDITIONAL INFORMATION GIVEN BY TECHEEZ INC.

Moto G(1st gen) Lollipop update process

GOT MOTO G(1ST GEN) AND WANT
KITKAT TO LOLLIPOP......
BUT, WHAT IS THE ONGOING PROCESS
THEN,
SEE THIS VIDEO WHICH CAN HELP YOU

"IT IS VERY SIMPLE TO DO SO"

SPECIAL THANKS TO TECHEEZ INC.
 
 

Saturday, October 4, 2014

NEW ADMOB FOR ANDROID

NEW ADMOB INTEGRATIONS

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.


publisherIDAdmob



create an ad unit for your application.
Download the new Google Play Services Library using the Android SDK Manager in your Eclipse IDE
SDKManager
Import Google Play Services Library into your Eclipse IDE. I’ve found mine in D:\Eclipse\sdk\extras\google\google_play_services\libproject .
GooglePlayServices
BANNER EXAMPLE
Create a new project in Eclipse
NewAdmobTutorial
Package Name : com.androidbegin.newadmobtutorial
Open your MainActivity.java and paste the following code.


package com.androidbegin.newadmobtutorial;
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.InterstitialAd;
import android.os.Bundle;
import android.app.Activity;
public class MainActivity extends Activity {
    private InterstitialAd interstitial;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Get the view from activity_main.xml
        setContentView(R.layout.activity_main);
        // Prepare the Interstitial Ad
        interstitial = new InterstitialAd(MainActivity.this);
        // Insert the Ad Unit ID
        interstitial.setAdUnitId("ca-app-pub-123456789/123456789");
        //Locate the Banner Ad in activity_main.xml
        AdView adView = (AdView) this.findViewById(R.id.adView);
        // Request for Ads
        AdRequest adRequest = new AdRequest.Builder()
        // Add a test device to show Test Ads
         .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
         .addTestDevice("CC5F2C72DF2B356BBF0DA198")
                .build();
        // Load ads into Banner Ads
        adView.loadAd(adRequest);
        // Load ads into Interstitial Ads
        interstitial.loadAd(adRequest);
        // Prepare an Interstitial Ad Listener
        interstitial.setAdListener(new AdListener() {
            public void onAdLoaded() {
                // Call displayInterstitial() function
                displayInterstitial();
            }
        });
    }
    public void displayInterstitial() {
        // If Ads are loaded, show Interstitial else show nothing.
        if (interstitial.isLoaded()) {
            interstitial.show();
        }
    }
}
In this MainActivity.java, a test device is being used to run test ads. Its highly recommended to test your ads using test ads to prevent invalid clicks that will cause suspension of your AdMob publisher account. To generate a Test Device ID, simply type in some random text into addTestDevice as shown below.


        // Request for Ads
        AdRequest adRequest = new AdRequest.Builder()
        // Add a test device to show Test Ads
         .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
         .addTestDevice("abc") //Random Text
                .build();
        // Load ads into Banner Ads
        adView.loadAd(adRequest)



Run your app, and filter your logcat with the word “ads” as shown below. You should be able to generate some unique strings
Now paste the Test Device ID into addTestDevice. You have to generate your own Test Device ID, because each Android Device has an unique ID.

Showing INTERSTITIALS Ads

To show real ads, just remove the two lines by commenting it as shown below.
Next, create an XML graphical layout for your MainActivity. Go to res > layout > Right Click on layout > New > Android XML File
Name your new XML file activity_main.xml and paste the following code.
activity_main.xml
In your AndroidManifest.xml, we need to declare an activity for Google Play Services and permissions to allow the application to access to the Internet and check network status. Open your AndroidManifest.xml and paste the following code.
AndroidManifest.xml
Output:



AdmobAdsSPECIAL THANKS TO PRAKASH UJJWAL AND ANDROID BEGIN


 
 


  

Sunday, September 28, 2014

how to play video in android programmatically

MAIN.XML should be like this-
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/hello"
    />
<VideoView
android:layout_height="wrap_content"
android:id="@+id/videoView1"
android:layout_width="match_parent">
</VideoView>
</LinearLayout>

VIDEOPLAYERACTIVITY.JAVA-
package com.example;

import android.app.Activity;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

public class VidePlayerActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        VideoView videoView=(VideoView)findViewById(R.id.videoView1);
        videoView.setVideoPath("sdcard/Padaiyappa - minsara poove.mp4");
        MediaController mediaController=new MediaController(this);
        videoView.setMediaController(mediaController);
    }
}
 
 THIS IS A SIMPLE EXAMPLE.IT IS JUST TO GUIDE YOU

Saturday, June 21, 2014

WHEATHER INFO EXAMPLE / XML PARSER EXAMPLE

DOWNLOAD THE WEATHER INFO APP HERE



EXAMPLE-
MainActivity.java-
package com.example.xmlparser;

import java.io.IOException;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.ParseException;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;

public class MainActivity extends Activity {

   private String url1 = "http://api.openweathermap.org/data/2.5/weather?q=";
   private String url2 = "&mode=xml";
   private EditText location,country,temperature,humidity,pressure;
   private HandleXML obj;
   @Override
   protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      location = (EditText)findViewById(R.id.editText1);
      country = (EditText)findViewById(R.id.editText2);
      temperature = (EditText)findViewById(R.id.editText3);
      humidity = (EditText)findViewById(R.id.editText4);
      pressure = (EditText)findViewById(R.id.editText5);
   }

   @Override
   public boolean onCreateOptionsMenu(Menu menu) {
   // Inflate the menu; this adds items to the action bar if it is present.
   getMenuInflater().inflate(R.menu.main, menu);
   return true;
   }

   public void open(View view){
      String url = location.getText().toString();
      String finalUrl = url1 + url + url2;
      country.setText(finalUrl);
      obj = new HandleXML(finalUrl);
      obj.fetchXML();
      while(obj.parsingComplete);
      country.setText(obj.getCountry());
      temperature.setText(obj.getTemperature());
      humidity.setText(obj.getHumidity());
      pressure.setText(obj.getPressure());

   }

}
 HandleXML.java-
package com.example.xmlparser;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;

import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;


public class HandleXML {

   private String country = "county";
   private String temperature = "temperature";
   private String humidity = "humidity";
   private String pressure = "pressure";
   private String urlString = null;
   private XmlPullParserFactory xmlFactoryObject;
   public volatile boolean parsingComplete = true;
   public HandleXML(String url){
      this.urlString = url;
   }
   public String getCountry(){
      return country;
   }
   public String getTemperature(){
      return temperature;
   }
   public String getHumidity(){
      return humidity;
   }
   public String getPressure(){
      return pressure;
   }

   public void parseXMLAndStoreIt(XmlPullParser myParser) {
      int event;
      String text=null;
      try {
         event = myParser.getEventType();
         while (event != XmlPullParser.END_DOCUMENT) {
            String name=myParser.getName();
            switch (event){
               case XmlPullParser.START_TAG:
               break;
               case XmlPullParser.TEXT:
               text = myParser.getText();
               break;

               case XmlPullParser.END_TAG:
                  if(name.equals("country")){
                     country = text;
                  }
                  else if(name.equals("humidity")){  
                     humidity = myParser.getAttributeValue(null,"value");
                  }
                  else if(name.equals("pressure")){
                     pressure = myParser.getAttributeValue(null,"value");
                  }
                  else if(name.equals("temperature")){
                     temperature = myParser.getAttributeValue(null,"value");
                  }
                  else{
                  }
                  break;
                  }   
                  event = myParser.next(); 

              }
                 parsingComplete = false;
      } catch (Exception e) {
         e.printStackTrace();
      }

   }
   public void fetchXML(){
      Thread thread = new Thread(new Runnable(){
         @Override
         public void run() {
            try {
               URL url = new URL(urlString);
               HttpURLConnection conn = (HttpURLConnection) 
               url.openConnection();
                  conn.setReadTimeout(10000 /* milliseconds */);
                  conn.setConnectTimeout(15000 /* milliseconds */);
                  conn.setRequestMethod("GET");
                  conn.setDoInput(true);
                  conn.connect();
            InputStream stream = conn.getInputStream();

            xmlFactoryObject = XmlPullParserFactory.newInstance();
            XmlPullParser myparser = xmlFactoryObject.newPullParser();

            myparser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES
            , false);
            myparser.setInput(stream, null);
            parseXMLAndStoreIt(myparser);
            stream.close();
            } catch (Exception e) {
               e.printStackTrace();
            }
        }
    });

    thread.start(); 


   }

}

activity_main.xml-
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools"
   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_alignParentLeft="true"
      android:layout_alignParentTop="true"
      android:layout_marginTop="15dp"
      android:text="@string/location"
      android:textAppearance="?android:attr/textAppearanceMedium" />

   <EditText
      android:id="@+id/editText1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignBottom="@+id/textView1"
      android:layout_alignParentRight="true"
      android:ems="10" />

   <TextView
      android:id="@+id/textView2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignLeft="@+id/textView1"
      android:layout_below="@+id/textView1"
      android:layout_marginTop="68dp"
      android:text="@string/country"
      android:textAppearance="?android:attr/textAppearanceSmall" />

   <TextView
      android:id="@+id/textView3"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@+id/textView2"
      android:layout_marginTop="19dp"
      android:text="@string/temperature"
      android:textAppearance="?android:attr/textAppearanceSmall" />

   <TextView
      android:id="@+id/textView4"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignLeft="@+id/textView3"
      android:layout_below="@+id/textView3"
      android:layout_marginTop="32dp"
      android:text="@string/humidity"
      android:textAppearance="?android:attr/textAppearanceSmall" />

   <TextView
      android:id="@+id/textView5"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignLeft="@+id/textView4"
      android:layout_below="@+id/textView4"
      android:layout_marginTop="21dp"
      android:text="@string/pressure"
      android:textAppearance="?android:attr/textAppearanceSmall" />

   <EditText
      android:id="@+id/editText2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_above="@+id/textView3"
      android:layout_toRightOf="@+id/textView3"
      android:ems="10" >

      <requestFocus />
   </EditText>

   <EditText
      android:id="@+id/editText3"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignBaseline="@+id/textView3"
      android:layout_alignBottom="@+id/textView3"
      android:layout_alignLeft="@+id/editText2"
      android:ems="10" />

   <EditText
      android:id="@+id/editText4"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_above="@+id/textView5"
      android:layout_alignLeft="@+id/editText1"
      android:ems="10" />

   <EditText
      android:id="@+id/editText5"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignBaseline="@+id/textView5"
      android:layout_alignBottom="@+id/textView5"
      android:layout_alignRight="@+id/editText4"
      android:ems="10" />

   <Button
      android:id="@+id/button1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignLeft="@+id/editText2"
      android:layout_below="@+id/editText1"
      android:onClick="open"
      android:text="@string/weather" />

</RelativeLayout>
 
 STRINGS-
<?xml version="1.0" encoding="utf-8"?>
<resources>

   <string name="app_name">XMLParser</string>
   <string name="action_settings">Settings</string>
   <string name="hello_world">Hello world!</string>
   <string name="location">Location</string>
   <string name="country">Country:</string>
   <string name="temperature">Temperature:</string>
   <string name="humidity">Humidity:</string>
   <string name="pressure">Pressure:</string>
   <string name="weather">Weather</string>
</resources>