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

Saturday, March 26, 2016

Convert ADT projects to Andmore

You can convert your existing ADT projects and workspace to work with Andmore. Select a project, and bring up the context menu, then select Configure->Convert ADT Android Configuration. The project will be updated to allow Andmore to recognize it as a Android project. This currently only works for existing Android Developer Tools projects, Android Studio projects that are using the old legacy directory structure should use the Import->Android->Existing Android Code into Workspace. Project support for Android Studio Projects is planned in an upcoming release.


Tuesday, July 2, 2013

AVD hardware settings - keyboard


   After updating Eclipse ( Help Menu -> Check for Updates ) ,
running and debugging my application in the Android Virtual Device (AVD) was a nightmare :
   I couldn't use the computer keyboard anymore to enter data in my Android app;
( AVD's keyboard wasn't QWERTY ) ; Entering one digit number took 4 or 5 mouse-clicks :-(

No QUERTY AVD :



http://developer.android.com/tools/devices/managing-avds.html

After adding hardware keyboard support , problem solved :
Hardware property = "Keyboard Support"
Value = "yes"



Hardware options

If you are creating a new AVD, you can specify the following hardware options for the AVD to emulate:
CharacteristicDescriptionProperty
Device ram sizeThe amount of physical RAM on the device, in megabytes. Default value is "96".hw.ramSize
Touch-screen supportWhether there is a touch screen or not on the device. Default value is "yes".hw.touchScreen
Trackball supportWhether there is a trackball on the device. Default value is "yes".hw.trackBall
Keyboard supportWhether the device has a QWERTY keyboard. Default value is "yes".hw.keyboard
DPad supportWhether the device has DPad keys. Default value is "yes".hw.dPad
GSM modem supportWhether there is a GSM modem in the device. Default value is "yes".hw.gsmModem
Camera supportWhether the device has a camera. Default value is "no".hw.camera
Maximum horizontal camera pixelsDefault value is "640".hw.camera.maxHorizontalPixels
Maximum vertical camera pixelsDefault value is "480".hw.camera.maxVerticalPixels
GPS supportWhether there is a GPS in the device. Default value is "yes".hw.gps
Battery supportWhether the device can run on a battery. Default value is "yes".hw.battery
AccelerometerWhether there is an accelerometer in the device. Default value is "yes".hw.accelerometer
Audio recording supportWhether the device can record audio. Default value is "yes".hw.audioInput
Audio playback supportWhether the device can play audio. Default value is "yes".hw.audioOutput
SD Card supportWhether the device supports insertion/removal of virtual SD Cards. Default value is "yes".hw.sdCard
Cache partition supportWhether we use a /cache partition on the device. Default value is "yes".disk.cachePartition
Cache partition sizeDefault value is "66MB".disk.cachePartition.size
Abstracted LCD densitySets the generalized density characteristic used by the AVD's screen. Default value is "160".





Friday, April 13, 2012

Eclipse SUBVERSION MKACTIVITY Commit FAILED



So, I've been trying to get Ecplise to work with the SVN trunk, but I keep on getting errors : 


Some of selected resources were not committed.
svn: Commit failed (details follow):
svn: MKACTIVITY of '/svn/!svn/act/211517ad-3601-0010-bf2a-d36de0e8e97a': 405 Method Not Allowed (http://jtelmon.googlecode.com)
svn: MKACTIVITY request failed on '/svn/!svn/act/211517ad-3601-0010-bf2a-d36de0e8e97a'




I figured out what the problem was. It turned out that I was not 
grabbing the svn from https, just the http. Either I missed the "s" 
key when typing it in or what, I don't know. But, it is all fixed now. 





I had on the label HTTPS but on the URL there was only HTTP : 







SQLite plugin for Eclipse



How to browse an Android SQLite Database from Eclipse Kepler

http://www.youtube.com/watch?feature=player_embedded&v=sAvlV0uw5zc

CellObject SQLite Browser : 
http://www.questoid.com/Download.aspx

Questoid website is down and the jar can be downloaded from : 
http://www.java2s.com/Code/Jar/c/com.questoid.htm
http://www.java2s.com/Code/JarDownload/com.questoid/com.questoid.sqlitebrowser_1.2.0.jar.zip

Requirements and how to use CellObject SQLite & XML Browser at
 http://cellobject.net/Tools/CellObjectSQLiteXMLBrowser.aspx

Java Sources at Google Code :
http://code.google.com/p/cellobject/source/browse/

-----------------------------------
How To Install:

Inside the downloaded .zip/.tar file there's a .jar file named net.cellobject.sqlitexmlbrowser_1.2.0.jar. 
Just copy this jar file into the "plugins" folder of your eclipse installation directory, then restart your eclipse.
That's it.








I needed to create an SQLite database for an Android application I was working on. I wanted to browse the database of my application from within Eclipse, instead of pulling it out and browsing with another application.
If you just want to do a little bit of debugging, see if your tables get created the way you want and similar things, there is a very nice plugin for Eclipse that might fit you:
  • Download  the CellObject SQLite & XML Browser plugin.
  • Unzip it
  • Put the .jar file you just extracted inside your eclipse plugin folder (/plugins)
  • restart Eclipse.
  • Start your emulator or plugin in the device on which you installed the application you want to test
  • Open the DDMS perspective in Eclipse (Window —> open perspective —> other —>DDMS)
  • Select your application database (you find it under data/data/[yourapplicationpackage]/databases)
  • Now click on the icon of CellObject browser on the upper right, it will open the CellObject SQLite Browser View.
Instead of Opening DDMS, we can open the CellObject SQLite & XML browser in our Java perspective itself by opening it from Windows--> Show View --> Other --> Other --> CellObject SQLite Browser...

adb shell
sqlite3 /data/data/com.app.name/databases/DatabaseName.db
adb pull /data/data/com.app.name/databases/DatabaseName.db .
sqlite3 DatabaseName.db



Other solution : 
http://www.mysamplecode.com/2011/06/android-emulator-sqlite-database.html
http://sourceforge.net/projects/sqlitebrowser/
http://sqlitebrowser.sourceforge.net/images/slackware9.jpg
http://sourceforge.net/p/sqlitebrowser/svn/73/tree/trunk/src/


Monday, October 31, 2011

SUSE : Eclipse Indigo - Android Development Plugin


http://pantestmb.blogspot.com/2011/08/eclipse-indigo-with-android-development.html



  1. Start Eclipse, then select Help > Install New Software....
  2. Click Add, in the top-right corner.
  3. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location:
    https://dl-ssl.google.com/android/eclipse/
  4. Click OK Note: If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons).
  5. In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
  6. In the next window, you'll see a list of the tools to be downloaded. Click Next.
  7. Read and accept the license agreements, then click Finish. Note: If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.
  8. When the installation completes, restart Eclipse.












Friday, October 28, 2011

Step 7 : POST data from JSON Android Client to WCF REST WebService

POST JSON data from an Android Client to a WCF RESTful WebService

The full Android.java source code is on Google Code :
http://code.google.com/p/jtelmon/source/browse/trunk/AndroidViews/src/net/learn2develop/AndroidViews/

The full Eclipse Indigo 3.7 - Android  project zipped on Google Docs :
https://docs.google.com/leaf?id=0BzKVfKe--t_cMDU5OTU5MDQtNDQzOC00YjE3LTlhODgtYjE1ZDhmZWFmZjc1&hl=en_GB


All files of the WCF RESTful Web Service are also on Google Code :
http://code.google.com/p/jtelmon/source/browse/trunk/AndroidViews/RestService

The full Visual Web Developer project -  VWD  Express 2010 also on Google Docs :
https://docs.google.com/leaf?id=0BzKVfKe--t_cODIwZWE2M2QtZTUwMy00Yjg1LTljMjUtYTA3MGI4YmM5OGZm&hl=en_GB

First we tried to post XML formatted data to a WCF Web Service with FIDDLER ( step 5 ) :
http://pantestmb.blogspot.com/2011/10/pass-multiple-body-parameters-wcf-rest.html

Then tried to post JSON data to a WCF Web Service with FIDDLER ( step 6 ) :
http://pantestmb.blogspot.com/2011/10/wcf-rest-fiddler-json-request-body.html

Now , knowing that the WCF Web Service responds OK with both XML and JSON ,
we can take our simple sample project to the ANDROID Client Test :


http://code.google.com/p/jtelmon/source/browse/trunk/AndroidViews/src/net/learn2develop/AndroidViews/SavePerson.java

package net.learn2develop.AndroidViews;


import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.util.Log;
import android.widget.EditText;
import android.widget.Toast;

import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpPost;
// import org.json.JSONObject;
import org.json.JSONStringer;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;

public class SavePerson extends Activity {

private final static String SERVICE_URI = "http://192.168.61.3/RestServicePost/RestServiceImpl.svc";

@Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);

       setContentView(R.layout.main);
       // String plate = new String("test");
       // POST request to
            HttpPost request = new HttpPost(SERVICE_URI + "/json/adduser");
            request.setHeader("Accept", "application/json");
            request.setHeader("Content-type", "application/json");
         
            String not = new String(" ");
            try {
            // Build JSON string
            JSONStringer vehicle = new JSONStringer()
                .object()
                    .key("rData")
                        .object()
                            .key("details").value("bar|bob|b@h.us|why")
                        .endObject()
                    .endObject();
         
            StringEntity entity = new StringEntity(vehicle.toString());
         
            Toast.makeText(this, vehicle.toString() + "\n", Toast.LENGTH_LONG).show() ;
         
            request.setEntity(entity);
         
            // Send request to WCF service
            DefaultHttpClient httpClient = new DefaultHttpClient();
            HttpResponse response = httpClient.execute(request);
            // Log.d("WebInvoke", "Saving : " + response.getStatusLine().getStatusCode());
            Toast.makeText(this, response.getStatusLine().getStatusCode() + "\n", Toast.LENGTH_LONG).show() ;
         
            }catch (Exception e) {
            not = "NOT ";
            }
         
            Toast.makeText(this, not + " OK ! " + "\n", Toast.LENGTH_LONG).show() ;
         
         

}  
}


