Showing posts from 2014

DeCompile .apk file on ubuntu 14.04

1. Download   Dex2jar from   and Extract it.

2. Go to Download path

./ /home/manoj/someApk.apkif .sh is not compilable that giver chomod a+x permission.3. It will generate .jar file.To open that .jar file we have to use JD-Gui. Just download it and Go to that path. and follow below command throught your terminal(ALT+CTR+T).Here's the process I went through: $ ./jd-gui ./jd-gui: error while loading shared libraries: cannot open shared object file: No such file or directory $ sudo apt-get install libgtk2.0-0:i386 $ ./jd-gui ./jd-gui: error while loading shared libraries: cannot open shared object file: No such file or directory $ sudo apt-get install libxxf86vm1:i386 $ ./jd-gui ./jd-gui: error while loading shared libraries: cannot open shared object file: No such file…

Ubuntu Refrences and Commands Hacks

Privileges sudo command – run command as root sudo -s – open a root shell sudo -s -u user – open a shell as user sudo -k – forget sudo passwords gksudo command – visual sudo dialog (GNOME) kdesudo command – visual sudo dialog (KDE) sudo visudo – edit /etc/sudoers gksudo nautilus – root file manager (GNOME) kdesudo konqueror – root file manager (KDE) passwd – change your password
Network ifconfig – show network information iwconfig – show wireless information sudo iwlist scan – scan for wireless networks sudo /etc/init.d/networking restart – reset network for manual configurations (file) /etc/network/interfaces – manual configuration ifup interface – bring interface online ifdown interface – disable interface


Dedicated Runtime Thread (ART vs Dalvik)

What is Dalvik?
Dalvik is the process virtual machine (VM) in Google's Android operating system. It is the software that runs the apps on Android devices. Dalvik is thus an integral part of Android, which is typically used on mobile devices such as mobile phones and tablet computers as well as more recently on embedded devices such as smart TVs and media streamers. Programs are commonly written in Java and compiled to bytecode. They are then converted from Java Virtual Machine-compatible .class files to Dalvik-compatible .dex (Dalvik Executable) files before installation on a device. The compact Dalvik Executable format is designed to be suitable for systems that are constrained in terms of memory and processor speed. Dalvik is open-source software.
Dalvik is named after an Icelandic city. (source)
Okay so what is ART?
ART is a project Google has been working on for reportedly for 2 years. The goal of ART was to produce a faster runtime that wouldn't suffer from the problems Da…

How To Install Git 1.9.0 On Ubuntu 14.04,13.10,12.10,12.04,10.04, Linux Mint 16,14,13 And Elementary OS 0.2

$ sudo add-apt-repository ppa:git-core/ppa

$ sudo apt-get update

$ sudo apt-get install git

