Monday, May 7, 2012

Android Set Text Color at Runtime (Code)

So it is pretty simple..
just

Step1 . Create color.xml  under  res/values in you android project
             with color name and color code

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
          <color name="Red">#E41B17</color>
          <color name="Blue">#A5D4FE</color>
          <color name="Purple">#9172EC</color>
    </resources>

Step 2 . Now in your activity

        txRed.setTextColor(getResources().getColor(R.color.Red));
        txBlue.setTextColor(getResources().getColor(R.color.Blue));
        txPurple.setTextColor(getResources().getColor(R.color.Purple));

Wednesday, May 2, 2012

Generating Key for Android Map view

This is for windows users

Step 1. Open CMD

Step 2  run  cd   C:\Program Files\Java\jdk1.5.0_10\bin   (please check your java version)

Step 3 now run the following command
         
keytool -list -keystore "C:/Documents and Settings/<"your user name here">/.android/debug.keystore"

Step 4 It will ask for password press enter leave it blank

Step 5 the certificate's MD5 fingerprint will be generated copy it
 
Step 6 Go to the following link
       Google Maps Signup Page
                    
                
Step 7 paste you MD5 fingerprint here and click on generate API Key