http://code.google.com/p/jtelmon/source/browse/trunk/AndroidViews/RestService/IRestServiceImpl.cs


      [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            UriTemplate = "json/adduser")]
        PersonData AddJsonUser(RequestData rData);

In our simple example we create a JSONStringer object with "rData" key and "details" sub-key ;
      "rData" is the variable of the function "AddJsonUser" ;
"details" is the single property of the object "RequestData" :
 http://code.google.com/p/jtelmon/source/browse/trunk/AndroidViews/RestService/RequestData.cs


    [DataContract(Namespace = "")]
    public class RequestData
    {
        [DataMember]
        public string details { get; set; }
    }





The string  "bar|bob|b@h.us|why" of the JSONStringer is hard-coded to simplify things ;
After being parsed - it ends up in the SQLS table "Users" : 





http://code.google.com/p/jtelmon/source/browse/trunk/AndroidViews/RestService/RestServiceImpl.svc.cs
AddUser is the function triggered by the POST WCF Webservice
http://192.168.61.3/RestServicePost/RestServiceImpl.svc/json/adduser
with a JSON request body -  JSONStringer vehicle : 


        public PersonData AddUser(RequestData rData)
        {
            bool returnBool = false;

            var data = rData.details.Split('|');
            var response = new PersonData
            {
                Name = data[0],
                User = data[1],
                Email = data[2],
                Password = data[3]
            };

            SqlConnection dbConn = new SqlConnection(connStr);
            string sqlStr = "INSERT INTO users(username,name,email,password)
                          values('" + data[0] + "', '" + data[1] + "', '" + data[2] + "', '" + data[3] + "');";
            SqlCommand dbCommand = new SqlCommand(sqlStr, dbConn);
            try
            {
                dbConn.Open();
                if (dbCommand.ExecuteNonQuery() != 0)
                {
                    returnBool = true;
                }
                dbConn.Close();
            }
            catch
            {
                returnBool = false;
            }
            return response;
        }

        public PersonData AddJsonUser(RequestData rData)
        {
            return AddUser(rData);
        }



