[android-beginners] Re: Android app communicating with the "outside"

2008-04-01 Thread Dan U.

I don't know if the source for the android tools has been made
available or will be made available, but that would be something to
watch for in the future if you needed some way to write to your
computers hard drive. You could also try to use the sdcard. There
might be a way to mount it in your computer. That way, you could write
to the sdcard from your client code, then access it in your computer.

/data/data//files/out.txt is on the emulator file
system. You can log in with "adb shell" or you can copy the file from
the emulator with adb pull.

So with your http post, you were using the actual ip address of your
computer in the url? That should work.

On Apr 1, 10:48 pm, yizhao <[EMAIL PROTECTED]> wrote:
> I can't write to the C: drive?!  That sucks.  Are there any other
> alternatives?  I need the Android app to relay info to the outside
> world (app write data that outside programs consume).  These are the
> two ways I came up with : ).
>
> When I said I couldn't find this file, I meant the computer file
> system.  How do I access /data/data//files/
> out.txt?  Can an independent java program be able to read from this
> file?
>
> As for the http post, from an independent client, it works (I had to
> of course change 0.0.2.2 to localhost).  The post hits a webapp
> implemented in Web Works.  I have this code sitting inside the
> onCreate() method of an Activity.  It doesn't give any on screen
> exceptions.  Just no result on the server side.
>
> Thanks again,
> Yi
>
> On Apr 2, 1:24 am, "Dan U." <[EMAIL PROTECTED]> wrote:
>
> > ok, here's my advice:
>
> > - You won't be able to write to your c: drive afaik.
> > - You can't find the file on the file system? Do you mean your
> > computers file system or the emulators file system? It should be on
> > the emulator in /data/data//files/out.txt.
> > - I don't think there would be a permissions problem for either the
> > file or http examples you gave.
> > - Your http post code looks ok at first glance. Are you getting any
> > exceptions with it?
>
> > Why do you need to write something to C: anyway? Are you working on
> > some kind of development tool?
>
> > On Apr 1, 9:54 pm, yizhao <[EMAIL PROTECTED]> wrote:
>
> > > Hi everyone,
>
> > > I have an app that needs to write to a file that is accessible from
> > > programs outside of Android.  The snippet of code is as follows:
>
> > > OutputStreamWriter osw = new
> > > OutputStreamWriter( openFileOutput( "out.txt",
> > > MODE_WORLD_READABLE ) );
> > > osw.write( "picture taken: " + picId );
> > > osw.flush();
> > > osw.close();
>
> > > Android doesn't allow me to write to the outside, for example the C:
> > > drive and I'm not able to find this file anywhere on the file system.
> > > I'm guessing its some kind of permissions problem.  I would like to be
> > > able to write to anywhere on the file system I want.  Is that
> > > possible?
>
> > > Also, since what I tried above didn't work, I also tried writing a
> > > Http Post and posting the info to a webapp.  This code works
> > > independently but when put inside an Activitie's onCreate() method, it
> > > doesn't work.  Again, I'm guessing it has to do with permissions:
>
> > > String data =
> > > URLEncoder.encode( "signinUserAccount.userName", "UTF-8" )  + "=" +
> > > URLEncoder.encode("a", "UTF-8");
> > > data += "&" +
> > > URLEncoder.encode("signinUserAccount.password", "UTF-8") + "=" +
> > > URLEncoder.encode("b", "UTF-8");
>
> > > URL url = new URL("http://10.0.2.2:8080/GoogleCamAF/
> > > userAccountView.action");
> > > URLConnection conn = url.openConnection();
> > > conn.setDoOutput(true);
> > > OutputStreamWriter wr = new
> > > OutputStreamWriter(conn.getOutputStream());
> > > wr.write(data);
> > > wr.flush();
>
> > > Any advice would be greatly appreciated!
>
> > > Yi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Android app communicating with the "outside"

2008-04-01 Thread yizhao

I can't write to the C: drive?!  That sucks.  Are there any other
alternatives?  I need the Android app to relay info to the outside
world (app write data that outside programs consume).  These are the
two ways I came up with : ).

When I said I couldn't find this file, I meant the computer file
system.  How do I access /data/data//files/
out.txt?  Can an independent java program be able to read from this
file?

As for the http post, from an independent client, it works (I had to
of course change 0.0.2.2 to localhost).  The post hits a webapp
implemented in Web Works.  I have this code sitting inside the
onCreate() method of an Activity.  It doesn't give any on screen
exceptions.  Just no result on the server side.

Thanks again,
Yi

