Showing posts with label Eclipse. Show all posts
Showing posts with label Eclipse. Show all posts

Sunday, 9 February 2014

Running Android application on device from eclipse in Ubuntu/Linux

While for windows this process might be as simple as a click on the run button with debugging mode enabled on the device, with Ubuntu it needs a little configuration changes.

So, Here is how you can do it with Ubuntu/Linux:-

Step 1: Setup eclipse with Android development kit.

Download from here developer.android.com

Extract the zip file.

cd to the extracted drive and run eclipse.

Step 2: Create and android application.

how to do that : first android app

Step 3: connect your android device over USB, And enable USB debugging option (under Settings -> Developer options)

Step 4: Run the application from the run button on top.


if you get a pop up box like this, that means that eclipse is unable to access the USB device.

Step 5: Enable access to the USB device.

open terminal and run this command:
    lsusb

Bus 002 Device 001: ID 1abc:0abc Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 1abc:0abc Ricoh Co., Ltd
Bus 001 Device 005: ID 1abc:0abc Foxconn / Hon Hai
Bus 001 Device 002: ID 1abc:0abc Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1abc:0abc Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1abc:0abc Linux Foundation 3.0 root hub
Bus 003 Device 010: ID 0bb4:0cac HTC (High Tech Computer Corp.) 
Bus 003 Device 002: ID 1abc:0abc Lite-On Technology Corp.
Bus 003 Device 001: ID 1abc:0abc Linux Foundation 2.0 root hub
 
 
Here the vendor id is 0bb4, and the product id is : 0cac

Now open file

    sudo vim /etc/udev/rules.d/51-android.rules
 
And add the following lines:

    # fastboot protocol on manta (HTC Incredible S)
    SUBSYSTEM=="usb", ATTR{idVendor}=="<vendor id>", ATTR{idProduct}=="<product id>", MODE="0600", OWNER="viki"

Unplug the device and re-plug it.

Step6: Open Eclipse and re-run the application.
It should open up in the device.

And questions or suggestions please leave them in the comments below.

---
Thanks
viki

Friday, 7 June 2013

Configuring JAD decompiler and jadclipse for Eclipse in Ubuntu 13.04 / Linux

How to setup Jad and Jadclipse for Eclipse on a Linux machine. 

Personally i have had problems with this setup many times in the past So i have put together this guidelines to do the setup in a hassle free manner.

Though this guidelines have been tested only on Ubuntu 13.04 and 12.04. They should work on generally any Linux machine.

Now i am assuming you have eclipse Installed. If not please install that first.

Step 1

Download jad from this location JAD Java Decompiler Download Mirror and extract the file.


  • Download the Linux version Jad 1.5.8e for Linux on Intel platform [For me this didn't work]
  • Jad 1.5.8e for Linux (statically linked) So i downloaded this one. 
  • [don't worry about it being 32Bit/64bit.]

Step 2

Testing that Jad is working. [Optional but Recommended] 

  • Arrange for any .class file. It ok to either make one by yourself.
  • Or copy any eclipse path/plugins/*.jar file and extract it and you will find many .class there.
  • put the class file in the jad folder
  • Then go to the folder 
      cd jad158e.linux.static/ 

      ./jad <class file name>
  • A .jad file should have gotten created as classFileName.jad.
  • [If not please post a comment i will try to help you out]

Step 3

  • Move the extracted jad folder to a proper location. I recoment /opt/
      sudo mv ~/Downloads/jad158e.linux.static /opt/

Step 4 [install jadclipse]

      sudo mv ~/Downloads/net.sf.jadclipse_3.3.0.jar /opt/eclipse/plugins/net.sf.jadclipse_3.3.0.jar


Step 5

  • Change working directory to eclipse directory.  Mine is 
      cd /opt/eclipse 
      
      eclipse -clean 
  • This should start eclipse 

Step 6

  • Go to Window -> Preferences Select Java-> JadClipse 
  • set Path to de-compiler as 
      /opt/jad158e.linux.static/jad 


  • [I renamed my folder for ease so its looking a little different in the screen shot] 
  • Apply changes 

Step 7 [This is the most important step]



  •  Select General->Editors ->File Associations 
  • Ensure that you have selected the "*.class without sources" in the upper box. This is where i make mistake most of the time.
  • Select class without source on the top box Select "jadClipse Class File Viewer". 
  • Set it as "default" viewer for class files without sources. This is also very important step. 
  • Apply changes 

Step 8



  • Now close this window and open any java library file.

 
  • De-compiler should be working fine now. 


Please leave comment, any Question below. I Will be happy to answer. 
-- 
Dasvidaniya 

Friday, 8 February 2013

Removing White Space Characters From Eclipse Editor

White Space Character is visible in Eclipse Editor.

Carriage Return Visible above

Steps to hide this :

Open Eclipse
Got to Windows menu -> Preferences.



Go To General - > Editors -> Text Editors

Monday, 17 December 2012