~ ~ ~


the SQL Server Database has only one table - Users :

CREATE TABLE [dbo].[Users](
[UserName] [varchar](100) NOT NULL,
[Name] [varchar](100) NOT NULL,
[EMail] [varchar](100) NOT NULL,
[Password] [varchar](100) NOT NULL,


Saturday, August 6, 2011

Android SDK, 64-bit linux & ia32-libs


Android SDK on a 64-bit linux machine


When installing Android SDK on Eclipse Indigo on Linux Mint 11 Katya amd64, appears an error 
of shared libraries : 

[2011-08-06 22:29:50 - SDK Manager] Created AVD 'a1' based on Android 1.5, ARM (armeabi) processor
[2011-08-06 22:36:34 - LocalPassport] /opt/android-sdk-linux_x86/platform-tools/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory


The available SDK downloads seem to be just for 32-bit versions of Linux; 
Is it possible to develop using the Android SDK on a 64-bit linux machine.



The solution is :


apt-get install ia32-libs
apt-get install sun-java6-jdk

Friday, August 5, 2011

Eclipse Indigo with Android Development Plugin

Eclipse Indigo with Android Development Tools ADT Plugin

Step 1 :

Download and install the Android SDK


Step 2 : 

 Downloading the ADT Plugin

Use the Update Manager feature of your Eclipse installation to install the latest revision of ADT on your development computer.<>
Assuming that you have a compatible version of the Eclipse IDE installed, as described in Preparing for Installation, above, follow these steps to download the ADT plugin and install it in your Eclipse environment.
  1. Start Eclipse, then select Help > Install New Software....
  2. Click Add, in the top-right corner.
  3. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location:
    https://dl-ssl.google.com/android/eclipse/
  4. Click OK Note: If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons).
  5. In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
  6. In the next window, you'll see a list of the tools to be downloaded. Click Next.
  7. Read and accept the license agreements, then click Finish. Note: If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.
  8. When the installation completes, restart Eclipse.
