On Apr 2, 1:24 am, "Dan U." <[EMAIL PROTECTED]> wrote:
> ok, here's my advice:
>
> - You won't be able to write to your c: drive afaik.
> - You can't find the file on the file system? Do you mean your
> computers file system or the emulators file system? It should be on
> the emulator in /data/data//files/out.txt.
> - I don't think there would be a permissions problem for either the
> file or http examples you gave.
> - Your http post code looks ok at first glance. Are you getting any
> exceptions with it?
>
> Why do you need to write something to C: anyway? Are you working on
> some kind of development tool?
>
> On Apr 1, 9:54 pm, yizhao <[EMAIL PROTECTED]> wrote:
>
> > Hi everyone,
>
> > I have an app that needs to write to a file that is accessible from
> > programs outside of Android.  The snippet of code is as follows:
>
> > OutputStreamWriter osw = new
> > OutputStreamWriter( openFileOutput( "out.txt",
> > MODE_WORLD_READABLE ) );
> > osw.write( "picture taken: " + picId );
> > osw.flush();
> > osw.close();
>
> > Android doesn't allow me to write to the outside, for example the C:
> > drive and I'm not able to find this file anywhere on the file system.
> > I'm guessing its some kind of permissions problem.  I would like to be
> > able to write to anywhere on the file system I want.  Is that
> > possible?
>
> > Also, since what I tried above didn't work, I also tried writing a
> > Http Post and posting the info to a webapp.  This code works
> > independently but when put inside an Activitie's onCreate() method, it
> > doesn't work.  Again, I'm guessing it has to do with permissions:
>
> > String data =
> > URLEncoder.encode( "signinUserAccount.userName", "UTF-8" )  + "=" +
> > URLEncoder.encode("a", "UTF-8");
> > data += "&" +
> > URLEncoder.encode("signinUserAccount.password", "UTF-8") + "=" +
> > URLEncoder.encode("b", "UTF-8");
>
> > URL url = new URL("http://10.0.2.2:8080/GoogleCamAF/
> > userAccountView.action");
> > URLConnection conn = url.openConnection();
> > conn.setDoOutput(true);
> > OutputStreamWriter wr = new
> > OutputStreamWriter(conn.getOutputStream());
> > wr.write(data);
> > wr.flush();
>
> > Any advice would be greatly appreciated!
>
> > Yi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Android app communicating with the "outside"

2008-04-01 Thread Dan U.

ok, here's my advice:

- You won't be able to write to your c: drive afaik.
- You can't find the file on the file system? Do you mean your
computers file system or the emulators file system? It should be on
the emulator in /data/data//files/out.txt.
- I don't think there would be a permissions problem for either the
file or http examples you gave.
- Your http post code looks ok at first glance. Are you getting any
exceptions with it?

Why do you need to write something to C: anyway? Are you working on
some kind of development tool?

On Apr 1, 9:54 pm, yizhao <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I have an app that needs to write to a file that is accessible from
> programs outside of Android.  The snippet of code is as follows:
>
> OutputStreamWriter osw = new
> OutputStreamWriter( openFileOutput( "out.txt",
> MODE_WORLD_READABLE ) );
> osw.write( "picture taken: " + picId );
> osw.flush();
> osw.close();
>
> Android doesn't allow me to write to the outside, for example the C:
> drive and I'm not able to find this file anywhere on the file system.
> I'm guessing its some kind of permissions problem.  I would like to be
> able to write to anywhere on the file system I want.  Is that
> possible?
>
> Also, since what I tried above didn't work, I also tried writing a
> Http Post and posting the info to a webapp.  This code works
> independently but when put inside an Activitie's onCreate() method, it
> doesn't work.  Again, I'm guessing it has to do with permissions:
>
> String data =
> URLEncoder.encode( "signinUserAccount.userName", "UTF-8" )  + "=" +
> URLEncoder.encode("a", "UTF-8");
> data += "&" +
> URLEncoder.encode("signinUserAccount.password", "UTF-8") + "=" +
> URLEncoder.encode("b", "UTF-8");
>
> URL url = new URL("http://10.0.2.2:8080/GoogleCamAF/
> userAccountView.action");
> URLConnection conn = url.openConnection();
> conn.setDoOutput(true);
> OutputStreamWriter wr = new
> OutputStreamWriter(conn.getOutputStream());
> wr.write(data);
> wr.flush();
>
> Any advice would be greatly appreciated!
>
> Yi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Android app communicating with the "outside"

2008-04-01 Thread yizhao

Hi everyone,

I have an app that needs to write to a file that is accessible from
programs outside of Android.  The snippet of code is as follows:

OutputStreamWriter osw = new
OutputStreamWriter( openFileOutput( "out.txt",
MODE_WORLD_READABLE ) );
osw.write( "picture taken: " + picId );
osw.flush();
osw.close();

Android doesn't allow me to write to the outside, for example the C:
drive and I'm not able to find this file anywhere on the file system.
I'm guessing its some kind of permissions problem.  I would like to be
able to write to anywhere on the file system I want.  Is that
possible?

Also, since what I tried above didn't work, I also tried writing a
Http Post and posting the info to a webapp.  This code works
independently but when put inside an Activitie's onCreate() method, it
doesn't work.  Again, I'm guessing it has to do with permissions:

String data =
URLEncoder.encode( "signinUserAccount.userName", "UTF-8" )  + "=" +
URLEncoder.encode("a", "UTF-8");
data += "&" +
URLEncoder.encode("signinUserAccount.password", "UTF-8") + "=" +
URLEncoder.encode("b", "UTF-8");

URL url = new URL("http://10.0.2.2:8080/GoogleCamAF/
userAccountView.action");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter wr = new
OutputStreamWriter(conn.getOutputStream());
wr.write(data);
wr.flush();

Any advice would be greatly appreciated!

Yi

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Showing Default text in EditText fields

2008-04-01 Thread sasperilla

Wel God Damn that worked. :-)

The coloring is done by default out of the box.  Thanks for the hint.
Pun intended.

Charlie

On Apr 1, 9:06 pm, "Dan U." <[EMAIL PROTECTED]> wrote:
> I think there was a setting called "hint" that should do it, although
> I'm not sure if/how it handles text color changes.
>
> On Apr 1, 5:26 pm, sasperilla <[EMAIL PROTECTED]> wrote:
>
> > I've seen this in the map application and other apps where EditText
> > fields will display some default text in grey when the fields are
> > empty.  Then if a user starts to enter text into the fields it clears
> > the default text out, and shows the  text they entered in black.  I
> > was looking through the API and trying to see if I could do that
> > easily, but I don't see it.  Is there an example out there of how to
> > do this?  Does the API support this out of the box?
>
> > Charlie
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Change DDMS port

2008-04-01 Thread exticu

Well I could not change the VM debug port but it was not needed I
solved the real problem.  My localhost was not being resolved to
127.0.0.1, and therefore ddms was not able to bind to port 8700 on
some random x.x.x.x address.  All is ok, for now.

On Apr 1, 1:15 pm, exticu <[EMAIL PROTECTED]> wrote:
> I cannot change any Android preferences, because when one is selected
> I get an infinite sequence of error popups, preventing any more
> interaction with Eclipse.
>
> How can I change the VM debug port (without using Eclipse->Window-
>
> >Preferences)?
>
> Thanks
>
> On Apr 1, 1:35 am, "Dan U." <[EMAIL PROTECTED]> wrote:
>
> > Maybe it means to go to Window->Preferences, then Android->DDMS and
> > change ADB debugger base port.
>
> > On Mar 31, 3:18 pm, exticu <[EMAIL PROTECTED]> wrote:
>
> > > Whenever I try to start a new project or change Android setting in
> > > Eclipse, I get a stream of popup windows saying:
> > > "Could not open Selected VM debug port (8700). Make sure you do not
> > > have another instance of DDMS or of the eclipse plugin running. If
> > > it's being used by something else, choose a new port number in the
> > > preferences"
>
> > > How can I change the VM debug port? (since 8700 is in use)
>
> > > There is a .ddms file in my home directory but it doesn't have an
> > > option for which port to use.
>
> > > Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Showing Default text in EditText fields

2008-04-01 Thread Dan U.

I think there was a setting called "hint" that should do it, although
I'm not sure if/how it handles text color changes.

On Apr 1, 5:26 pm, sasperilla <[EMAIL PROTECTED]> wrote:
> I've seen this in the map application and other apps where EditText
> fields will display some default text in grey when the fields are
> empty.  Then if a user starts to enter text into the fields it clears
> the default text out, and shows the  text they entered in black.  I
> was looking through the API and trying to see if I could do that
> easily, but I don't see it.  Is there an example out there of how to
> do this?  Does the API support this out of the box?
>
> Charlie
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Displaying data from the database in a Spinner

2008-04-01 Thread android newbie

Hi,

I'm trying to display items from a database in a Spinner. I've read
other posts on this but my items still aren't showing up and none of
the posts show a complete solution.

To help debug the error, I added a ListView and the items from the
same db call display without any problem in the list. Thus, there's
some little detail that I can't find in my code for the Spinner. I'd
certainly appreciate someone pointing out the error.

To try to help me debug the code, after selecting an item from the
"invisible" list, I print out the selected item and it displays:
[EMAIL PROTECTED]

I can see that the spinner has lots of items and I can scroll through
them but they don't display anything.

Code:

public class TestListCursor extends ListActivity {
private DBInterface mDbHelper;
private Cursor notesCursor,
   spinnerCursor;
Spinner spnItems;
TextView tvItem;
SimpleCursorAdapter _itemsAdapter = null;
Button btnSel;

public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.notes_list);
this.spnItems = (Spinner) findViewById(R.id.spn_NL_items);
this.tvItem = (TextView) findViewById(R.id.tvNLSelection);
this.btnSel = (Button) findViewById(R.id.btnNL);

mDbHelper = new DBInterface(this);
fillSpinner();
fillData();

this.btnSel.setOnClickListener (new View.OnClickListener() {
public void onClick(View v) {
 
TestListCursor.this.tvItem.setText(TestListCursor.this.spnItems.getSelectedItem().toString());
}
});

}



private void fillData() {
// Get all of the rows from the database and create the item
list
notesCursor = null;
notesCursor = mDbHelper.getItemsCursor();


// Create an array to specify the fields we want to display in
the list (only TITLE)
String[] from = new String[]{DbAdapter.ROUTE_NAME};

// and an array of the fields we want to bind those fields to
(in this case just text1)
int[] to = new int[]{R.id.text1};
int i = 0;
 if (notesCursor != null) {
startManagingCursor(notesCursor);
// Now create a simple cursor adapter and set it to display
SimpleCursorAdapter notes =
new SimpleCursorAdapter(this, R.layout.notes_row,
notesCursor, from, to);
setListAdapter(notes);
 }
}

private void fillSpinner() {
  spinnerCursor = mDbHelper.getItemsCursor();
  if (this.spinnerCursor != null) {
 MMFLog.log("Workout fillItemsSpinner cursor items: " +
this.spinnerCursor.count());
 startManagingCursor(this.spinnerCursor);
 this.spinnerCursor.next();
 // Create an array to specify the fields we want to 
display
in the spinner (only Name)
 String[] names = new String[] {DbAdapter.ROUTE_NAME};
 int[] to = new int[]
{ android.R.layout.simple_spinner_item };

 // Now create a simple cursor adapter and set it to 
display
 this._itemsAdapter =
new SimpleCursorAdapter(this,
android.R.layout.simple_spinner_item, this.spinnerCursor, names, to);

this._itemsAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
 this._itemsAdapter.bindView(this.spnItems, this,
this.spinnerCursor);
 this.spnItems.setAdapter(this._itemsAdapter);
 } else {
 Toast.makeText(this, "error: items cursor is null",
Toast.LENGTH_SHORT);
 }
}

}


--
xml file:


http://schemas.android.com/apk/res/
android"
android:layout_height="275px"
android:layout_width="wrap_content"
android:orientation="vertical"
>











If you see the error or if you have a good working example that you'd
be willing to post, I'd certainly appreciate the feedback.

AN


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Showing Default text in EditText fields

2008-04-01 Thread sasperilla


I've seen this in the map application and other apps where EditText
fields will display some default text in grey when the fields are
empty.  Then if a user starts to enter text into the fields it clears
the default text out, and shows the  text they entered in black.  I
was looking through the API and trying to see if I could do that
easily, but I don't see it.  Is there an example out there of how to
do this?  Does the API support this out of the box?

Charlie
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Need help in debugging null pointer exception

2008-04-01 Thread Kwang Yi Tan

Wow that is one nifty trick. Thank you very much.

On Apr 1, 8:51 am, maaxiim <[EMAIL PROTECTED]> wrote:
> 1. Open the Debug perspective in Eclipse
> 2. Choose the 'Breakpoints' view tab.
> 3. Select the 'Add Java Exception Breakpoint' and choose
> NullPointerException.
> 4. Launch your activity, either by using 'Debug As...' or attaching
> the debugger to a running instance via DDMS.
> 5. Execute the offending workflow. It will break on the line that
> caused the NPE.
>
> On Apr 1, 12:58 am, Kwang Yi Tan <[EMAIL PROTECTED]> wrote:
>
>
>
> > hi,
>
> > I went through the notepad tutorial and find that the presentation is
> > close a download manager application that i am writing. So I used the
> > notepad3 as a skeleton and started putting in my own code. When I
> > tried to run it, I got a null pointer exception for my activity. Where
> > should I look in eclipse to try to locate the problem? Any help will
> > be greatly appreciated.
>
> > [2008-04-01 00:42:15 - FileShare] Pushing FileShare.apk to /data/app
> > on device 'emulator-tcp-'
> > [2008-04-01 00:42:16 - FileShare] Starting activity on device:
> > com.asu.android.app.fileshare.fileshare
> > [2008-04-01 00:42:21 - FileShare] ActivityManager: Starting: Intent
> > { comp={com.asu.android.app.fileshare/
> > com.asu.android.app.fileshare.fileshare} }
> > [2008-04-01 00:42:21 - FileShare] New package not yet registered with
> > the system. Waiting 3 seconds before next attempt.
> > [2008-04-01 00:42:21 - FileShare] ActivityManager: Error: Activity
> > class {com.asu.android.app.fileshare/
> > com.asu.android.app.fileshare.fileshare} does not exist.
> > [2008-04-01 00:42:24 - FileShare] Starting activity on device:
> > com.asu.android.app.fileshare.fileshare
> > [2008-04-01 00:42:28 - FileShare] ActivityManager: DDM dispatch reg
> > wait timeout
> > [2008-04-01 00:42:28 - FileShare] ActivityManager: Can't dispatch DDM
> > chunk 48454c4f: no handler defined
> > [2008-04-01 00:42:28 - FileShare] ActivityManager: Starting: Intent
> > { comp={com.asu.android.app.fileshare/
> > com.asu.android.app.fileshare.fileshare} }
>
> > and that there will be a force quit message appearing on the emulator- Hide 
> > quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Debugger crashes Eclipse every time

