[android-beginners] Re: Emulator is Crashing

2008-12-07 Thread David Turner
Are you talking about the emulator program crashing, or your application ?

if the emulator program is crashing, can you give me the output of "emulator
-debug-all"
what if you try "emulator -audio none" ?

what is your development machine (CPU, memory, PC/Mac), what OS does it run
?

On Sat, Dec 6, 2008 at 8:19 AM, i3onk <[EMAIL PROTECTED]> wrote:

>
> I just ran through the sample Hello, Android project, and every time I
> try to run it the Emulator crashes. I did this with and without the
> suggested changes, each time it crashed.
>
> Any ideas of what is causing this? I searched for related threads but
> nothing posted about this early in the process.
>
>
>
> >
>

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Problem configuring build path

2008-12-07 Thread Aniruddha

Hi.

  I am trying to call one android application from another. Both these
applications are working fine independently. The commands I have given
are:
Intent intent = new Intent();
intent.setClassName(android.sip.simpleclient,
android.sip.simpleclient.SIPclient.class);
startActivity(intent);

  But I am getting the error message stating that
"android.sip.simpleclient can't be resolved". I tried the "Fix project
setup" option but it gave the message "No proposals were found". So,
then I tried to manually configure the build path of the project. But
even after adding the target project folder into the "Required
projects on the build path", the package needed is not being resolved.

  Please give me some advice regarding this. What am I missing?

Thanks and Regards.
Aniruddha.
--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: position UI components

2008-12-07 Thread hc huang
As we know that there is a lot of attributes in XML,How Can I master them in
Android?
Thanks!

On Mon, Dec 8, 2008 at 6:30 AM, Mark Murphy <[EMAIL PROTECTED]> wrote:

>
> jj wrote:
> > is there a way of placing UI components (EditText, Button, etc..) in a
> > specific place of the screen?
> > (apart from the xml code, I want to do this programatically)
>
> You can create widget objects:
>
> Button btn1=new Button(this);
>
> and add them to containers (subclasses of ViewGroup, like LinearLayout).
>
> The add() method on containers usually takes a LayoutParams structure,
> where you can specify the details that, in XML, you might express via
> layout_ attributes (e.g., android:layout_gravity).
>
> You can also inflate a widget, or a tree of widgets, from XML through
> the use of LayoutInflater, allowing you to describe the widgets in XML
> but still control when they get created and how they get used from Java.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.9 Published!
>
> >
>

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to determine the current backgroundResource of an imagebutton

2008-12-07 Thread Mark Murphy

Josh Dobbs wrote:
> Yes. I understand that but i am not sure which property to check.

Property?

ImageButton btn1=new ImageButton(this);

btn1.setImageResource(R.drawable.foo);

If you're asking, using the above example, how to find out later that 
btn1 was set with R.drawable.foo, you can't, AFAIK. Images can come from 
a wide range of sources, only one of which is image resources, and so 
only one of which has an identifier.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to determine the current backgroundResource of an imagebutton

2008-12-07 Thread Josh Dobbs
Yes. I understand that but i am not sure which property to check.

On Sun, Dec 7, 2008 at 5:54 PM, Mark Murphy <[EMAIL PROTECTED]> wrote:

>
> Josh wrote:
> > I have 5 imagebuttons and one click handler for all of them. How can I
> > tell what the name of the current image being displayed on the button
> > is?
>
> The parameter to your onClick() function in your handler is the Button
> that was clicked.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
>
> Android Training on the Ranch! -- Mar 16-20, 2009
> http://www.bignerdranch.com/schedule.shtml
>
> >
>

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: how to determine the current backgroundResource of an imagebutton

2008-12-07 Thread Mark Murphy

Josh wrote:
> I have 5 imagebuttons and one click handler for all of them. How can I
> tell what the name of the current image being displayed on the button
> is?

The parameter to your onClick() function in your handler is the Button 
that was clicked.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] how to determine the current backgroundResource of an imagebutton

2008-12-07 Thread Josh

I have 5 imagebuttons and one click handler for all of them. How can I
tell what the name of the current image being displayed on the button
is?


--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: position UI components

2008-12-07 Thread Mark Murphy

jj wrote:
> is there a way of placing UI components (EditText, Button, etc..) in a
> specific place of the screen?
> (apart from the xml code, I want to do this programatically)

You can create widget objects:

Button btn1=new Button(this);

and add them to containers (subclasses of ViewGroup, like LinearLayout).

The add() method on containers usually takes a LayoutParams structure, 
where you can specify the details that, in XML, you might express via 
layout_ attributes (e.g., android:layout_gravity).

You can also inflate a widget, or a tree of widgets, from XML through 
the use of LayoutInflater, allowing you to describe the widgets in XML 
but still control when they get created and how they get used from Java.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 1.9 Published!

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] position UI components

2008-12-07 Thread jj

Hi
is there a way of placing UI components (EditText, Button, etc..) in a
specific place of the screen?
(apart from the xml code, I want to do this programatically)

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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: dynamic control creation

