Archives : December-2015

Not a snippet, but a needed Information when using Microsoft Android Calc How to Format cells in Excel for Android. (Sceenshot made on a german device) Some more informations are available in the video at https://support.office.com/en-us/article/Video-Getting-started-with-Excel-for-Android-tablet-c5d5c135-0bc1-4aea-9b54-95a518dd0c11. Excel for Android is very similar to Microsoft Excel for Windows. But some differences can confuse sometimes. The short ..

Read more

A pl/sql script to recompile all invalid objects in oracle. Simple but powerfull. DECLARE obj_name_ User_Objects.object_name%TYPE; obj_type_ User_Objects.object_type%TYPE; str_run_ VARCHAR2(200); cid_ INTEGER; ret_ INTEGER; CURSOR Invalid_Objects_ IS SELECT object_name, object_type FROM user_objects WHERE status = ‘INVALID’ ORDER BY object_type ASC; BEGIN FOR Get_Rec_ IN Invalid_Objects_ LOOP BEGIN obj_name_ := Get_Rec_.object_name; obj_type_ := Get_Rec_.object_type; IF (obj_type_ ..

Read more

If you want to sort any ArrayList in java, you need to make sure, your objects in the arrylist are comparable. This is done by using implements Comparable and implementing the abstract method compareTo (T cmp). For example if you want to sort some highscores you can do it like this. public class Highscore implements ..

Read more

To execute a shell command from your android app you can grab the standard input of the su process just launched by Runtime.getRuntime().exec(“su”) and write down the command there, otherwise you are running the commands with the current UID. With the following code you can excute the screenrecord command to grab your screen to a ..

Read more

If you want to develop an Android app to turn on/off GPS you can use the following code snippets. // turn on gps public void turnGPSOn() { Intent intent = new Intent(“android.location.GPS_ENABLED_CHANGE”); intent.putExtra(“enabled”, true); this.ctx.sendBroadcast(intent); String provider = Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED); if(!provider.contains(“gps”)){ //if gps is disabled final Intent poke = new Intent(); poke.setClassName(“com.android.settings”, “com.android.settings.widget.SettingsAppWidgetProvider”); poke.addCategory(Intent.CATEGORY_ALTERNATIVE); poke.setData(Uri.parse(“3”)); ..

Read more

Mobile devices have virtual keyboards. There is only limited space on the display to show the keyboard, so it will be helpful to the user to see only the needed keys. Using the right input type will dramatically improve the mobile experience. There are many different input types available for html pages. Here are my ..

Read more

Yes, it is possible to disable the text selection with a simple line of CSS. The user-select property is a new CSS3 property. Using user-select enables web and app developers to control the ability to select text. Most browsers (With CSS3 support), can do this by using variations on the CSS3 user-select property. The user-select ..

Read more