2008-04-01 Thread [EMAIL PROTECTED]

This bug is still present.

On Feb 5, 3:20 pm, Megha <[EMAIL PROTECTED]> wrote:
> Hi,
>
> This is a known bug in the debugging feature.
> It will be fixed in a future release of the SDK.
>
> Thanks,
> Megha
>
> On Feb 2, 2:39 pm, Trevor <[EMAIL PROTECTED]> wrote:
>
> > I just downloaded Java (1.6.0_03),Eclipse(3.3.1.1), the plug-in (ADT
> > 0.3.1) and the SDK (rc37a) onto my Vista 64 machine. I'm just trying
> > to get through the HelloWorld example and I'm to the part where it
> > says to add a null-pointer exception and run the debugger via Run >
> > Debug History.
>
> > The emulator comes up fine and waits for the debugger to connect and
> > the debugger opens inEclipsejust fine but when I step through to the
> > line with the exceptionEclipsecrashes with a window that says:
>
> > Multiple Errors haveOccurred
> > Multiple operations have reported errors. Select anerrorto view its
> > details.
> > (Selection list entries)
> > has children update (Time oferror: February 2, 2008 2:21:12 PM PST)
> > Aninternalerroroccurredduring: "has children update". (Time of
> >error: February 2, 2008 2:21:12 PM PST)
> >Label Job(Time oferror: February 2, 2008 2:21:12 PM PST)
> > Aninternalerroroccurredduring: "Label Job". (Time oferror:
> > February 2, 2008 2:21:12 PM PST)
>
> > Followed by another window:
> >Internalerror
> > Aninternalerroroccurredwhile showing aninternalerror.
> > You are recommended to exit the workbench.
> > Subsequent errors may happen and may terminate the workbench without
> > warning.
> > See the .log file for more details.
>
> > Here's the .log trace dump:
> > !ENTRY org.eclipse.core.jobs 4 2 2008-02-02 14:21:12.537
> > !MESSAGE Aninternalerroroccurredduring: "has children update".
> > !STACK 0
> > java.lang.InternalError: Invalid signature: ""
> > at org.eclipse.jdi.internal.TypeImpl.signatureToTag(TypeImpl.java:
> > 307)
> > at
> > org.eclipse.jdi.internal.LocalVariableImpl.tag(LocalVariableImpl.java:
> > 185)
> > at
> > org.eclipse.jdi.internal.StackFrameImpl.getValues(StackFrameImpl.java:
> > 128)
> > at
> > org.eclipse.jdi.internal.StackFrameImpl.getValue(StackFrameImpl.java:
> > 73)
> > at
> > org.eclipse.jdt.internal.debug.core.model.JDILocalVariable.retrieveValue(JDILocalVariable.java:
> > 57)
> > at
> > org.eclipse.jdt.internal.debug.core.model.JDIVariable.getCurrentValue(JDIVariable.java:
> > 66)
> > at
> > org.eclipse.jdt.internal.debug.core.model.JDIVariable.getValue(JDIVariable.java:
> > 88)
> > at
> > org.eclipse.debug.internal.ui.model.elements.VariableContentProvider.hasChildren(VariableContentProvider.java:
> > 62)
> > at
> > org.eclipse.jdt.internal.debug.ui.variables.JavaVariableContentProvider.hasChildren(JavaVariableContentProvider.java:
> > 73)
> > at
> > org.eclipse.debug.internal.ui.model.elements.ElementContentProvider.updateHasChildren(ElementContentProvider.java:
> > 223)
> > at 
> > org.eclipse.debug.internal.ui.model.elements.ElementContentProvider
> > $3.run(ElementContentProvider.java:200)
> > at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
>
> > !ENTRY org.eclipse.core.jobs 4 2 2008-02-02 14:21:12.559
> > !MESSAGE Aninternalerroroccurredduring: "Label Job".
> > !STACK 0
> > java.lang.InternalError: Invalid signature: ""
> > at org.eclipse.jdi.internal.TypeImpl.signatureToTag(TypeImpl.java:
> > 307)
> > at
> > org.eclipse.jdi.internal.LocalVariableImpl.tag(LocalVariableImpl.java:
> > 185)
> > at
> > org.eclipse.jdi.internal.StackFrameImpl.getValues(StackFrameImpl.java:
> > 128)
> > at
> > org.eclipse.jdi.internal.StackFrameImpl.getValue(StackFrameImpl.java:
> > 73)
> > at
> > org.eclipse.jdt.internal.debug.core.model.JDILocalVariable.retrieveValue(JDILocalVariable.java:
> > 57)
> > at
> > org.eclipse.jdt.internal.debug.core.model.JDIVariable.getCurrentValue(JDIVariable.java:
> > 66)
> > at
> > org.eclipse.jdt.internal.debug.core.model.JDIVariable.getValue(JDIVariable.java:
> > 88)
> > at
> > org.eclipse.debug.internal.ui.model.elements.VariableLabelProvider.getLabel(VariableLabelProvider.java:
> > 92)
> > at
> > org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider.retrieveLabel(ElementLabelProvider.java:
> > 201)
> > at
> > org.eclipse.jdt.internal.debug.ui.variables.JavaVariableLabelProvider.retrieveLabel(JavaVariableLabelProvider.java:
> > 126)
> > at org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider
> > $LabelUpdater.run(ElementLabelProvider.java:151)
> > at org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider
> > $LabelJob.run(ElementLabelProvider.java:70)
> > at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to

[android-beginners] Re: How to make rows smaller in ListView?

2008-04-01 Thread Zach

I'm sorry but I thought more about this and it simply doesn't make any
sense. This ListView currently only shows 6 rows at once. My iPhone,
which is 320 x 480, shows 9 rows in the Notes app and 8 in Safari's
bookmarks view. The rows are simply WAY too big.

Is there really no way to make them smaller?

On Apr 1, 2:20 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote:
> The rows currently have an appropriate size for devices with a touch
> screen. The size of the UI on your computer screen is much bigger than
> its size on an actual device.
>
>
>
> On Tue, Apr 1, 2008 at 11:17 AM, Zach <[EMAIL PROTECTED]> wrote:
>
> >  Okay, but is there a way to make the rows the size they were in m3?
> >  The rows currently are taking too much space.
>
> >  On Apr 1, 1:49 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> >  > Hi Zach,
>
> >  > This screenshot is from m3 and has not been updated for m5.
> >  > Thanks for pointing it out, it will be updated.
>
> >  > -Megha
>
> >  > On Tue, Apr 1, 2008 at 8:58 AM, Zach <[EMAIL PROTECTED]> wrote:
>
> >  > > Hey,
>
> >  > > I am confused as to why in the ListView screenshot shown below, the
> >  > > rows are quite small:
>
> >  > >http://code.google.com/android/reference/view-gallery.html
>
> >  > > Yet when I run the sample project it comes from, List1.java, the rows
> >  > > are about twice as high:
>
> >  > >http://code.google.com/android/samples/ApiDemos/src/com/google/androi...
>
> >  > > How can I modify it to make it look like the screenshot?
>
> >  > > Thanks!
>
> --
> Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Please review my short code !

2008-04-01 Thread Geoffrey

Not sure if my last message came through. But I think the problem you
have is as follows...

change

AnswerTextView[0].findViewById(R.id.cau_1_answer_grammar);

to

AnswerTextView[0] = findViewById(R.id.cau_1_answer_grammar);


..Geoffrey