2008-12-07 Thread Josh Dobbs
Thanks Mark. That clears up everything.

On Sat, Dec 6, 2008 at 8:55 AM, Mark Murphy <[EMAIL PROTECTED]> wrote:

>
> Josh Dobbs wrote:
> > This is what i have
> > that seems to work but i have to create a new listener for each
> > button(currently i only have one as you see below)
> > I couldnt get your method to work. can you tell me what im doing wrong?
>
> 
>
>  > btn1.setOnClickListener(new View.OnClickListener() {
>  > public void onClick(View view) {
>  >
>  > }
>  >
>  > });
>
> Here, you are creating an anonymous inner class (the new
> View.OnClickListener() stuff). That's fine, but if you want to use the
> same anonymous inner class instance, you'll need to hang onto it.
>
> One approach for this is to assign it to a member variable in the outer
> class:
>
> View.OnClickListener hitMe=new View.OnClickListener() {
> public void onClick(View view) {
>// something
>}
> };
>
> Then, you can use that same listener object for each of your buttons:
>
> btn1.setOnClickListener(hitMe);
> btn2.setOnClickListener(hitMe);
>
> Another approach is to make the inner class not anonymous, making it a
> named inner class:
>
> public class PegLites extends Activity {
> // other stuff here
>
>class ButtonListener implements View.OnClickListener {
> public void onClick(View view) {
> // something
>}
>}
> }
>
> Then, you can create new listener objects per button, but they would
> share the same implementation of onClick():
>
> btn1.setOnClickListener(new ButtonListener());
> btn2.setOnClickListener(new ButtonListener());
>
> For a pure listener implementing an interface, as in this case, either
> approach should work and be safe, since the listener holds no state. If
> there is a chance the listener will hold some state, though, you are
> better served going with the named inner class approach, so each button
> can have its own listener with its own state.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.9 Published!
>
> >
>

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: button names - where are they stored?

2008-12-07 Thread Josh Dobbs
Thanks. That clears it up. I just assumed that it was a variable name stored
somewhere...the @ threw me off.



On Sat, Dec 6, 2008 at 11:17 PM, Peter <[EMAIL PROTECTED]> wrote:

>
> Well I'm not sure what you mean by where are they stored, they are
> stored in R.layout.main / the main.xml file. And no you can name them
> what ever you would like in the format android:id="@+id/namegoeshere"
>
> On Dec 5, 9:29 am, Josh <[EMAIL PROTECTED]> wrote:
> > I notice in all of the code examples that when a widget has an id it
> > is usually something like android:id="@+id/widget28"
> >
> > Which im assuming is just a variable that is stored somewhere. Where
> > are they stored? Also is that the only way to name widgets? In just
> > about every other language i have used you can usually do something
> > like id="mywidget"
> >
> > thanks,
> >
> > Josh
> >
>

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Mobile phones that support android application

2008-12-07 Thread Jean-Baptiste Queru

At this point the only two commercially available options are the
T-Mobile G1 (sold in the US and in the UK), and the Android Dev Phone
1 (sold in 18 countries).

There are also some efforts to port Android to several other devices,
most notably the OpenMoko FreeRunner and the Nokia N810 tablet, but
those don't quite seem to have the same polish as the options I
mentioned above and might not be ideal development devices if you'd
like to see how your app behaves on shipping devices.

Android being Open-Source with a very unrestrictive license, any
manufacturer can download the source and port it to their hardware (or
develop hardware around it) without telling anyone, so it's not really
possible to have an exhaustive list at any point in time.

JBQ

On Sun, Dec 7, 2008 at 8:28 AM, weird0 <[EMAIL PROTECTED]> wrote:
>
> I wish to work on Android.
>
> I want to know the set, companies or the set of mobile phones that
> support running of Android mobile applications.
>
> What are the cheapest mobile phones that will support my android
> application? Any cheap sets from LG or Nokia.
>
> How will I port the application into my mobile after having it
> developed?
>
> Regards,
> Android Newbie
>
> >
>

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Creating a custom widget

2008-12-07 Thread Rajeev

Hi,

I am fairly new to android. I am trying to create a custom widget
which can display an image and two TextViews. I want to create the
layout for my custom widget in xml, but don't know how to use the xml.

I want to create a custom widget using xml file. I know how to set the
xml file as the main screen for an activity but don't know how to use
xml file to create a layout of a custom widget.

Any help is appreciated.

Rajeev

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] ADB command not found

2008-12-07 Thread dragonrider8844

I have installed the sdk and put the sdk tools in my directory and i
still get the command not found. i am using the ubuntu linux

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] IBM Rational & ADT Plugin :- Cannot find apk file

2008-12-07 Thread newbie100

Hi,

I have successfully installed the ADT in Eclipse Gannymead, w/sdk ver
1.0 and all was well.

I then installed the ADT on another machine running IBM Rational App
Developer 7.5 which is based on
Eclipse 3.x.