Push Your App to GitHub
Check if Git is installed
In the terminal type git --version (1.8 or higher preferred)
If not, download Git [here] ( Then, setup your local Git profile - In the terminal:
Type git config --global "your-name"
Type git config --global "your-email"
To check if Git is already config-ed you can type git config –list
Push your app to GitHub using the command line
git init git status git add . git commit -m "first commit" git remote add origin git push -u origin master enter your username and password of github
GIT and REPO CheatSheet

Install JDK on Ubuntu

sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

#replace 7 with 6 or 8

Switch installed JDK using below commands

sudo update-alternatives --config java

There are 2 choices for the alternative java (providing /usr/bin/java).

Selection    Path                                     Priority   Status
  0            /usr/lib/jvm/java-6-oracle/jre/bin/java   2         auto mode
* 1            /usr/lib/jvm/java-6-oracle/jre/bin/java   2         manual mode
  2            /usr/lib/jvm/java-7-oracle/jre/bin/java   1         manual mode

Press enter to keep the current choice[*], or type selection number:

select the number and press Enter

Generate SHA1 Key Using Terminal

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

How to Create & Extract tar.gz and tar.bz2 Files in Linux

>How to create a compressed tar.gz file from a folder or file in Linux?tar czf new-tar-file-name.tar.gz file-or-folder-to-archive Here is the command explanation:tar - the tar command.c - create new archive.z - compress the archive using gzip.f - use archive - the name of the tar.gz to create.file-or-folder-to-archive - the name of the folder we want to archive.
>How to create a compressed tar.gz file from multiple files and folders in Linux?tar -czf new-tar-file-name.tar.gz file1 file2 folder1 folder2 >How to extract a compressed tar.gz file in Linux?tar -xzf tar-file-name.tar.gz
Here is the command explanation:
tar - the tar command.x - extract the archive.z - uncompress the archive using gzip.f - use archive file.tar-file-name.tar.gz - the name of the tar.gz to create. The tar command will extract all the files/folders in the archive to the current directory.
>How to extract a compressed tar.bz2 file in Linux?
Extracting tar.bz2 (bzip2 fil…

Sample Syntax Declaration for NDK

Getting Static String from JNI env->NewStringUTF("I am back with string!");
Access Fields Declared in java class (publicfloat[] VertexCoords;)
1. jclass cls = env->GetObjectClass(obj); //obj is the object of java class 2. jfieldID fieldId = env->GetFieldID(cls, "VertexCoords", "[F"); // VertexCoords is the name of variable defined in java // [F defines the type of variable it is array float 3. jobject objArray = env->GetObjectField (obj, fieldId); // Take the field in jobject. 4. jfloatArray* fArray = reinterpret_cast<jfloatArray*>(&objArray); // Cast it to jfloatArray 5. jsize len = env->GetArrayLength(*fArray); //get the length of float array 6. float* data = env->GetFloatArrayElements(*fArray, 0); //get all data after getting data perform the task according to your requirements
7. env->ReleaseFloatArrayElements(*fArray, data, 0); //Dont forget to release the pointer array

Access Methods Declared in java class (publicint getFacetC…
JNI Types and Data Structures Table 3-1 Primitive Types and Native Equivalents Java Type Native Type Description boolean jboolean unsigned 8 bits byte jbyte signed 8 bits char jchar unsigned 16 bits short jshort signed 16 bits int jint signed 32 bits long jlong signed 64 bits float jfloat 32 bits double jdouble 64 bits void void N/A Type Signatures The JNI uses the Java VM’s representation of type signatures. Table 3-2 shows these type signatures. Table 3-2 Java VM Type Signatures Type Signature Java Type Z boolean B byte C char S short I int J long F float D double   
L fully-qualified-class ; fully-qualified-class

Design Android Settings page in application with Custom Strings.xml

Hi Guys,

In this tuttorial I would like to explain about the android settings screen and also how can a developers can customize there own strings.xml file ex. you can name your string.xml file as strings_common.xml or xyz.xml.

Please find the source code from below link. Hope this will help to some of the developers.

Fragments Video player with remote url

If any one like this than please find out the source code from Below link

Write Utils Class in Android

public class Utils

public static void showToast(Context context, String message)
Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);;
toast.setGravity(Gravity.CLIP_HORIZONTAL | Gravity.CENTER_HORIZONTAL, 0, 0);


public static int convertToDIP(Context context, int pixels) {
   return Math.round(pixels * context.getResources().getDisplayMetrics()
   // DIP

public static String getDeviceName()
String manufacturer = Build.MANUFACTURER;
String model = Build.MODEL;
if (model.startsWith(manufacturer))
return capitalize(model);
return capitalize(manufacturer) + " " + model;

private static String capitalize(String s)
if (s == null || s.length() == 0)
return "";
char first = s.charAt(0);
if (Character.isUpperCase(first))
return s;
return Character.toUpperCase(first) + s.substring(1);

public static boolean isEmpty(String key)
return (key.toString().trim().equals("") || key.toString().trim().equals("null…

Changing locale programmatically

privatestaticvoid setLocale(String newLocale ){Locale locale =newLocale( newLocale );Locale.setDefault( locale );Configuration config =newConfiguration(); config.locale = locale; context.getResources().updateConfiguration( config, context.getResources().getDisplayMetrics());}