On Apr 1, 1:27 pm, "LE THANH TUNG" <[EMAIL PROTECTED]> wrote:
> I have run many times. It's a long and complicated code with no error on
> eclipse editor. But the result is null pointer exception. I have tried but
> not found the exact error. I just doubt if these method is right with
> Android library.
>
> Thanks.
>
>
>
> On Wed, Apr 2, 2008 at 3:14 AM, tim jones <[EMAIL PROTECTED]> wrote:
>
> > Why can't you run it yourself to see if it has problems, then ask us
> > why it is not working properly?
>
> > On Tue, Apr 1, 2008 at 2:50 PM, LE THANH TUNG <[EMAIL PROTECTED]>
> > wrote:
> > > Does my following short code have problem ?
>
> > > TextView[]AnswerTextView = new TextView[10];
>
> > > protected void onCreate(Bundle icicle) {
>
> > > 
> > > AnswerTextView[0].findViewById(R.id.cau_1_answer_grammar);
> > > 
> > > AnswerTextView[9].findViewById(R.id.cau_10_answer_grammar);
> > >setAnswerListTextView()
>
> > >   }
> > >protected void setAnswerListTextView() {
>
> > > // Display answer in "Your answer:" column
>
> > > for(int i=0;i<=9;i++){
> > > AnswerTextView[i].setText(AnswerList[i]); //is it possible ?
>
> > > }
> > > }
>
> > > Please correct if any, thanks !
>
> > > --
> > > Many thanks and regards
> > > LÊ THANH TÙNG
> > > Da Nang, Vietnam
>
> --
> Many thanks and regards
> LÊ THANH TÙNG
> Da Nang, Vietnam
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: About bullets

2008-04-01 Thread Megha Joshi
  Hi,

  You may want to look at expandable lists( these come close to bulleted
lists):

http://code.google.com/android/samples/ApiDemos/src/com/google/android/samples/view/ExpandableList1.html

  Android does not have any other view for using bullets(if you are talking
about using html /, you can use the webview).

  Thanks,
  Megha

On Mon, Mar 31, 2008 at 11:53 PM, Analdin Judy <[EMAIL PROTECTED]> wrote:

> Hi
>
>
>
>  Can we use bullets in android.if so?what is the syntax pls tell me
>
>
>
> Thanks
> judy
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Please review my short code !

2008-04-01 Thread LE THANH TUNG
I have run many times. It's a long and complicated code with no error on
eclipse editor. But the result is null pointer exception. I have tried but
not found the exact error. I just doubt if these method is right with
Android library.

Thanks.

On Wed, Apr 2, 2008 at 3:14 AM, tim jones <[EMAIL PROTECTED]> wrote:

>
> Why can't you run it yourself to see if it has problems, then ask us
> why it is not working properly?
>
>
>
> On Tue, Apr 1, 2008 at 2:50 PM, LE THANH TUNG <[EMAIL PROTECTED]>
> wrote:
> > Does my following short code have problem ?
> >
> > TextView[]AnswerTextView = new TextView[10];
> >
> > protected void onCreate(Bundle icicle) {
> >
> > 
> > AnswerTextView[0].findViewById(R.id.cau_1_answer_grammar);
> > 
> > AnswerTextView[9].findViewById(R.id.cau_10_answer_grammar);
> >setAnswerListTextView()
> >
> >   }
> >protected void setAnswerListTextView() {
> >
> > // Display answer in "Your answer:" column
> >
> > for(int i=0;i<=9;i++){
> > AnswerTextView[i].setText(AnswerList[i]); //is it possible ?
> >
> > }
> > }
> >
> > Please correct if any, thanks !
> >
> > --
> > Many thanks and regards
> > LÊ THANH TÙNG
> > Da Nang, Vietnam
> > >
> >
>
> >
>


-- 
Many thanks and regards
LÊ THANH TÙNG
Da Nang, Vietnam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Please review my short code !

2008-04-01 Thread tim jones

Why can't you run it yourself to see if it has problems, then ask us
why it is not working properly?



On Tue, Apr 1, 2008 at 2:50 PM, LE THANH TUNG <[EMAIL PROTECTED]> wrote:
> Does my following short code have problem ?
>
> TextView[]AnswerTextView = new TextView[10];
>
> protected void onCreate(Bundle icicle) {
>
> 
> AnswerTextView[0].findViewById(R.id.cau_1_answer_grammar);
> 
> AnswerTextView[9].findViewById(R.id.cau_10_answer_grammar);
>setAnswerListTextView()
>
>   }
>protected void setAnswerListTextView() {
>
> // Display answer in "Your answer:" column
>
> for(int i=0;i<=9;i++){
> AnswerTextView[i].setText(AnswerList[i]); //is it possible ?
>
> }
> }
>
> Please correct if any, thanks !
>
> --
> Many thanks and regards
> LÊ THANH TÙNG
> Da Nang, Vietnam
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Assess other variable from other class in the same package !

2008-04-01 Thread Dan U.

Yes, you would have to have an instance of each, unless the variables
were defined as static. In your case, you wouldn't need to specify
public. The default modifier will work since they are in the same
package.

On Apr 1, 7:06 am, Pepel <[EMAIL PROTECTED]> wrote:
> and in order to access them using an instance of each of the Cau_1... Cau_10
> classes, the variables have to be public (or access them using a public
> method)
>
>   regards.
>
> P.D. This is more a java question than an android question
>
> On 4/1/08, Pepel <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > The class that wants to access the  variables from the other class can
> > only access them through an instance of the class! (or if the class Inherit
> > from the Cau_1.. Cau_10 classes)
>
> >   regards,
>
> > On 4/1/08, LE THANH TUNG <[EMAIL PROTECTED]> wrote:
>
> > > Hi !
>
> > > I have 10 classes :
>
> > > Cau_1.java containing variable char Cau_1_Answer
> > > Cau_2.java containing variable char Cau_2_Answer
> > > 
> > > Cau_10.java containing variable char Cau_10_Answer
>
> > > and another class with char[] AnswerList = char[]{Cau_1_Answer,
> > > Cau_2_Answer,...,Cau_10_Answer}
>
> > > Why does the class with AnswerList get error *can not resolve* 
> > > *Cau_1_Answer,
> > > can not resolve Cau_2_Answer..*.?
>
> > > I keep all the default modifier because they are in the same package.
> > > Even I change in public, it doesn't work either ?
>
> > > What I did wrong and how to resolve ? Thanks for help !
>
> > > --
> > > Many thanks and regards
> > > LÊ THANH TÙNG
> > > Da Nang, Vietnam
>
> > --
> > Pepel
>
> --
> Pepel
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Please review my short code !

2008-04-01 Thread LE THANH TUNG
Does my following short code have problem ?

TextView[]AnswerTextView = new TextView[10];

protected void onCreate(Bundle icicle) {


AnswerTextView[0].findViewById(R.id.cau_1_answer_grammar);

AnswerTextView[9].findViewById(R.id.cau_10_answer_grammar);
   setAnswerListTextView()

  }
   protected void setAnswerListTextView() {

// Display answer in "Your answer:" column

for(int i=0;i<=9;i++){
AnswerTextView[i].setText(AnswerList[i]); //is it possible ?

}
}

Please correct if any, thanks !

-- 
Many thanks and regards
LÊ THANH TÙNG
Da Nang, Vietnam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to show alerts

2008-04-01 Thread Megha Joshi
Hi Raul,

You could use the Toast.cancel() or Toast.setDuration() method to dismiss
the alert programatically.
To call Toast from a thread other than the main UI thread you can create a
handler in the main UI thread, and then post the runnable in which your
Toast is created to this handler.


 final Handler mHandler = new Handler();

   Thread t = new Thread() {
   public void run() {
   mHandler.post(mUpdate);
   }
   };

   t.start();
   }

   final Runnable mUpdate = new Runnable() {
   public void run() {
   Toast.makeText(Spad6.this, "New message",
   Toast.LENGTH_SHORT).show();


   }
   };


Thanks,
Megha
On Tue, Apr 1, 2008 at 12:03 PM, Raul Bocter <[EMAIL PROTECTED]> wrote:

> I see Toast being simmilar to AlertDialog. Still it is not a solution for
> me. The docs say the time the Toast is visible could be customizable. I
> don't see how. Anyway, I still get to the Looper problem. The API demos
> indicated make use of a Toast in the event thread. I need to show it in
> another thread. eg:
>
> public void run(){
>   // show information dialog 1
>
>   // try to do lengthly_stuff_1
>
>   // hide information dialog 1
>
>   // if lengthly_stuff_1 failed {
> // show information dialog 2
>
> // do lengthly_stuff_2
>
> // hide information dialog 2
>   }
> }
>
> Writing this e-mail, I got the idea to show the alert or Toast in the
> event thread ( runOnUIThread() ). It works and like this I can avoid the
> Looper. Ok, but what can I use to hide / dispose it exactly when I want and
> to do this programatically ?
>
>
> regards,
>Raul
>
>
>
>
> On Tue, Apr 1, 2008 at 9:15 PM, Megha Joshi <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > You can dismiss the dialog shown by showalert() by clicking the back
> > button on the emulator, if your dialog is cancelable.
> >
> > http://code.google.com/android/reference/android/content/Context.html#showAlert(java.lang.CharSequence,%20int,%20java.lang.CharSequence,%20java.lang.CharSequence,%20android.content.DialogInterface.OnClickListener,%20java.lang.CharSequence,%20android.content.DialogInterface.OnClickListener,%20boolean,%20android.content.DialogInterface.OnCancelListener)
> >
> > If you want a show an alert which disappears automatically after a
> > specified duration or disappears on calling cancel(), consider using the
> > Toast class instead.
> >
> > Sample code for using Toast:
> > The ApiDemos > apps> AlarmService.java,AlarmController.java
> >
> > Hope this helps!
> >
> > Thanks,
> > Megha
> >
> >
> > On Tue, Apr 1, 2008 at 6:37 AM, Raul Bocter <[EMAIL PROTECTED]>
> > wrote:
> >
> > > never mind that one. it seems to work if I put loop() at the end of
> > > the logic.
> > >
> > > I have another related problem now. I want to show two alerts, one
> > > after the other, as the logic advances. But I can not get rid of the first
> > > alert. Calling cancel() or dismiss() or both does not work. How can I 
> > > loose
> > > an alert programatically ?
> > >
> > > regards,
> > >Raul
> > >
> > >
> > >
> > >
> > > On Tue, Apr 1, 2008 at 4:07 PM, Raul Bocter <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > >   Hello,
> > > >
> > > >
> > > > I am trying to show alerts while doing some logic in the background.
> > > > I want to do this in a new thread (not the UI thread). I don't 
> > > > understand
> > > > how this should work. As I try to show the alert it throws an exception
> > > > saying i have to call Looper.prepare() first. Ok, I call prepare().
> > > > The alert does not show until Looper.loop()gets called. But after
> > > > loop(), the thread is stuck there. It will not go further. What would 
> > > > be a
> > > > solution for this?
> > > >
> > > > regards,
> > > >Raul
> > > >
> > >
> > >
> > >
> > >
> >
> >
> >
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Selecting from a listview...how do I know what I clicked on?