The install is ok, but when I try and run my app from within eclipse,
I get an error saying ".apk"
file not found. The file is however present in the project directory.

Other posts seem to suggest that this is an issue with using a non-Sun
JDK/JRE / keytool related.

Changing the IDE to use a Sun JDK did not seem to solve the problem..
But then I am not sure to what extent the
SDK change in the IDE has on plugins etc...

Has anyone else faced this problem and overcome it ?

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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Emulator is Crashing

2008-12-07 Thread i3onk

I just ran through the sample Hello, Android project, and every time I
try to run it the Emulator crashes. I did this with and without the
suggested changes, each time it crashed.

Any ideas of what is causing this? I searched for related threads but
nothing posted about this early in the process.



--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] of databases and content providers

2008-12-07 Thread jetaber

I am trying to follow the NotePad example in order to build a utility
which will retrieve the geolocation of the phone, convert the location
to other useful formats, and then store the location data in a db
table so that other apps can use the different location formats.  I am
unable to figure out the content provider portion of my code.  I
looked at notepad and some other examples and I cannot figure out
where I am going wrong.  I am getting an error in my lag that states:
"Bad element under manifest ."  Here is the code from
the .xml:




However, Eclipse does not show any error in the syntax of the element.

I placed a log out statement in the OnCreate() method in the Provider
class that I wrote and that never gets printed.  I assume that this is
at the heart of my later "failed to find provider" error since if the
Provider never fires, then it would not be available.  Of course I
could be completely wrong and at this point I would not be surprised.

v/r

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Accessing Vibrate from a child Activity?

2008-12-07 Thread Croccy22

Hi all,

This is going to be very simple but I'm still trying to get the hand
of how classes and Activities etc tie together in java.

I am using the Lunar Lander code as a base for a simple application.
It has the main class and a gameview class to handle all the drawing
etc.

I have looked in the SDK for code to vibrate the phone and I found
this:

Java:
Vibrator vibrator = (Vibrator)getSystemService
(Context.VIBRATOR_SERVICE);
vibrator.vibrate(500);


If I put that code in the OnCreate within the main class it works
fine.

However, if I put this same code in the gameview class the
getSystemService highlights as an error with the following message:

The method getSystemService(String) is undefined for the type
GameView.GameThread

I have had this same error with a couple of things I have tried to
play with. How do I use the the getSystemService from the GameView
Class?

Thanks in advance.

Matt.

PS. If i'm being really stupid and this is very simple, please help
anyway preferably with an explanation, I don't mind being made to look
stupid as long as I can get it working! Razz

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Mobile phones that support android application

2008-12-07 Thread weird0

I wish to work on Android.

I want to know the set, companies or the set of mobile phones that
support running of Android mobile applications.

What are the cheapest mobile phones that will support my android
application? Any cheap sets from LG or Nokia.

How will I port the application into my mobile after having it
developed?

Regards,
Android Newbie

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: button names - where are they stored?

2008-12-07 Thread Paul Mach
Try

Button yourButton = (Button) findViewById(R.id.widget28);

On Fri, Dec 5, 2008 at 9:29 AM, Josh <[EMAIL PROTECTED]> wrote:

>
> I notice in all of the code examples that when a widget has an id it
> is usually something like android:id="@+id/widget28"
>
> Which im assuming is just a variable that is stored somewhere. Where
> are they stored? Also is that the only way to name widgets? In just
> about every other language i have used you can usually do something
> like id="mywidget"
>
> thanks,
>
> Josh
>
> >
>

--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] wifi and GPS only

2008-12-07 Thread David Duong

Hello everyone,

I noticed that the development handsets (unlocked SIM & hardware) are 
available on Google.  One question I would like to ask is if I'm able to 
use the handset without a SIM?  I would only like to use the GPS + Wifi 
on the device as I don't want to get tied into a cellphone plan.  I'm 
also planning to develop on the phone too.

Thanks,

--
David Duong



--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Sqlite connection coding

2008-12-07 Thread moazzamk

Here's an article which teaches you how to do it .

http://moazzam-khan.com/blog/?cat=26

- Moazzam

On Dec 6, 8:19 am, Mark Murphy <[EMAIL PROTECTED]> wrote:
> habi wrote:
> > hi i created one databse in Sqlitethe databse is stored in raw
> > folder.now how to write the connection coding
>
> You can't, AFAIK. Databases cannot be used if they are packaged in the APK.
>
> A pattern that I have used, and will eventually need to blog about, is:
>
> 1. Create a SQLite database in my project, but not in res/raw/ or any
> place where it would get packaged up (e.g., create a db/ folder)
>
> 2. Use the console sqlite3 utility to dump the contents (schema + data)
> of the various tables into SQL scripts in res/raw/ -- you can integrate
> this into Ant if you so choose
>
> 3. In your SQLiteOpenHelper, rather than hard-code the SQL statements to
> create and populate your database, open each of your SQL scripts in
> res/raw/ and execute the statements contained in them
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.9 Available!
--~--~-~--~~~---~--~~
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]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---