Thursday, August 15, 2013

How to avoid having my app shown in the list of recently used apps in Android

How to avoid having my app shown in the list of recently used apps in Android

You have to add android:excludeFromRecents="true" to the activity in your AndroidManifest.xml

Sample code:

<activity
        android:label="@string/your_app_name_goes_here"
        android:excludeFromRecents="true"
        android:name=".SomeActivityNameGoesHere" >
        <intent-filter >
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

How to compare dates in Java

Date comparison in java:

                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date date1 = sdf.parse("2009-12-31");
        Date date2 = sdf.parse("2009-12-31");

        System.out.println(sdf.format(date1));
        System.out.println(sdf.format(date2));

        if(date1.after(date2)){
        System.out.println("Date1 is after Date2");
        }

        if(date1.before(date2)){
        System.out.println("Date1 is before Date2");
        }

        if(date1.equals(date2)){
        System.out.println("Date1 is equal Date2");
        }

Tuesday, May 21, 2013

Add AM PM to time using SimpleDateFormat

/*
  Add AM/PM to time using SimpleDateFormat
  This example shows how to format time to have a AM/PM text using Java
  SimpleDateFormat class. 
*/

import java.text.SimpleDateFormat;
import java.util.Date;

public class AddAMPMToFormattedDate {

  public static void main(String[] args) {

    //create Date object
    Date date = new Date();
  
     //formatting time to have AM/PM text using 'a' format
     String strDateFormat = "hh:mm:ss a";
     SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat);
    
     System.out.println("Time with AM/PM field : " + sdf.format(date));

  }
}



/*
Typical output would be
Time with AM/PM field : 01:39:42 AM
*/

How to access amazon server remotely from windows?

Download putty and pagent for windows.
 

Open pagent and add key as ".ppk" format
 

Open putty and put the host name as "bitnami@ece.compute-  1.amazonaws.com" and port number "22".

By default phpMyAdmin and phpPgAdmin are not accessible from outside for security reasons.
 

In order to access them, you can create an SSH tunnel to Apache, sending your requests to your webserver from 127.0.0.1 (localhost).

    You should follow these steps to create the tunnel:
    

1. Create the tunnel.
    - If you are in Linux or Mac you can run the following in a console in your local machine (using your Public DNS instead of xyz.bitnamiapp.com):
    $ ssh -N -L 8888:127.0.0.1:80 bitnami@ece.compute-1.amazonaws.com
    - If you are using Windows, you can use Putty:
    Follow the steps described here
    Before opening the connection. Go to Connection -> SSH -> Tunnels, enter the values below and click "Add" button:
    Source port: "8888"
    Destination: "localhost:80"
 

    Click Open

    2. While the tunnel is active you can connect to the web application at http://127.0.0.1:8888/phpmyadmin or http://127.0.0.1:8888/phppgadmin in your browser. The default login is:
    username: root for MySQL or postgres for PostgreSQL database.
    password: bitnami (for BitNami).


Wednesday, May 15, 2013

How to get IMEI number of android device?


IMEI number is another way of uniquely identifying cellular devices.
 

Each cellular device has a unique IMEI number which can never clash with another device’s IMEI number.
 

Android devices [phones only] also have International Mobile Station Equipment Identity or IMEI number.

And you should add the following permission into your Manifest.xml file:
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

TelephonyManager tm = (TelephonyManager).getSystemService(Context.TELEPHONY_SERVICE);
String imei = tm.getDeviceId();

List of Top Proxy Sites

List Of Top Proxy Sites
 
http://aniscartujo.com/webproxy
http://www.badboysproxy.com
http://www.surfscreened.com
http://www.hagiomusic.info
http://www.greenpips.info
http://urlbrowse.com
http://www.hideipaddress.net
http://www.sneakfilter.com
http://www.browsestealth.com
http://www.sneak1.info
http://proxiesrus.com
http://www.surfindark.com
http://www.navydog.com
http://falsario.com
http://www.proxypit.com
http://www.proxypan.com
http://myspacewebproxy.org/
http://www.allfreehere.info
http://www.takefreely.info
http://autobypass.com
http://www.proxcity.info
http://www.proxyzip.org
http://www.cheekyproxy.com
http://www.eggproxy.com
http://www.theschoolcloak.com
http://www.hidemefast.com
http://browseanywhere.info
http://www.404surf.com
http://www.cloakip.net
http://www.browsedark.com
http://www.dartprox.com
http://www.proxish.com
http://www.surfsneak.com
http://www.surfsneaky.com
http://www.browsehidden.com
http://www.filterhide.com
http://www.browsesneak.com
http://myspaceproxyy.com
http://www.browsesneaky.com
http://www.proxyz.us
http://www.sneakschool.com
http://www.iphide.com
http://www.proogle.info
http://greatproxy.info
http://www.playnsurf.info
http://www.realproxy.info
http://aplusproxy.com
http://www.ecoproxy.com
http://freedom.webtuo.com
http://www.slyuser.com/
http://tenpass.com
http://pawxy.com
http://pawxy.org
http://logu.in
 

Use Proxy and cheers...!!!

Web Browsers As Text Editor

Web Browsers As Text Editor:

 1. Copy below code in browser Url Section
        data:text/html, <html contenteditable>

 Now Press Enter.


   3. Now you can type anything as what ever do on any other text editor like Notepad.
   4. To save your text file Press Ctrl + S and save it as anything.txt (.txt Is Must).







Cheers...!!!