2008-04-01 Thread Megha Joshi
Hi,

You should use the onItemSelected() method of the ListView, which is invoked
when you select an item with keypad.

Sample code:
http://code.google.com/android/samples/ApiDemos/src/com/google/android/samples/view/List7.html

Thanks,
Megha

On Tue, Apr 1, 2008 at 2:42 AM, Salsa bob <[EMAIL PROTECTED]> wrote:

>
> I have this Listview with 5 elements in it, and when I select and pick
> one of them, I want to change to a different screen, depending on
> which item I picked. However, onListItemClick seems to only detect
> touchpad clicks, and doesn't do anything if I try to select and pick
> an item with the keypad. What's a good method to return the position
> of the focus when it clicks down on something? Onkey can only get back
> the entire listview, and not the element in it.
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to show alerts

2008-04-01 Thread Raul Bocter
I see Toast being simmilar to AlertDialog. Still it is not a solution for
me. The docs say the time the Toast is visible could be customizable. I
don't see how. Anyway, I still get to the Looper problem. The API demos
indicated make use of a Toast in the event thread. I need to show it in
another thread. eg:

public void run(){
  // show information dialog 1

  // try to do lengthly_stuff_1

  // hide information dialog 1

  // if lengthly_stuff_1 failed {
// show information dialog 2

// do lengthly_stuff_2

// hide information dialog 2
  }
}

Writing this e-mail, I got the idea to show the alert or Toast in the event
thread ( runOnUIThread() ). It works and like this I can avoid the Looper.
Ok, but what can I use to hide / dispose it exactly when I want and to do
this programatically ?


regards,
   Raul



On Tue, Apr 1, 2008 at 9:15 PM, Megha Joshi <[EMAIL PROTECTED]> wrote:

> Hi,
>
> You can dismiss the dialog shown by showalert() by clicking the back
> button on the emulator, if your dialog is cancelable.
>
> http://code.google.com/android/reference/android/content/Context.html#showAlert(java.lang.CharSequence,%20int,%20java.lang.CharSequence,%20java.lang.CharSequence,%20android.content.DialogInterface.OnClickListener,%20java.lang.CharSequence,%20android.content.DialogInterface.OnClickListener,%20boolean,%20android.content.DialogInterface.OnCancelListener)
>
> If you want a show an alert which disappears automatically after a
> specified duration or disappears on calling cancel(), consider using the
> Toast class instead.
>
> Sample code for using Toast:
> The ApiDemos > apps> AlarmService.java,AlarmController.java
>
> Hope this helps!
>
> Thanks,
> Megha
>
>
> On Tue, Apr 1, 2008 at 6:37 AM, Raul Bocter <[EMAIL PROTECTED]> wrote:
>
> > never mind that one. it seems to work if I put loop() at the end of the
> > logic.
> >
> > I have another related problem now. I want to show two alerts, one after
> > the other, as the logic advances. But I can not get rid of the first alert.
> > Calling cancel() or dismiss() or both does not work. How can I loose an
> > alert programatically ?
> >
> > regards,
> >Raul
> >
> >
> >
> >
> > On Tue, Apr 1, 2008 at 4:07 PM, Raul Bocter <[EMAIL PROTECTED]>
> > wrote:
> >
> > >   Hello,
> > >
> > >
> > > I am trying to show alerts while doing some logic in the background. I
> > > want to do this in a new thread (not the UI thread). I don't understand 
> > > how
> > > this should work. As I try to show the alert it throws an exception 
> > > saying i
> > > have to call Looper.prepare() first. Ok, I call prepare(). The alert
> > > does not show until Looper.loop()gets called. But after loop(), the
> > > thread is stuck there. It will not go further. What would be a solution 
> > > for
> > > this?
> > >
> > > regards,
> > >Raul
> > >
> >
> >
> >
> >
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Access other variable from other class in the same package !

2008-04-01 Thread LE THANH TUNG
I have resolved. thank you !

On Tue, Apr 1, 2008 at 11:12 PM, LE THANH TUNG <[EMAIL PROTECTED]>
wrote:

