Eclipse android setup, cannot for the life of me!

by Raphael » Wed, 29 Apr 2009 08:22:52 GMT


Sponsored Links
 Could you start by telling us:
- what OS are you using?
- which version of Eclipse?
- which exact version is your JDK?

To install ADT in Eclipse, you check the download site URL in the
"Available Software" tab and click "Install" on the upper left. When
the install complete, does Eclipse ask you to restart Eclipse?

R/

On Thu, Apr 23, 2009 at 11:49 AM, chrisfg...@gmail.com



--~--~---------~--~----~------------~-------~--~----~



Eclipse android setup, cannot for the life of me!

by Woogie Jeong » Wed, 29 Apr 2009 15:04:41 GMT


 You should install JDT after you install all eclipse, JDK and android SDK.JDT
is displaying  "Windows->preferences-> Android" tab.
Please refer  http://developer.android.com/sdk/1.1_r1/installing.html 
Installing the ADT Plugin for Eclipse
Also follow this web site installation sequence that will be more convenient
to setup your PC.

BR,
Woogie.


On Fri, Apr 24, 2009 at 3:49 AM, chrisfg...@gmail.com




--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Motorola Charm

Hi, guys.
Im trying to backport motorola charm to 2.2.
And now im write BoardConfig.mk

alls fine but i dont uderstand where i can get
BOARD_FLASH_BLOCK_SIZE := ??????

With others partitions ok.
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x00380000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 00480000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x08b260000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x0ab20000

-- 

2. SimlpleCursorAdapter and ListView with custom row and a checkbox

Hi! I have ONE annoying problem with SimpleCursorAdapter. My programm
has list view and ListActivity. Each row has it's own layout:

<TableLayout xmlns:android=" http://www.***.com/ 
android"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="horizontal" android:weightSum="1.0">
<TableRow>
    <TextView android:id="@+id/task_time"
        android:layout_width="wrap_content"
android:layout_height="wrap_content"
        android:textSize="24sp" android:text="Time">
    </TextView>
    <LinearLayout android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="fill_parent">
        <TextView android:id="@+id/task_name"
            android:layout_width="wrap_content"
android:layout_height="wrap_content"
            android:textSize="20sp" android:text="Name">
        </TextView>
        <TextView android:id="@+id/task_categoty"
            android:layout_width="wrap_content"
android:layout_height="wrap_content"
            android:text="Category" android:textSize="12sp">
        </TextView>
    </LinearLayout>
    <TextView android:id="@+id/task_state"
        android:layout_width="wrap_content"
android:layout_height="wrap_content"
        android:text="State" android:textSize="12sp">
    </TextView>
    <CheckBox android:id="@+id/task_enabled"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
android:focusable="false">
    </CheckBox>

</TableRow>
Tasks are stored in SQLite database. I have DAO object (singleton) to
access the database. TaskDao:

    public void upda{*filter*}abled(int id, boolean enabled){
    SQLiteDatabase db = dbHelper.getWritableDatabase();
    ContentValues cv = new ContentValues();
    cv.put(ENABLED_COLUMN, enabled==true?1:0);
    Log.i(TAG, "update to " + cv.get(ENABLED_COLUMN) );
    try{
        db.beginTransaction();
        db.update(TASK_TABLE, cv, ID_COLUMN+"=?", new String[]{id
+""});
        db.setTransactionSuccessful();
    } catch (SQLException e) {
        Log.i(TAG, "edit task failed!");
    } finally {
        db.endTransaction();
        if (db != null)
            db.close();
    }
}
and the Cursor method for ListActivity:

    public Cursor getTasks(){
    SQLiteDatabase db = dbHelper.getReadableDatabase();
    return db.query(TASK_TABLE, COLUMNS, null, null, null, null,
NAME_COLUMN);
}
I extended SimpleCursorAdapter (TaskDbAdapter) like this:

    @Override
public View getView(int position, View convertView, ViewGroup parent)
{
    if(convertView==null){
        convertView = inflater.inflate(R.layout.task_list_row, null);
    }
    Cursor c = getCursor();
    c.moveToPosition(position);
    Log.i(TAG, "getView " + position + " = " + c.getInt(enabledIdx));
    enabled.setTag(c.getInt(c.getColumnIndex(BaseColumns._ID)));
    enabled.setChecked(c.getInt(enabledIdx)>0?true:false);
    enabled.setOnClickListener(this);
    return convertView;
}
@Override
public void onClick(View v) {
    CheckBox box = (CheckBox) v;
    Integer id = (Integer)box.getTag();
    TaskDao.getInstance(context).upda{*filter*}abled(id.intValue(),
box.isChecked());
}
And at last I use all the above stuff in my main ListActivity

    private void refreshList(){
    c = TaskDao.getInstance(this).getTasks();
    startManagingCursor(c);
    adapter = new TaskDbAdapter(this, R.layout.task_list_row, c, new
String[]{TaskDao.ENABLED_COLUMN}, new int[]{R.id.task_enabled});
    setListAdapter(adapter);
}
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.task);
    getListView().setItemsCanFocus(false);
    getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
    getListView().setVerticalScrollBarEnabled(true);
    registerForContextMenu(getListView());
    getListView().setOnCreateContextMenuListener(this);
    refreshList();
}


@Override
protected void onResume() {
    super.onResume();
    refreshList();
}
@Override
protected void onPause() {
    super.onPause();

}
Everything works fine. But CheckBoxes loose their states. For instance
I check my first column and scroll the list down. In my trace before
press I have:

getView 0 = 0
getView 2 = 0
getView 3 = 0
then

uptate to 1
and then (when I scroll up to the first element)

getView 0 = 0
getView 2 = 0
getView 3 = 0
I tried to make getCursor().requery(); in my TaskDbAdapter onClick
method. But then I saw no items in the list! And exception because of
cursor management(connection was closed by android). When I write
startManagingCursor(c); in refreshList() method then check and uncheck
methods don't work. Please, Help!

-- 

3. Draw bitmaps one after other using canvas

4. sql query

5. Run application during boot up(.apk file)

6. TextView with a top margin that is proportional to the height of the parent view

7. Detect Android version