RSS

Tag Archives: eclipse

Gradle: SDK location not found, the problem and solution


In a recent project, I created a Gradle project in windows, but when I load the project in Ubuntu and Mac OSX, an error “SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable”

image

I then followed the instruction, and in the ~/.bashrc file, I added the environment variable ANDROID_HOME

image

Read the rest of this entry »

Advertisements
 
8 Comments

Posted by on July 2, 2014 in General, Linux, Mac, Programming, Windows

 

Tags: , , , , , , , , , , , , ,

Enable USB debugging for Samsung Galaxy S4, S5, Galaxy Note and tablet


You might wish to enable usb dubugging for Samsung Galaxy S4, S5 or Galaxy Note 10.1 (2014 Edition) for a number of reasons. For instance, if you are an Android App developer, this is a must-have features to enable sideloading of your app to your device. Or you might find that you can not find your device in Eclipse, where you want to click “Run”, then your app is uploaded automatically then fired with a single button click.

Enabling the USB debugging feature is not easily found in the latest Galuxy S4, S5 and note devices. Here is how to do that:

Go to Galaxy settings, then System Tab –> then Click “About Device” icon

image image

Read the rest of this entry »

 
2 Comments

Posted by on May 21, 2014 in Android, Programming

 

Tags: , , , , , , , , , ,

Android, you ask to “Run As”, but it still “Debug as”


When you develop an android App in Eclipse, sooner or later, you will encounter such a weird problem: you press the “Run As” button, but it is still running as if you clicked “Debug as”, as shown below.

image

I have tried many suggested solutions, including:

  • Click the Disconnect button in debug mode
    image
  • In Run menu, click the “Remove all break point” menu item
  • Restart eclipse

But none of them worked. You know what? Finally I get this problem resolved by:

Restart the Android Device! Then it worked!

 
1 Comment

Posted by on March 4, 2014 in Android, Programming

 

Tags: , , , , , , ,

Android tab control: the old way


  1. Create a new android project in Eclipse
  2. Create two (as many as you like) activities in Eclipse:
    1. Right click the Package Exporer, New > Other, or press Ctrl + N;
    2. Select Android Activity, name it Tabpage1 and Tabpage2
  3. Create a new Activity as the MainActivity, make sure it extends from TabActivity, instead of Activity.
  4. In MainActivity’s onCreate() function, add below code:

    image

  5. Build and run, that is it.

2013-07-23 11.20.36

 

 
1 Comment

Posted by on July 23, 2013 in Android, Programming

 

Tags: , , , , , ,

Install Eclipse Git Plugin: A Quick Tutorial


There has been a very good, but lengthy tutorial here, but if you have been comfortable with Git, and just want to commit, pull or push your code to and from GitHub or Bitbucket, the below measures will be a breeze.

image

image

  • After it is installed, open you Eclipse project, right click on the Package Explorer, and there are only two menu items if you have not set up the EGit to work with your project.

image

  • Click the menu item Team > Share Project…  > Git
    Yes, even though you have used Git Bash/cmd to setup your project, you need do so! Just to get EGit notified. Specify the root folder where .git (hidden folder) is located.

image

  • Once you have done so, you will find when you right click the Package Explorer, Team > Share Project…  > Git again, you will see many menu items now.

image

That is it. You can then do almost everything that can be done by Git Bash inside Eclipse.

Happy coding!

 
Leave a comment

Posted by on July 22, 2013 in Programming

 

Tags: , , , , ,