Android requires compiler compliance level

Eclipse IDE for Java Developers
Version: Indigo Release
Build id: 20110615-0604


ERROR :
Android requires compiler compliance level 5.0. Please fix project properties

[2011-08-04 23:56:54 - LocalPassport] Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. Please use Android Tools > Fix Project Properties.

Problem solved :
Right click on your 
project->properties->java compiler, 
modify the version to 1.6



Thursday, August 4, 2011

Android Indigo : invalid command-line parameter



Android Emulator on Eclipse Indigo has an error like 
"invalid command-line parameter" :

 This post is about Eclipse Indigo Build id = 20110615-0604

[2011-08-04 18:13:32 - AndroidViews2] ------------------------------
[2011-08-04 18:13:32 - AndroidViews2] Android Launch!
[2011-08-04 18:13:32 - AndroidViews2] adb is running normally.
[2011-08-04 18:13:32 - AndroidViews2] Performing net.learn2develop.AndroidViews.ViewsActivity activity launch
[2011-08-04 18:13:32 - AndroidViews2] Automatic Target Mode: launching new emulator with compatible AVD 'avd_2.3'
[2011-08-04 18:13:32 - AndroidViews2] Launching a new emulator with Virtual Device 'avd_2.3'
[2011-08-04 18:13:37 - Emulator] invalid command-line parameter: Files\Android\android-sdk-windows\tools/emulator-arm.exe.
[2011-08-04 18:13:37 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'.
[2011-08-04 18:13:37 - Emulator] please use -help for more information


It seems that the error is caused by the SDK location path : 
C:\Program Files\Android\android-sdk-windows








This works on i386 : 
C:\Progra~1\Android\android-sdk-windows






After OK & Run : 




SDK location path on AMD64
C:\PROGRA~2\Android\android-sdk



Wednesday, August 3, 2011

Eclipse INDIGO Subversion - Google.Code


Subversion ( Subversive ) installation instructions


http://eclipse.org/downloads/
Eclipse Classic does not have Marketplace;
It's better to be used Eclipse IDE for Java Developers

1. Eclipse Marketplace


2.
    Find SUBVERSION

3.
Install Subversive


4.
After restart : check SVN Kit



And now , SUBVERSION ( Subversive ) is installed ;
Instead of Subversive , on Win32 - an alternative is SUBCLIPSE .

Now let's import in Eclipse a project from Google Code :

5.

File -> Import -> SVN -> Project from SVN


Let's check out :
  Enter 
     http://jtelmon.googlecode.com/svn 
  in the URL and then click BROWSE :  






We've just imported from code.Google.com a project ;
With a user and password one can modify the project and commit updates .




~ ~ ~ 
         Android SDK for Eclipse on Ubuntu : 

How to Install the Android SDK and Eclipse Indigo on Ubuntu



Monday, March 28, 2011

Eclipse 3.7 Indigo - WindowBuilder

EclipseCon heralds new day for Java

You may program in C or C++.
But we're exposing everything as RESTful APIs,
so you can use any programming language you're familiar with."



Eclipse rekindles Java relationship

Due out on June 22, Indigo, or Eclipse 3.7, is slated to feature early access to the Java 7 platform's language features, such as Project Coin small language enhancements. These features would work with Eclipse Java editing tools. Also, Java tools in Indigo include WindowBuilder, which is a GUI tool designed by Instantiations; EGit 1.0, for connecting from the Eclipse workbench to the Git distribution control system, and better Maven tools, for initiating Maven builds from within the workbench. Other technologies planned for Indigo include the Eclipse IDE 3.7 and Standard Widget Toolkit 3.7.