>
>
> Dear Pepel !
> >
> > I am even beginner in Java and thank you very much. I get well your
> > instruction. I still need your help, please see :
> >
> > In Cau_1, I set instance like this :
> > ...
> > char Cau_1_Answer;
> >
> >
> > protected char getCau_1_Answer() {
> > return Cau_1_Answer;
> > }
> > protected void setCau_1_Answer(char cau_1_Answer) {
> > Cau_1_Answer = cau_1_Answer;
> > }
> > 
> >
> > In the class that access :
> >
> > char[] AnswerList = new char[10];
> > ...// (1)
> >  protected void onCreate(Bundle icicle)
> > {
> > super.onCreate(icicle);
> > setContentView(R.layout.result_grammar);
> > AnswerList[0] = Cau_1_grammar.getCau_1_Answer(); //
> > AnswerList[0] assignment
> > ...
> >
> > The error is Cannot make a static reference to the non-static method
> > getCau_1_Answer() from the type  Cau_1_grammar
> >
> > If I place AnswerList[0] assignment at (1) , the error is Syntax error
> > on token ";", { expected after this token after the array
> > initialization.
> >
> > How can I fix it ?
> >
> > On Tue, Apr 1, 2008 at 9:06 PM, Pepel <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > and in order to access them using an instance of each of the Cau_1...
> > > Cau_10 classes, the variables have to be public (or access them using a
> > > public method)
> > >
> > >   regards.
> > >
> > > P.D. This is more a java question than an android question
> > >
> > >
> > > On 4/1/08, Pepel <[EMAIL PROTECTED]> wrote:
> > > >
> > > > The class that wants to access the  variables from the other class
> > > > can only access them through an instance of the class! (or if the class
> > > > Inherit from the Cau_1.. Cau_10 classes)
> > > >
> > > >   regards,
> > > >
> > > >
> > > > On 4/1/08, LE THANH TUNG <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > Hi !
> > > > >
> > > > > I have 10 classes :
> > > > >
> > > > > Cau_1.java containing variable char Cau_1_Answer
> > > > > Cau_2.java containing variable char Cau_2_Answer
> > > > > 
> > > > > Cau_10.java containing variable char Cau_10_Answer
> > > > >
> > > > > and another class with char[] AnswerList = char[]{Cau_1_Answer,
> > > > > Cau_2_Answer,...,Cau_10_Answer}
> > > > >
> > > > > Why does the class with AnswerList get error *can not resolve* 
> > > > > *Cau_1_Answer,
> > > > > can not resolve Cau_2_Answer..*.?
> > > > >
> > > > > I keep all the default modifier because they are in the same
> > > > > package. Even I change in public, it doesn't work either ?
> > > > >
> > > > > What I did wrong and how to resolve ? Thanks for help !
> > > > >
> > > > > --
> > > > > Many thanks and regards
> > > > > LÊ THANH TÙNG
> > > > > Da Nang, Vietnam
> > > > >
> > > > > > > > > >
> > > > >
> >
> >
> > --
> > Many thanks and regards
> > LÊ THANH TÙNG
> > Da Nang, Vietnam
> >
>
>
>
> --
> Many thanks and regards
> LÊ THANH TÙNG
> Da Nang, Vietnam
>



-- 
Many thanks and regards
LÊ THANH TÙNG
Da Nang, Vietnam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to make rows smaller in ListView?

2008-04-01 Thread Zach

Ah, I see. Thank you.

On Apr 1, 2:20 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote:
> The rows currently have an appropriate size for devices with a touch
> screen. The size of the UI on your computer screen is much bigger than
> its size on an actual device.
>
>
>
> On Tue, Apr 1, 2008 at 11:17 AM, Zach <[EMAIL PROTECTED]> wrote:
>
> >  Okay, but is there a way to make the rows the size they were in m3?
> >  The rows currently are taking too much space.
>
> >  On Apr 1, 1:49 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> >  > Hi Zach,
>
> >  > This screenshot is from m3 and has not been updated for m5.
> >  > Thanks for pointing it out, it will be updated.
>
> >  > -Megha
>
> >  > On Tue, Apr 1, 2008 at 8:58 AM, Zach <[EMAIL PROTECTED]> wrote:
>
> >  > > Hey,
>
> >  > > I am confused as to why in the ListView screenshot shown below, the
> >  > > rows are quite small:
>
> >  > >http://code.google.com/android/reference/view-gallery.html
>
> >  > > Yet when I run the sample project it comes from, List1.java, the rows
> >  > > are about twice as high:
>
> >  > >http://code.google.com/android/samples/ApiDemos/src/com/google/androi...
>
> >  > > How can I modify it to make it look like the screenshot?
>
> >  > > Thanks!
>
> --
> Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to make rows smaller in ListView?

2008-04-01 Thread Romain Guy

The rows currently have an appropriate size for devices with a touch
screen. The size of the UI on your computer screen is much bigger than
its size on an actual device.

On Tue, Apr 1, 2008 at 11:17 AM, Zach <[EMAIL PROTECTED]> wrote:
>
>  Okay, but is there a way to make the rows the size they were in m3?
>  The rows currently are taking too much space.
>
>  On Apr 1, 1:49 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
>  > Hi Zach,
>  >
>  > This screenshot is from m3 and has not been updated for m5.
>  > Thanks for pointing it out, it will be updated.
>  >
>  > -Megha
>  >
>  > On Tue, Apr 1, 2008 at 8:58 AM, Zach <[EMAIL PROTECTED]> wrote:
>  >
>  > > Hey,
>  >
>  > > I am confused as to why in the ListView screenshot shown below, the
>  > > rows are quite small:
>  >
>  > >http://code.google.com/android/reference/view-gallery.html
>  >
>  > > Yet when I run the sample project it comes from, List1.java, the rows
>  > > are about twice as high:
>  >
>  > >http://code.google.com/android/samples/ApiDemos/src/com/google/androi...
>  >
>  > > How can I modify it to make it look like the screenshot?
>  >
>  > > Thanks!
>  >
>



-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to make rows smaller in ListView?

2008-04-01 Thread Zach

Okay, but is there a way to make the rows the size they were in m3?
The rows currently are taking too much space.

On Apr 1, 1:49 pm, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> Hi Zach,
>
> This screenshot is from m3 and has not been updated for m5.
> Thanks for pointing it out, it will be updated.
>
> -Megha
>
> On Tue, Apr 1, 2008 at 8:58 AM, Zach <[EMAIL PROTECTED]> wrote:
>
> > Hey,
>
> > I am confused as to why in the ListView screenshot shown below, the
> > rows are quite small:
>
> >http://code.google.com/android/reference/view-gallery.html
>
> > Yet when I run the sample project it comes from, List1.java, the rows
> > are about twice as high:
>
> >http://code.google.com/android/samples/ApiDemos/src/com/google/androi...
>
> > How can I modify it to make it look like the screenshot?
>
> > Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to show alerts

2008-04-01 Thread Megha Joshi
Hi,

You can dismiss the dialog shown by showalert() by clicking the back button
on the emulator, if your dialog is cancelable.
http://code.google.com/android/reference/android/content/Context.html#showAlert(java.lang.CharSequence,%20int,%20java.lang.CharSequence,%20java.lang.CharSequence,%20android.content.DialogInterface.OnClickListener,%20java.lang.CharSequence,%20android.content.DialogInterface.OnClickListener,%20boolean,%20android.content.DialogInterface.OnCancelListener)

If you want a show an alert which disappears automatically after a specified
duration or disappears on calling cancel(), consider using the Toast class
instead.

Sample code for using Toast:
The ApiDemos > apps> AlarmService.java,AlarmController.java

Hope this helps!

Thanks,
Megha

On Tue, Apr 1, 2008 at 6:37 AM, Raul Bocter <[EMAIL PROTECTED]> wrote:

> never mind that one. it seems to work if I put loop() at the end of the
> logic.
>
> I have another related problem now. I want to show two alerts, one after
> the other, as the logic advances. But I can not get rid of the first alert.
> Calling cancel() or dismiss() or both does not work. How can I loose an
> alert programatically ?
>
> regards,
>Raul
>
>
>
>
> On Tue, Apr 1, 2008 at 4:07 PM, Raul Bocter <[EMAIL PROTECTED]> wrote:
>
> >   Hello,
> >
> >
> > I am trying to show alerts while doing some logic in the background. I
> > want to do this in a new thread (not the UI thread). I don't understand how
> > this should work. As I try to show the alert it throws an exception saying i
> > have to call Looper.prepare() first. Ok, I call prepare(). The alert
> > does not show until Looper.loop()gets called. But after loop(), the
> > thread is stuck there. It will not go further. What would be a solution for
> > this?
> >
> > regards,
> >Raul
> >
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: unable to use eclipse plugin

2008-04-01 Thread Percival

I found the problem. My path was still pointing to jre 1.4, changed it
to 1.5 and everything is working now.


On Apr 1, 12:14 pm, "LE THANH TUNG" <[EMAIL PROTECTED]> wrote:
> I heart that the Eclipse 3.2 doesn't not support programming on mobile
> phone, is that right ?
>
> Use 3.3 first !
>
>
>
> On Tue, Apr 1, 2008 at 8:51 PM, Percival <[EMAIL PROTECTED]> wrote:
>
> > I am new to android and have downloaded the latest SDK and eclipse
> > plugin.
>
> > I get the following error when i try to create a new android project.
>
> > The selected project could not be started
>
> > Reason:
> > Plug-in com.android.ide.eclipse.adt was unable to load class
> > com.android.ide.eclipse.adt.project.NewProjectWizard
>
> > also when I try to access the android preferences I get the error
>
> > Unable to create the selected preference page
>
> > Reason:
> > Plug-in com.android.ide.eclipse.adt was unable to load class
> > com.android.ide.eclipse.adt.preferences.BuildPreferencePage
>
> > I am currently on eclipse 3.2
>
> --
> Many thanks and regards
> LÊ THANH TÙNG
> Da Nang, Vietnam
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to make rows smaller in ListView?

2008-04-01 Thread Megha Joshi
Hi Zach,

This screenshot is from m3 and has not been updated for m5.
Thanks for pointing it out, it will be updated.

-Megha

On Tue, Apr 1, 2008 at 8:58 AM, Zach <[EMAIL PROTECTED]> wrote:

>
> Hey,
>
> I am confused as to why in the ListView screenshot shown below, the
> rows are quite small:
>
> http://code.google.com/android/reference/view-gallery.html
>
> Yet when I run the sample project it comes from, List1.java, the rows
> are about twice as high:
>
>
> http://code.google.com/android/samples/ApiDemos/src/com/google/android/samples/view/List1.html
>
> How can I modify it to make it look like the screenshot?
>
> Thanks!
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Change DDMS port

2008-04-01 Thread exticu

I cannot change any Android preferences, because when one is selected
I get an infinite sequence of error popups, preventing any more
interaction with Eclipse.

How can I change the VM debug port (without using Eclipse->Window-
>Preferences)?

Thanks

On Apr 1, 1:35 am, "Dan U." <[EMAIL PROTECTED]> wrote:
> Maybe it means to go to Window->Preferences, then Android->DDMS and
> change ADB debugger base port.
>
> On Mar 31, 3:18 pm, exticu <[EMAIL PROTECTED]> wrote:
>
> > Whenever I try to start a new project or change Android setting in
> > Eclipse, I get a stream of popup windows saying:
> > "Could not open Selected VM debug port (8700). Make sure you do not
> > have another instance of DDMS or of the eclipse plugin running. If
> > it's being used by something else, choose a new port number in the
> > preferences"
>
> > How can I change the VM debug port? (since 8700 is in use)
>
> > There is a .ddms file in my home directory but it doesn't have an
> > option for which port to use.
>
> > Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: unable to use eclipse plugin

2008-04-01 Thread LE THANH TUNG
I heart that the Eclipse 3.2 doesn't not support programming on mobile
phone, is that right ?

Use 3.3 first !

On Tue, Apr 1, 2008 at 8:51 PM, Percival <[EMAIL PROTECTED]> wrote:

>
> I am new to android and have downloaded the latest SDK and eclipse
> plugin.
>
> I get the following error when i try to create a new android project.
>
>
> The selected project could not be started
>
> Reason:
> Plug-in com.android.ide.eclipse.adt was unable to load class
> com.android.ide.eclipse.adt.project.NewProjectWizard
>
> also when I try to access the android preferences I get the error
>
> Unable to create the selected preference page
>
> Reason:
> Plug-in com.android.ide.eclipse.adt was unable to load class
> com.android.ide.eclipse.adt.preferences.BuildPreferencePage
>
> I am currently on eclipse 3.2
>
> >
>


-- 
Many thanks and regards
LÊ THANH TÙNG
Da Nang, Vietnam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Access other variable from other class in the same package !

2008-04-01 Thread LE THANH TUNG
Dear Pepel !
>
> I am even beginner in Java and thank you very much. I get well your
> instruction. I still need your help, please see :
>
> In Cau_1, I set instance like this :
> ...
> char Cau_1_Answer;
>
>
> protected char getCau_1_Answer() {
> return Cau_1_Answer;
> }
> protected void setCau_1_Answer(char cau_1_Answer) {
> Cau_1_Answer = cau_1_Answer;
> }
> 
>
> In the class that access :
>
> char[] AnswerList = new char[10];
> ...// (1)
>  protected void onCreate(Bundle icicle)
> {
> super.onCreate(icicle);
> setContentView(R.layout.result_grammar);
> AnswerList[0] = Cau_1_grammar.getCau_1_Answer(); // AnswerList[0]
> assignment
> ...
>
> The error is Cannot make a static reference to the non-static method
> getCau_1_Answer() from the type  Cau_1_grammar
>
> If I place AnswerList[0] assignment at (1) , the error is Syntax error on
> token ";", { expected after this token after the array initialization.
>
> How can I fix it ?
>
> On Tue, Apr 1, 2008 at 9:06 PM, Pepel <[EMAIL PROTECTED]> wrote:
>
> >
> > and in order to access them using an instance of each of the Cau_1...
> > Cau_10 classes, the variables have to be public (or access them using a
> > public method)
> >
> >   regards.
> >
> > P.D. This is more a java question than an android question
> >
> >
> > On 4/1/08, Pepel <[EMAIL PROTECTED]> wrote:
> > >
> > > The class that wants to access the  variables from the other class can
> > > only access them through an instance of the class! (or if the class 
> > > Inherit
> > > from the Cau_1.. Cau_10 classes)
> > >
> > >   regards,
> > >
> > >
> > > On 4/1/08, LE THANH TUNG <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Hi !
> > > >
> > > > I have 10 classes :
> > > >
> > > > Cau_1.java containing variable char Cau_1_Answer
> > > > Cau_2.java containing variable char Cau_2_Answer
> > > > 
> > > > Cau_10.java containing variable char Cau_10_Answer
> > > >
> > > > and another class with char[] AnswerList = char[]{Cau_1_Answer,
> > > > Cau_2_Answer,...,Cau_10_Answer}
> > > >
> > > > Why does the class with AnswerList get error *can not resolve* 
> > > > *Cau_1_Answer,
> > > > can not resolve Cau_2_Answer..*.?
> > > >
> > > > I keep all the default modifier because they are in the same
> > > > package. Even I change in public, it doesn't work either ?
> > > >
> > > > What I did wrong and how to resolve ? Thanks for help !
> > > >
> > > > --
> > > > Many thanks and regards
> > > > LÊ THANH TÙNG
> > > > Da Nang, Vietnam
> > > >
> > > > > > > >
> > > >
>
>
> --
> Many thanks and regards
> LÊ THANH TÙNG
> Da Nang, Vietnam




-- 
Many thanks and regards
LÊ THANH TÙNG
Da Nang, Vietnam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Access other variable from other class in the same package !

2008-04-01 Thread LE THANH TUNG
Dear Pepel !

I am even beginner in Java and thank you very much. I get well your
instruction. I still need your help, please see :

In Cau_1, I set instance like this :
...
char Cau_1_Answer;


protected char getCau_1_Answer() {
return Cau_1_Answer;
}
protected void setCau_1_Answer(char cau_1_Answer) {
Cau_1_Answer = cau_1_Answer;
}


In the class that access :

char[] AnswerList = new char[10];
...// (1)
 protected void onCreate(Bundle icicle)
{
super.onCreate(icicle);
setContentView(R.layout.result_grammar);
AnswerList[0] = Cau_1_grammar.getCau_1_Answer; // AnswerList[0]
assignment
...

The error is Cau_1_grammar.getCau_1_Answer cannot be resolved

If I place AnswerList[0] assignment at (1) , the error is Syntax error on
token ";", { expected after this token after the array initialization.

How can I fix it ?

On Tue, Apr 1, 2008 at 9:06 PM, Pepel <[EMAIL PROTECTED]> wrote:

>
> and in order to access them using an instance of each of the Cau_1...
> Cau_10 classes, the variables have to be public (or access them using a
> public method)
>
>   regards.
>
> P.D. This is more a java question than an android question
>
>
> On 4/1/08, Pepel <[EMAIL PROTECTED]> wrote:
> >
> > The class that wants to access the  variables from the other class can
> > only access them through an instance of the class! (or if the class Inherit
> > from the Cau_1.. Cau_10 classes)
> >
> >   regards,
> >
> >
> > On 4/1/08, LE THANH TUNG <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi !
> > >
> > > I have 10 classes :
> > >
> > > Cau_1.java containing variable char Cau_1_Answer
> > > Cau_2.java containing variable char Cau_2_Answer
> > > 
> > > Cau_10.java containing variable char Cau_10_Answer
> > >
> > > and another class with char[] AnswerList = char[]{Cau_1_Answer,
> > > Cau_2_Answer,...,Cau_10_Answer}
> > >
> > > Why does the class with AnswerList get error *can not resolve* 
> > > *Cau_1_Answer,
> > > can not resolve Cau_2_Answer..*.?
> > >
> > > I keep all the default modifier because they are in the same package.
> > > Even I change in public, it doesn't work either ?
> > >
> > > What I did wrong and how to resolve ? Thanks for help !
> > >
> > > --
> > > Many thanks and regards
> > > LÊ THANH TÙNG
> > > Da Nang, Vietnam
> > >
> > > > > >
> > >


-- 
Many thanks and regards
LÊ THANH TÙNG
Da Nang, Vietnam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] How to make rows smaller in ListView?

2008-04-01 Thread Zach

Hey,

I am confused as to why in the ListView screenshot shown below, the
rows are quite small:

http://code.google.com/android/reference/view-gallery.html

Yet when I run the sample project it comes from, List1.java, the rows
are about twice as high:

http://code.google.com/android/samples/ApiDemos/src/com/google/android/samples/view/List1.html

How can I modify it to make it look like the screenshot?

Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Assess other variable from other class in the same package !

2008-04-01 Thread Pepel
and in order to access them using an instance of each of the Cau_1... Cau_10
classes, the variables have to be public (or access them using a public
method)

  regards.

P.D. This is more a java question than an android question

On 4/1/08, Pepel <[EMAIL PROTECTED]> wrote:
>
> The class that wants to access the  variables from the other class can
> only access them through an instance of the class! (or if the class Inherit
> from the Cau_1.. Cau_10 classes)
>
>   regards,
>
>
> On 4/1/08, LE THANH TUNG <[EMAIL PROTECTED]> wrote:
> >
> > Hi !
> >
> > I have 10 classes :
> >
> > Cau_1.java containing variable char Cau_1_Answer
> > Cau_2.java containing variable char Cau_2_Answer
> > 
> > Cau_10.java containing variable char Cau_10_Answer
> >
> > and another class with char[] AnswerList = char[]{Cau_1_Answer,
> > Cau_2_Answer,...,Cau_10_Answer}
> >
> > Why does the class with AnswerList get error *can not resolve* 
> > *Cau_1_Answer,
> > can not resolve Cau_2_Answer..*.?
> >
> > I keep all the default modifier because they are in the same package.
> > Even I change in public, it doesn't work either ?
> >
> > What I did wrong and how to resolve ? Thanks for help !
> >
> > --
> > Many thanks and regards
> > LÊ THANH TÙNG
> > Da Nang, Vietnam
> > > >
> >
>
>
> --
> Pepel




-- 
Pepel

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Assess other variable from other class in the same package !

2008-04-01 Thread Pepel
The class that wants to access the  variables from the other class can only
access them through an instance of the class! (or if the class Inherit from
the Cau_1.. Cau_10 classes)

  regards,


On 4/1/08, LE THANH TUNG <[EMAIL PROTECTED]> wrote:
>
> Hi !
>
> I have 10 classes :
>
> Cau_1.java containing variable char Cau_1_Answer
> Cau_2.java containing variable char Cau_2_Answer
> 
> Cau_10.java containing variable char Cau_10_Answer
>
> and another class with char[] AnswerList = char[]{Cau_1_Answer,
> Cau_2_Answer,...,Cau_10_Answer}
>
> Why does the class with AnswerList get error *can not resolve* *Cau_1_Answer,
> can not resolve Cau_2_Answer..*.?
>
> I keep all the default modifier because they are in the same package. Even
> I change in public, it doesn't work either ?
>
> What I did wrong and how to resolve ? Thanks for help !
>
> --
> Many thanks and regards
> LÊ THANH TÙNG
> Da Nang, Vietnam
> >
>


-- 
Pepel

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] unable to use eclipse plugin

2008-04-01 Thread Percival

I am new to android and have downloaded the latest SDK and eclipse
plugin.

I get the following error when i try to create a new android project.


The selected project could not be started

Reason:
Plug-in com.android.ide.eclipse.adt was unable to load class
com.android.ide.eclipse.adt.project.NewProjectWizard

also when I try to access the android preferences I get the error

Unable to create the selected preference page

Reason:
Plug-in com.android.ide.eclipse.adt was unable to load class
com.android.ide.eclipse.adt.preferences.BuildPreferencePage

I am currently on eclipse 3.2

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to show alerts

2008-04-01 Thread Raul Bocter
never mind that one. it seems to work if I put loop() at the end of the
logic.

I have another related problem now. I want to show two alerts, one after the
other, as the logic advances. But I can not get rid of the first alert.
Calling cancel() or dismiss() or both does not work. How can I loose an
alert programatically ?

regards,
   Raul



On Tue, Apr 1, 2008 at 4:07 PM, Raul Bocter <[EMAIL PROTECTED]> wrote:

>   Hello,
>
>
> I am trying to show alerts while doing some logic in the background. I
> want to do this in a new thread (not the UI thread). I don't understand how
> this should work. As I try to show the alert it throws an exception saying i
> have to call Looper.prepare() first. Ok, I call prepare(). The alert does
> not show until Looper.loop()gets called. But after loop(), the thread is
> stuck there. It will not go further. What would be a solution for this?
>
> regards,
>Raul
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] how to show alerts

2008-04-01 Thread Raul Bocter
  Hello,


I am trying to show alerts while doing some logic in the background. I want
to do this in a new thread (not the UI thread). I don't understand how this
should work. As I try to show the alert it throws an exception saying i have
to call Looper.prepare() first. Ok, I call prepare(). The alert does not
show until Looper.loop()gets called. But after loop(), the thread is stuck
there. It will not go further. What would be a solution for this?

regards,
   Raul

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Need help in debugging null pointer exception

2008-04-01 Thread maaxiim

1. Open the Debug perspective in Eclipse
2. Choose the 'Breakpoints' view tab.
3. Select the 'Add Java Exception Breakpoint' and choose
NullPointerException.
4. Launch your activity, either by using 'Debug As...' or attaching
the debugger to a running instance via DDMS.
5. Execute the offending workflow. It will break on the line that
caused the NPE.


On Apr 1, 12:58 am, Kwang Yi Tan <[EMAIL PROTECTED]> wrote:
> hi,
>
> I went through the notepad tutorial and find that the presentation is
> close a download manager application that i am writing. So I used the
> notepad3 as a skeleton and started putting in my own code. When I
> tried to run it, I got a null pointer exception for my activity. Where
> should I look in eclipse to try to locate the problem? Any help will
> be greatly appreciated.
>
> [2008-04-01 00:42:15 - FileShare] Pushing FileShare.apk to /data/app
> on device 'emulator-tcp-'
> [2008-04-01 00:42:16 - FileShare] Starting activity on device:
> com.asu.android.app.fileshare.fileshare
> [2008-04-01 00:42:21 - FileShare] ActivityManager: Starting: Intent
> { comp={com.asu.android.app.fileshare/
> com.asu.android.app.fileshare.fileshare} }
> [2008-04-01 00:42:21 - FileShare] New package not yet registered with
> the system. Waiting 3 seconds before next attempt.
> [2008-04-01 00:42:21 - FileShare] ActivityManager: Error: Activity
> class {com.asu.android.app.fileshare/
> com.asu.android.app.fileshare.fileshare} does not exist.
> [2008-04-01 00:42:24 - FileShare] Starting activity on device:
> com.asu.android.app.fileshare.fileshare
> [2008-04-01 00:42:28 - FileShare] ActivityManager: DDM dispatch reg
> wait timeout
> [2008-04-01 00:42:28 - FileShare] ActivityManager: Can't dispatch DDM
> chunk 48454c4f: no handler defined
> [2008-04-01 00:42:28 - FileShare] ActivityManager: Starting: Intent
> { comp={com.asu.android.app.fileshare/
> com.asu.android.app.fileshare.fileshare} }
>
> and that there will be a force quit message appearing on the emulator
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Possible to create 2 ListViews side by side?

2008-04-01 Thread Axel M. Garcia

Why to have two listViews?
If I can suggest, I think this way is simpler:
you  can try to do it by creating a component composed by the item +
the button or whatever, and then add the component to the ListView.

I mean:
(ListView)
(Item1 [Add][Text link][TextLink])
(Item2) [Add]...)
..




On Apr 1, 10:16 am, Gazpacho <[EMAIL PROTECTED]> wrote:
> Thanks!  I have a followup question: is there a way to make the second
> list remain aligned with the first list as we scroll down?  I'm trying
> to make the second list comprise of a set of buttons or text links
> that would be associated with each item in the first list?
>
> So like this:
>
> (ListView 1)(ListView 2)
> Item 1  [Add]
> Item 2  [Add]
> Item 3  [Add]
>
> Is this possible with Android?
>
> Thanks again!
>
> On Mar 31, 10:26 pm, "Dan U." <[EMAIL PROTECTED]> wrote:
>
> > The id problem would be that you try to define list2 as being an id
> > provided by android itself (@android:id) but it doesn't exist. It's
> > not something you just make up.
>
> > What I did to make your example work was to change list2 to be
> > android:id="@+id/list2"
> > Then for testing, here's how I set the adapters...
>
> > String[] mStrings = new String[] { "a", "b", "c" };
> > setListAdapter(new ArrayAdapter(this,
> > android.R.layout.simple_list_item_1, 
> > mStrings));
>
> > String[] mStrings2 = new String[] { "d", "e", "f" };
> > ListView secondList = (ListView) findViewById(R.id.list2);
> > secondList.setAdapter(new ArrayAdapter(this,
> > android.R.layout.simple_list_item_1, 
> > mStrings2));
>
> > Note the first setListAdapter is set up to interact with the first
> > ListView in my ListActivity.
>
> > On Mar 31, 10:07 pm, Gazpacho <[EMAIL PROTECTED]> wrote:
>
> > > I'd like to create two columns of ListViews in Android.  Is this
> > > possible?
>
> > > This is giving me errors with the id naming:
>
> > > 
> > > http://schemas.android.com/apk/res/
> > > android"
> > > android:layout_width="fill_parent"
> > > android:layout_height="fill_parent">
>
> > >  > > android:layout_width="100px"
> > > android:layout_height="fill_parent" />
>
> > >  > > android:layout_toRight="@android:id/list"
> > > android:layout_width="100px"
> > > android:layout_height="fill_parent" />
> > > 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Assess other variable from other class in the same package !

2008-04-01 Thread LE THANH TUNG
Hi !

I have 10 classes :

Cau_1.java containing variable char Cau_1_Answer
Cau_2.java containing variable char Cau_2_Answer

Cau_10.java containing variable char Cau_10_Answer

and another class with char[] AnswerList = char[]{Cau_1_Answer,
Cau_2_Answer,...,Cau_10_Answer}

Why does the class with AnswerList get error *can not resolve* *Cau_1_Answer,
can not resolve Cau_2_Answer..*.?

I keep all the default modifier because they are in the same package. Even I
change in public, it doesn't work either ?

What I did wrong and how to resolve ? Thanks for help !

-- 
Many thanks and regards
LÊ THANH TÙNG
Da Nang, Vietnam

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Selecting from a listview...how do I know what I clicked on?

2008-04-01 Thread Salsa bob

I have this Listview with 5 elements in it, and when I select and pick
one of them, I want to change to a different screen, depending on
which item I picked. However, onListItemClick seems to only detect
touchpad clicks, and doesn't do anything if I try to select and pick
an item with the keypad. What's a good method to return the position
of the focus when it clicks down on something? Onkey can only get back
the entire listview, and not the element in it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Possible to create 2 ListViews side by side?

2008-04-01 Thread Gazpacho

Thanks!  I have a followup question: is there a way to make the second
list remain aligned with the first list as we scroll down?  I'm trying
to make the second list comprise of a set of buttons or text links
that would be associated with each item in the first list?

So like this:

(ListView 1)(ListView 2)
Item 1  [Add]
Item 2  [Add]
Item 3  [Add]

Is this possible with Android?

Thanks again!


On Mar 31, 10:26 pm, "Dan U." <[EMAIL PROTECTED]> wrote:
> The id problem would be that you try to define list2 as being an id
> provided by android itself (@android:id) but it doesn't exist. It's
> not something you just make up.
>
> What I did to make your example work was to change list2 to be
> android:id="@+id/list2"
> Then for testing, here's how I set the adapters...
>
>                 String[] mStrings = new String[] { "a", "b", "c" };
>                 setListAdapter(new ArrayAdapter(this,
>                                 android.R.layout.simple_list_item_1, 
> mStrings));
>
>                 String[] mStrings2 = new String[] { "d", "e", "f" };
>                 ListView secondList = (ListView) findViewById(R.id.list2);
>                 secondList.setAdapter(new ArrayAdapter(this,
>                                 android.R.layout.simple_list_item_1, 
> mStrings2));
>
> Note the first setListAdapter is set up to interact with the first
> ListView in my ListActivity.
>
> On Mar 31, 10:07 pm, Gazpacho <[EMAIL PROTECTED]> wrote:
>
> > I'd like to create two columns of ListViews in Android.  Is this
> > possible?
>
> > This is giving me errors with the id naming:
>
> > 
> > http://schemas.android.com/apk/res/
> > android"
> >                                 android:layout_width="fill_parent"
> >                                 android:layout_height="fill_parent">
>
> >          >                                 android:layout_width="100px"
> >                         android:layout_height="fill_parent" />
>
> >          > android:layout_toRight="@android:id/list"
> >                                 android:layout_width="100px"
> >                         android:layout_height="fill_parent" />
> > 
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---