Friday, February 24, 2012

Android Code Snippet - Check if tablet or smartphone

Here is how to check if the user is using a smartphone or a tablet...

  private boolean isTabletDevice() {
    if (android.os.Build.VERSION.SDK_INT >= 11) { // honeycomb
        // test screen size, use reflection because isLayoutSizeAtLeast is only available since 11
        Configuration con = getResources().getConfiguration();
        try {
            Method mIsLayoutSizeAtLeast = con.getClass().getMethod("isLayoutSizeAtLeast", int.class);
            Boolean r = (Boolean) mIsLayoutSizeAtLeast.invoke(con, 0x00000004); // Configuration.SCREENLAYOUT_SIZE_XLARGE
            return r;
        } catch (Exception x) {
            x.printStackTrace();
            return false;
        }
    }
    return false;
}

Thursday, February 16, 2012

Tutorial - Autostart an application at bootup


In your AndroidManifest.xml put this is with the following permission

<receiver android:enabled="true" android:name=".BootUpReceiver"
        android:permission="android.permission.RECEIVE_BOOT_COMPLETED">

        <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
</receiver>
[..]
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
[..]

Create a new activity named BootUpReceiver and put this code in..

public class BootUpReceiver extends BroadcastReceiver{

        @Override
        public void onReceive(Context context, Intent intent) {
                Intent i = new Intent(context, MyActivity.class);
                i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                context.startActivity(i);
        }

}

Tuesday, February 14, 2012

Market Fix Android App

This is our newest app on the Android Market.

*ROOT IS REQUIRED TO WORK!*

Market Fix will let you change your build.prop file fingerprint to allow the Android Market to show you protected and paid/all apps. Some users that are on CM7 or other ROMS are not able to see certain apps in the Market.

This app will allow you to quickly click a button to change your Market Fingerprint.

Requires Android 2.2+ and ROOT ACCESS!




Friday, February 10, 2012

Artist Promotion For February

We are also supporting local and unsigned artist on our website for a week at a time!! Get more exposure for your band/music. Potente Blog has over 15,000 pageviews a month!


If you have a music widget player email liteupmobile@gmail.com with your information to be selected as the artist of the week on our blog.

Artist Benny James



Music press kits

Thursday, February 9, 2012

Android Tutorial - Delete Batterystats.bin (Root Required)

If you have a rooted phone and can request Superuser permission then here is an easy way to delete your batterystats.bin file. This is the same as going into Recovery Mode and wiping battery stats.


In your OnCreate method call this...


//Request Superuser permission to use the application
      try {
    Runtime.getRuntime().exec("su");
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

Inside your Activity put this code on a button or OnClickListener...


                  Runtime runtime = Runtime.getRuntime();  
             Process proc = null;  
             OutputStreamWriter osw = null;  
             String command="busybox rm -f /data/system/batterystats.bin";    
             try {
             // Run Script        
             proc4 = runtime.exec("su");      
             osw4 = new OutputStreamWriter(proc.getOutputStream());
             osw4.write(command);              
             osw4.flush();      
             osw4.close();
                       }
             catch (IOException ex)
             {      
             ex.printStackTrace();
}
            }
        }

Now you are able to wipe your battery stats without going into recovery mode every time.

Tuesday, February 7, 2012

Need Beta Testers!

I am looking for around 10 Beta testers for new features in our applications.

If you would like to be a beta tester please send a email to liteupmobile@gmail.com in the SUBJECT please put "Wanna be a beta tester" so I know who wants to be one.

This will only last about 2 weeks maybe a little longer. I am looking for users running Android 2.2, 2.3, 3.0 and 4.0 + If you feel you can help improve apps then please feel free to email us. Thank you!

 *NOTE* All beta testers will receive the paid version of whatever app they tested for FREE!!

 - Potente Mobile

Android Tutorial - Download File


This is how you can easily download a file from drop box or any other place you have files stored. Just plug in the website URL and the file you want download. 
try {
URL input = new URL("WHAT_URL_YOU_USE_TO_DOWNLOAD_FILE");
URLConnection conn = input.openConnection();
int contentLength = conn.getContentLength();
DataInputStream stream = new DataInputStream(input.openStream());
byte[] buffer = new byte[contentLength];
stream.readFully(buffer);
stream.close();
DataOutputStream output = new DataOutputStream(new FileOutputStream(Environment.getExternalStorageDirectory() + "/WHATEVER_FILE"));
output.write(buffer);
output.flush();
output.close();
} catch(FileNotFoundException e) {
return;
} catch (IOException e) {
return;
}
These permissions are needed for it work to properly.
<uses-permission android:name=”android.permission.INTERNET”></uses-permission>
<uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE”></uses-permission>
 Download Our Blog for Android!

Android Tutorial - Check File


This is how you check for a specific file on your SDCARD.
boolean exists1 = (new File(Environment.getExternalStorageDirectory() + “/example/1″)).exists();
if (exists1) {
}
This method can be used to create a new folder or delete files/directorys
File a = new File(Environment.getExternalStorageDirectory() + “/example1/example2″);
a.mkdir();//this will create example2 only
a.mkdirs();//this will create example1 and example2
a.delete();//this will delete example2 weather it is a file or a folder

Monday, February 6, 2012

Wifi Tether No Root Free

Wifi Tether No Root Free is an application that lets you share your phone's internet connection with other devices.

Connect to wifi or tether your phone with a data usb cable.

Setup a secuirty password so only you can access your connection.

This version is ad supported!



Saturday, February 4, 2012

Quick Tether No Root

*NO ROOT REQUIRED!*

Quick Tether lets you quickly enable USB Tethering on your device. No Tether fees! Share your phones connection with your PS3, Xbox 360, Wii, Tablet, or any other Wifi device.

Some cell phone providers do NOT let you tether or enable usb tethering. Please contact them first if the app does not work to make sure you are able to tether on your device.