[android-beginners] Re: hot to view page source?

2009-09-08 Thread Justin Anderson
The view-source: option is a feature that is part of the program (browser)
that you happen to be using...  it is not part of a standard protocol or
anything.

It sounds like that feature is not programmed into the browser and treats
that command as any other url...

On Sep 7, 2009 9:55 PM, mmkr manutd...@gmail.com wrote:


Hai,

In browsers when I type view-source: before any address it gives me
the page source. But i am not able to do it in android. It gives me
web page not available . Can any one please tell me why it is giving
that and any other way for me to view the page source in android?

  One more doubt is what exactly is @hide, even if I commented
it( /** @hide */) it is having some meaning( it is not visible in
another classes ). When I deleted it its working fine, it is visible.
what is the reason?

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



[android-beginners] Sample mobile application query

2009-09-08 Thread Sudeep Jha
Hi,
Can you please tell me about the security management in mobile
banking application?
-- 
Warm Regards,
Sudeep

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



[android-beginners] Re: hot to view page source?

2009-09-08 Thread murali raju
In my application i need to parse through the html file, to get the URLs.
so Is there any other way I can view the page source? or any other approach?

On Tue, Sep 8, 2009 at 11:39 AM, Justin Anderson janderson@gmail.comwrote:

 The view-source: option is a feature that is part of the program (browser)
 that you happen to be using...  it is not part of a standard protocol or
 anything.

 It sounds like that feature is not programmed into the browser and treats
 that command as any other url...

 On Sep 7, 2009 9:55 PM, mmkr manutd...@gmail.com wrote:


 Hai,

 In browsers when I type view-source: before any address it gives me
 the page source. But i am not able to do it in android. It gives me
 web page not available . Can any one please tell me why it is giving
 that and any other way for me to view the page source in android?

   One more doubt is what exactly is @hide, even if I commented
 it( /** @hide */) it is having some meaning( it is not visible in
 another classes ). When I deleted it its working fine, it is visible.
 what is the reason?

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



[android-beginners] Help Develop Widget

2009-09-08 Thread mist3r0

Hello guys, I'm an android beginner developer.

I'm developing an application for Android, and I asked ... a widget
and an application are programmed the sam way?

I'd like to develop a widget that puts an image on your desktop, when
I touch the image, the keyboard should be visible on the display, to
digit the text.

 I need 2 information:


1) What Object I call if I want to see the keyboard on display?


2) What Object I call to capture the events of the display?


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



[android-beginners] a problem about listview

2009-09-08 Thread whitech

Hi all~
I've met this problem: while scrolling, the background of a listview
change to black but not the background color which I'd define. How can
I let the background color not change when scrolling?
--~--~-~--~~~---~--~~
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
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: hot to view page source?

2009-09-08 Thread Alok Kulkarni
I have the following code written in java (J2SE)
It reads the source of the webpage .Convert it to that req by Android. Maybe
u can directly use it.


URL url = new URL(stringURL);

HttpURLConnection httpConnection =
(HttpURLConnection)url.openConnection();
httpConnection.setRequestMethod(GET);
httpConnection.connect();
InputStream inputStream = httpConnection.getInputStream();
StringBuffer htmlString = new StringBuffer();
int ch;
do {
ch = inputStream.read();
htmlString.append((char)ch);
}while(ch != -1);
String toParse = htmlString.toString();
Thanks,
Alok.

On Tue, Sep 8, 2009 at 11:47 AM, murali raju manutd...@gmail.com wrote:

 In my application i need to parse through the html file, to get the URLs.
 so Is there any other way I can view the page source? or any other
 approach?


 On Tue, Sep 8, 2009 at 11:39 AM, Justin Anderson 
 janderson@gmail.comwrote:

 The view-source: option is a feature that is part of the program (browser)
 that you happen to be using...  it is not part of a standard protocol or
 anything.

 It sounds like that feature is not programmed into the browser and treats
 that command as any other url...

 On Sep 7, 2009 9:55 PM, mmkr manutd...@gmail.com wrote:


 Hai,

 In browsers when I type view-source: before any address it gives me
 the page source. But i am not able to do it in android. It gives me
 web page not available . Can any one please tell me why it is giving
 that and any other way for me to view the page source in android?

   One more doubt is what exactly is @hide, even if I commented
 it( /** @hide */) it is having some meaning( it is not visible in
 another classes ). When I deleted it its working fine, it is visible.
 what is the reason?

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



[android-beginners] Re: hot to view page source?

2009-09-08 Thread Alok Kulkarni
See this
http://senior.ceng.metu.edu.tr/2009/praeda/2009/01/11/a-simple-restful-client-at-android/

On Tue, Sep 8, 2009 at 1:47 PM, Alok Kulkarni kulsu...@gmail.com wrote:

 I have the following code written in java (J2SE)
 It reads the source of the webpage .Convert it to that req by Android.
 Maybe u can directly use it.


 URL url = new URL(stringURL);

 HttpURLConnection httpConnection =
 (HttpURLConnection)url.openConnection();
 httpConnection.setRequestMethod(GET);
 httpConnection.connect();
 InputStream inputStream = httpConnection.getInputStream();
 StringBuffer htmlString = new StringBuffer();
 int ch;
 do {
 ch = inputStream.read();
 htmlString.append((char)ch);
 }while(ch != -1);
 String toParse = htmlString.toString();
 Thanks,
 Alok.


 On Tue, Sep 8, 2009 at 11:47 AM, murali raju manutd...@gmail.com wrote:

 In my application i need to parse through the html file, to get the URLs.
 so Is there any other way I can view the page source? or any other
 approach?


 On Tue, Sep 8, 2009 at 11:39 AM, Justin Anderson janderson@gmail.com
  wrote:

 The view-source: option is a feature that is part of the program
 (browser) that you happen to be using...  it is not part of a standard
 protocol or anything.

 It sounds like that feature is not programmed into the browser and treats
 that command as any other url...

 On Sep 7, 2009 9:55 PM, mmkr manutd...@gmail.com wrote:


 Hai,

 In browsers when I type view-source: before any address it gives me
 the page source. But i am not able to do it in android. It gives me
 web page not available . Can any one please tell me why it is giving
 that and any other way for me to view the page source in android?

   One more doubt is what exactly is @hide, even if I commented
 it( /** @hide */) it is having some meaning( it is not visible in
 another classes ). When I deleted it its working fine, it is visible.
 what is the reason?

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



[android-beginners] Re: hot to view page source?

2009-09-08 Thread murali raju
Thanks a lot.

On Tue, Sep 8, 2009 at 1:48 PM, Alok Kulkarni kulsu...@gmail.com wrote:

 See this

 http://senior.ceng.metu.edu.tr/2009/praeda/2009/01/11/a-simple-restful-client-at-android/


 On Tue, Sep 8, 2009 at 1:47 PM, Alok Kulkarni kulsu...@gmail.com wrote:

 I have the following code written in java (J2SE)
 It reads the source of the webpage .Convert it to that req by Android.
 Maybe u can directly use it.


 URL url = new URL(stringURL);

 HttpURLConnection httpConnection =
 (HttpURLConnection)url.openConnection();
 httpConnection.setRequestMethod(GET);
 httpConnection.connect();
 InputStream inputStream = httpConnection.getInputStream();
 StringBuffer htmlString = new StringBuffer();
 int ch;
 do {
 ch = inputStream.read();
 htmlString.append((char)ch);
 }while(ch != -1);
 String toParse = htmlString.toString();
 Thanks,
 Alok.


 On Tue, Sep 8, 2009 at 11:47 AM, murali raju manutd...@gmail.com wrote:

 In my application i need to parse through the html file, to get the
 URLs.
 so Is there any other way I can view the page source? or any other
 approach?


 On Tue, Sep 8, 2009 at 11:39 AM, Justin Anderson 
 janderson@gmail.com wrote:

 The view-source: option is a feature that is part of the program
 (browser) that you happen to be using...  it is not part of a standard
 protocol or anything.

 It sounds like that feature is not programmed into the browser and
 treats that command as any other url...

 On Sep 7, 2009 9:55 PM, mmkr manutd...@gmail.com wrote:


 Hai,

 In browsers when I type view-source: before any address it gives me
 the page source. But i am not able to do it in android. It gives me
 web page not available . Can any one please tell me why it is giving
 that and any other way for me to view the page source in android?

   One more doubt is what exactly is @hide, even if I commented
 it( /** @hide */) it is having some meaning( it is not visible in
 another classes ). When I deleted it its working fine, it is visible.
 what is the reason?

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



[android-beginners] Send JSON object via HttpPost method

2009-09-08 Thread Alok

I have created a JSON object which i want to send over the network to
a server.Do i need to user OutputStream and BufferedOutput stream ?
I have read the RestClient example which parses an incoming JSON
object and retrieves the string data. But how do i send a JSON object
to the server?
Thanks,
Alok
--~--~-~--~~~---~--~~
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
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to send email?

2009-09-08 Thread htbest2000

but the code:
  startActivity(Intent.createChooser(email_intent, Send mail...));
just popup a chooser(to choose via email or sms), not email composer.
How to popup email composer immediately?

On Aug 28, 9:48 pm, Liviu Ungureanu smartli...@gmail.com wrote:
 2009/8/28 Desu Vinod Kumar vinny.s...@gmail.com



  U can find the source in email client example..

  On Fri, Aug 28, 2009 at 5:24 PM, kapil.k kapnk...@gmail.com wrote:

  Is there any sample code about how to send email in android?i want to
  design email application for fix address by modifying it.

  --
  Regards
  ---
  Desu Vinod Kumar
  vinny.s...@gmail.com
  09176147148

   Hi!

 Here you have an example..

 final Intent email_intent =  new Intent(android.content.Intent.ACTION_SEND);
  email_intent.setType(plain/text);
 email_intent.putExtra(android.content.Intent.EXTRA_EMAIL, new
 String[]{item.getEMail()});
 email_intent.putExtra(android.content.Intent.EXTRA_SUBJECT, Subject);
 email_intent.putExtra(android.content.Intent.EXTRA_TEXT,  );
  ShowItemDetailsActivity.this.startActivity(Intent.createChooser(email_intent,
 Send mail...));
--~--~-~--~~~---~--~~
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
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Publish an ADC2 application

2009-09-08 Thread jaaaelpumuki

HI,
I'm trying to publish my ADC2 application in the normal market, but it
throws me this message:
You have another application on Market with the same package name. Go
to that other application, and click upgrade.

So, how do i have to do?

Please...
On 6 sep, 10:46, jaaaelpumuki jaaaelpum...@gmail.com wrote:
 I published an app in the ADC2, can I publish it in the normal
 market?
 do I have to do any change?
--~--~-~--~~~---~--~~
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
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Android market application on emulator

2009-09-08 Thread murali raju
see this,
http://android-developers.blogspot.com/2008/08/android-market-user-driven-content.html

On Mon, Sep 7, 2009 at 2:25 PM, amit singh amitsing...@gmail.com wrote:


 Any info guys? Any pointer on where to look?

 On Sep 4, 1:33 pm, amit singh amitsing...@gmail.com wrote:
  How do I get theAndroidmarketapplicationonemulator? I dont have
  the actual device.
 
  I searched forums - but no one seems to have discussed this.
 
  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
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] How Can I Block Unwanted Calls.

2009-09-08 Thread Ajaz Ahmed
Hi,


Can any one tell me how i can block unwanted calls through my application?
Any URL or sample code for this ?

Thanks,

Regards!

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



[android-beginners] Re: Publish an ADC2 application

2009-09-08 Thread jaaaelpumuki

HI,
I'm trying to publish my ADC2 application in the normal market, but it
throws me this message:
You have another application on Market with the same package name. Go
to that other application, and click upgrade.

So, how do i have to do?

Please...
On 6 sep, 10:46, jaaaelpumuki jaaaelpum...@gmail.com wrote:
 I published an app in the ADC2, can I publish it in the normal
 market?
 do I have to do any change?
--~--~-~--~~~---~--~~
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
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Publish an ADC2 application

2009-09-08 Thread Marc Lester Tan
refactor your app to use a different package name as well as different
title.

On Tue, Sep 8, 2009 at 6:37 PM, jaaaelpumuki jaaaelpum...@gmail.com wrote:


 HI,
 I'm trying to publish my ADC2 application in the normal market, but it
 throws me this message:
 You have another application on Market with the same package name. Go
 to that other application, and click upgrade.

 So, how do i have to do?

 Please...
 On 6 sep, 10:46, jaaaelpumuki jaaaelpum...@gmail.com wrote:
  I published an app in the ADC2, can I publish it in the normal
  market?
  do I have to do any change?
 


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



[android-beginners] Re: How Can I Block Unwanted Calls.

2009-09-08 Thread Mark Murphy

 Can any one tell me how i can block unwanted calls through my application?

There is no officially supported way to do this.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-beginners] Re: android media Apps

2009-09-08 Thread Kacper86

have you set Android SDK 1.5 in Eclipse?

On Aug 20, 1:53 pm, nitin ni...@infocratsweb.com wrote:
 hello,

 I could not see Window/Android AVD Manager in Eclipse. I also tried to
 see it after running the application in emulator, how can I see it?
 could you please help?

 On Jul 23, 5:01 pm, Kacper86 cpph...@gmail.com wrote:

  In Eclipse click Window/Android AVD Manager. There you can create a
  new instance of emulator. If you want it to have a virtual SD Card
  then fill in the field SDCard (e.g. you can fill it with 64M).

  I'm not sure if you can add a new card to an existing emulator.

  On Jul 23, 10:42 am, atharva chauthaiwale atharva.c...@gmail.com
  wrote:

   Hi friends,
                   I m trying to play a .mp3 file using MediaPlayer class on
   android emulator . I referred code from ApiDemos. It says that media file
   should be present on SD card. How do I emulate SD card on emulator? When I
   tried to run default media player application it says SD card not 
   installed.
   Same error message I get while tryign to use camera. Thanks in advance for
   help :)

   Regards,
   Atharva


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



[android-beginners] Re: How to Call Browser Activity

2009-09-08 Thread Smelly Eddie

Thanks much all!

so I wasn't *too* far off :)  I appreciate the guidance.

-Eddie

On Sep 7, 10:07 am, Andrei Bucur andrei.bu...@gmail.com wrote:
 Intent i = new Intent();

 i.setAction(Intent.ACTION_VIEW);
 i.addCategory(Intent.CATEGORY_BROWSABLE);
 i.setData(Uri.parse(http://...;));
 startActivity(i);

 On Mon, Sep 7, 2009 at 4:51 PM, Smelly Eddie ollit...@gmail.com wrote:

  I am reading through the SDK on Android .com and I am having trouble
  just finding an example using an intent to invoke a browser activity.

  I want to send the user to a specific URL.

  String authUrl = http://domain.com/login;;

             // bring the user to authUrl, e.g. open a web browser and
  note the PIN code
             // ...
                 Intent webLogin = new Intent(this,NetApi.class);
                 startActivityForResult(webLogin,ACTION_VIEW);

  But I know this isnt even close, shoudl I use a browser view instead?
--~--~-~--~~~---~--~~
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
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Send JSON object via HttpPost method

2009-09-08 Thread Alok Kulkarni
Any answers ??

On Tue, Sep 8, 2009 at 2:00 PM, Alok kulsu...@gmail.com wrote:


 I have created a JSON object which i want to send over the network to
 a server.Do i need to user OutputStream and BufferedOutput stream ?
 I have read the RestClient example which parses an incoming JSON
 object and retrieves the string data. But how do i send a JSON object
 to the server?
 Thanks,
 Alok
 


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



[android-beginners] Re: OpenGL ES application on WebView

2009-09-08 Thread Maxood

I don't know either. Like to explore it. Although i have downloaded
DroidDraw to design UI for android.
I wonder if you are aware of it. If not then check http://www.droiddraw.org/

Can you tell me more about drawing Canvas through onDraw method?

Thanks,
Maxood

On Sep 7, 12:30 am, javame_android su...@saltriver.com wrote:
 Hi,

 I have not been successful yet. But I am looking forward to use onDraw
 (Canvas canvas) method for drawing purpose. Do you know can we use
 Canvas to make Opengl ES drawing?

 Any help would be appreciated.

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



[android-beginners] listview orientation

2009-09-08 Thread manigault

How to orient listview items horizontal. 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
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: listview orientation

2009-09-08 Thread Mark Murphy

 How to orient listview items horizontal.

ListView does not work horizontally. You may be able to use
HorizontalScrollView with something else (e.g., a horizontal LinearLayout)
and some extra code to achieve a similar look.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-beginners] Voice 2 text help

2009-09-08 Thread Abhi

Hi guys,

I have been trying to develop an app around the voice recognition
functionality of Cupcake. As a sample code, I used the
VoiceRecognition.java project available under API Demos. (http://
developer.android.com/guide/samples/ApiDemos/src/com/example/android/
apis/app/VoiceRecognition.html)


I want to know if I can extract the text result on the list view and
use it as a String further on? The part of code I am refering to is
below where mList is defined as ListView:


ArrayListString matches = data.getStringArrayListExtra
(RecognizerIntent.EXTRA_RESULTS);
mList.setAdapter(new ArrayAdapterString(this,
android.R.layout.simple_list_item_1, matches));


I want to use the result to be able to take further action.


Thanks,


Abhi



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



[android-beginners] directions intent?

2009-09-08 Thread Jeffrey Blattman




i'm fairly certain the answer to this is no, but i was wondering if
there's an intent to open up the google maps "get directions" activity.
that sure would be useful. something like,

geo:lat,long?dest=lat,long

-- 





[android-beginners] Re: GPS Programming...

2009-09-08 Thread Xster

The example shows only gets the last known location. I need to write a
program that actively tracks the user (it's supposed to keep up with a
car). The GPS works fine in Google Maps

On Sep 8, 1:35 pm, Xster x...@xiao-yu.com wrote:
 Hi,

 The permissions and the settings are correct. I think it crashes if it
 isn't.

 I changed my function a bit such that the update request has a minimum
 delay of 10 seconds and 10 meters. But I still get no updates. I can
 get the last known location from the location manager so I figured
 that works. Just the LocationListener's methods never gets called
 somehow...

 On Sep 7, 10:44 am, The Bear bernard.mcca...@googlemail.com wrote:



  Make sure you add the line
  permission android:name=android.permission.ACCESS_FINE_LOCATION/
  uses-permission
  to your AndroidManifest.xml file and you have enabled GPS satellites
  on your handset (won't work otherwise).

  Then try this:

  public class GPSTest extends Activity {
          private TextView text;
      private LocationManager manager;
      private LocationListener listener;

      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);

          text = (TextView)findViewById(R.id.Text);

          manager = (LocationManager) getSystemService
  (Context.LOCATION_SERVICE);
          Location myLocation = manager.getLastKnownLocation(gps);

          text.setText((Lat:  + myLocation.getLatitude()
                          + \nLLong:  + myLocation.getLongitude()));

          listener = new MyLocationListener();
          manager.requestLocationUpdates(gps ,1L, 10.0f,
  listener);
      }

      private class MyLocationListener implements LocationListener{

          public void onLocationChanged(Location location) {
                  // TODO Auto-generated method stub
                  if (location != null){
                          text.setText((Lat:  + location.getLatitude()
                                  + \nLLong:  + location.getLongitude()));
                  }
          }

          public void onProviderDisabled(String provider) {
                  // TODO Auto-generated method stub
          }

          public void onProviderEnabled(String provider) {
                  // TODO Auto-generated method stub
          }

          public void onStatusChanged(String provider, int status,
  Bundle extras) {
                  // TODO Auto-generated method stub
          }
      }

  }

  On Sep 4, 8:49 am, Xster x...@xiao-yu.com wrote:

   Hi,

   I'm trying to start a GPS program and I'm just trying out the first
   step to display coordinates as they change.

   I followedhttp://www.devx.com/wireless/Article/39239andusedthe
   LocationManager and LocationListener classes.

   Code:
   public class GPSTest extends Activity {
       /** Called when the activity is first created. */

           private TextView text;
           private LocationManager manager;
           private LocationListener listener;

       @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.main);

           text = (TextView) findViewById(R.id.Text);

           manager = (LocationManager) getSystemService
   (Context.LOCATION_SERVICE);
           listener = new MyLocationListener();
           manager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
   0, 0, listener);
       }

       private class MyLocationListener implements LocationListener{

                   public void onLocationChanged(Location location) {
                           // TODO Auto-generated method stub
                           if (location != null){
                                   text.setText(text.getText() + \n + 
   location.getLatitude() + , 
   + location.getLongitude() +  -  + location.getAccuracy());
                           }
                   }

                   public void onProviderDisabled(String provider) {
                           // TODO Auto-generated method stub

                   }

                   public void onProviderEnabled(String provider) {
                           // TODO Auto-generated method stub

                   }

                   public void onStatusChanged(String provider, int status, 
   Bundle
   extras) {
                           // TODO Auto-generated method stub

                   }

       }

   }

   However, once I run the code on the phone, the GPS icon is seen
   flashing but nothing happens. The method onLocationChanged is never
   reached (according to breakpoints). What am I doing wrong?
--~--~-~--~~~---~--~~
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, 

[android-beginners] Re: how to download an image?

2009-09-08 Thread I82Much

http://asantoso.wordpress.com/2008/03/07/download-and-view-image-from-the-web/

On Sep 5, 2:56 am, mmkr manutd...@gmail.com wrote:
 Hai,

 I'm developing an application where i need to auto download an image
 (any random image, preferred if first image of the first page) from
 google image search(the search name will be given) directly on to my
 avd card.

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



[android-beginners] Help Needed : MediaRecorder error: java.io.IOException: prepare failed

2009-09-08 Thread preetam_pict

Hi all

I am trying to write a sample program to record the video (say
camcorder application).
When i run my program using the emulator (I have android-sdk-
windows-1.5_r3) I see java.io.IOException: prepare failed. error in
logcat output.

Further I can see that I have came across this error when i call
MediaRecorder.prepare()
from CamcorderActivity.surfaceCreated()
But I am surprised to see that activity got launched and I am seeing
the camera preview!  Again the preview is seen only in half of the
screen! Its weird!!!

Further when i do recorder.start() to record the video I get
java.lang.IllegalStateException. Yes this is obvious since the prepare
() has failed.
But the question is why prepare() has failed ?

Can someone please help me to understand whats happening here!
Am i missing something ???

thanks in advance
~pp

Here is my code ...
package com.example;

import java.io.IOException;

import android.app.Activity;
import android.graphics.PixelFormat;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class CamcorderActivity extends Activity implements
   SurfaceHolder.Callback
{
   private MediaRecorder recorder;
   private SurfaceView   surfaceView;
   private SurfaceHolder surfaceHolder;

   private boolean   recording = false;

   /** Called when the activity is first created. */
   @Override
   public void onCreate(Bundle savedInstanceState)
   {
   super.onCreate(savedInstanceState);

   // configure the surface
   getWindow().setFormat(PixelFormat.TRANSLUCENT);
   setContentView(R.layout.main);
   surfaceView = (SurfaceView) findViewById
(R.id.camcordersurface);
   surfaceHolder = surfaceView.getHolder();
   surfaceHolder.addCallback(this);
   surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
   configureRecorder();
   }

   private void configureRecorder()
   {
   // configure media recorder
   recorder = new MediaRecorder();
   recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
   recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
   recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
   recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
   recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
   }

   private void stopRecorder()
   {
   try
   {
   if (recorder == null)
   {
   return;
   }
   recorder.stop();
   recorder.reset();
   recorder.release();
   recording = false;
   recorder = null;
   }
   finally
   {
   if (recorder != null)
   {
   recorder.release();
   }
   }
   }

   private void startRecorder()
   {
   recorder.start();
   recording = true;
   }

   @Override
   public boolean onKeyDown(int keyCode, KeyEvent event)
   {
   if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER)
   {
   // if not recording then start
   if (!recording)
   {
   startRecorder();
   }
   else
   {
   // if already recording then stop
   stopRecorder();
   finish();
   }
   return true;
   }
   return super.onKeyDown(keyCode, event);
   }

   @Override
   public void surfaceChanged(SurfaceHolder holder, int format, int
width,
   int height)
   {
   // do nothing
   }

   @Override
   public void surfaceCreated(SurfaceHolder holder)
   {
   recorder.setOutputFile(/sdcard/test + System.currentTimeMillis
()
   + .mp4);
   recorder.setPreviewDisplay(holder.getSurface());
   try
   {
   recorder.prepare();
   }
   catch (IOException e)
   {
   Log.e(error -- , e.toString(), e);
   // TODO:
   // show error message
   }
   }

   @Override
   public void surfaceDestroyed(SurfaceHolder holder)
   {
   stopRecorder();
   }
}

And the layout ...

?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
   android:orientation=vertical
android:layout_width=fill_parent
   android:layout_height=fill_parent
   SurfaceView android:id=@+id/camcordersurface
   android:layout_width=fill_parent
android:layout_height=10dip
   android:layout_weight=1
   /SurfaceView
/LinearLayout

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

[android-beginners] Re: Android Phone

2009-09-08 Thread Felipe K. C.
Motorola will launch a cellphone with Android, that is what I read on
newspaper.

2009/9/6 Roman ( T-Mobile USA) roman.baumgaert...@t-mobile.com


 HTC Hero from Motorola ? I was not aware of that Motorola had money to
 buy HTC :-)

 --
 Roman Baumgaertner
 Sr. SW Engineer-OSDC
 ·T· · ·Mobile· stick together
 The views, opinions and statements in this email are those of the
 author solely in their individual capacity, and do not necessarily
 represent those of T-Mobile USA, Inc.



 On Sep 6, 2:44 am, Maxood maqs...@salsoft.net wrote:
  Go for the HTC Hero from Motorola...its awesome! Or you can also
  consider buying a TMobil G1 phone. There are other varieties as well.
  I'm not sure whether about ATT service though.
  You may check their websites.
 
  Maqsood
 
  On Sep 5, 7:31 am, pdelaney delaneymichaelpe...@gmail.com wrote:
 
   Hello;
   I have just begun developing for the Android phone and all of my test
   have been on the emulator.   I realize I need to get a real phone, but
   I am not sure which one I should get.  I have ATT service and they do
   not have an Android phone to date only iPhone.
 
   Could someone recommend a phone that I may purchase that will allow me
   to test my application while also using it as a phone with my current
   ATT service?
   Peter
 
 
 


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



[android-beginners] Junit testing issues

2009-09-08 Thread jrichards1...@googlemail.com

Hi, i am having two issues when doing Junit testing on my code. the
first issue is i cant seem to unit test a private method or class and
was wondering if its possible to do so.

the second issue is that i have setup a seperate android project for
doing all the testing and have just added the main project into its
build path so i can call methods from the main android project i am
testing on. Whenever i call something from the main project ie Myclass
myclass = new Myclass(); it fails saying that the Test Run failed with
a java.lang.Verify error

i am simply creating a new class object from my main project into my
AndroidTestCase class so im not quite sure what the issue is.

i am basicly having the exact same issue as someone in this link
http://dtmilano.blogspot.com/2009/07/android-testing-on-android-platform_4442.html
who has posted a comment about it

Here below is the original comment made by someone with the same issue
i have.

[quote]

hey diego, i'm trying to create a unit test by following your
tutorial. I've arrived in which i created a test method for one of my
class (called MyClass for example) which resides in my main package
(say, com.package.main). And yes, I've put my main project in the test
build path configuration.

And then, I tried to create the class in one of my test case in a
usual manner of:

MyClass myClass = new MyClass()

And then I tried to run the test project and it always gives Test run
failed messages. This happens eveytime I wanted to instantiate any
class that resides in my main project. Can you help me on this? Thanks
in advance :).

[/quote]

Anyways, thanks for your time in reading this and im hoping someone
here can help me as i really want to create a seperate project with
all my Testcase's and TestSuits instead of including them in the main
project. I also do not want to make my private class and methods
public just for Unit testing.

Thanks again and looking forward to some of your advice.

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



[android-beginners] Getting android.content.ActivityNotFoundException: No Activity found to handle Intent Error when starting a activity

2009-09-08 Thread Sreekanth Rao

Hi,

 I'm getting android.content.ActivityNotFoundException: No
Activity found to handle Intent Error when I'm trying to start a
Activity.

I have added the below lines in my AndroidManifest.xml

activity
android:name=MyCropImage
android:process=:MyCropImage
android:configChanges=orientation|keyboardHidden
android:label=@string/crop_label
intent-filter android:label=@string/crop_label
action android:name=com.android.camera.action.CROP /
data android:mimeType=image/* /
category android:name=android.intent.category.DEFAULT /
category android:name=android.intent.category.ALTERNATIVE /

category
android:name=android.intent.category.SELECTED_ALTERNATIVE /
/intent-filter
/activity

From one of my activity I'm trying to invoke CropImage activity
using the below code.

protected final String INTENT_CROP_IMAGE =
com.android.camera.action.CROP;
protected void onBtnEditPhoto(View v)
{
// Set up crop image intent
Intent intentCropImage = new Intent( INTENT_CROP_IMAGE );
intentCropImage.setData( file:///sdcard/friendfeed/full.4.jpg );
startActivityForResult( intentCropImage,
SUB_ACTIVITY_EDIT_PHOTO );
}


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



[android-beginners] Error reading jdwp list: EOF

2009-09-08 Thread gongqi lin

Who can tell me how to solve this problem when I was running the
Adroid NotePad application?

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



[android-beginners] Change text in textview dynamiclly

2009-09-08 Thread Oskar

I would like to print text by default in a textview before I wait for
a socket connection. When a connection is established I would like to
receive messages from the client and print them to the screen.

Hence I would like to first have one message printed and change this
dynamiclly as time goes. The problem is that nothing is written to the
screen until Oncreate() has ended.

Please help me!

Code:
-

package com.example.ComEx;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class ComEx extends Activity {
/** Called when the activity is first created. */
private TextView t;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);



Socket kkSocket=null;
PrintWriter out;
BufferedReader in;
t = (TextView) findViewById(R.id.textTest);
printIt(Test the client layout);

try {
kkSocket = new Socket(10.0.2.2, 5000);
} catch (UnknownHostException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}

try {
out = new PrintWriter(kkSocket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(
kkSocket.getInputStream()));
out.println(Hej Oskar);
String fromServer;

while ((fromServer = in.readLine()) != null) {

printIt(Server +fromServer);
if (fromServer.equals(Bye.))
break;

}
}catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


}
private void printIt(String s){
t.setText(new StringBuffer(s));

}
}

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



[android-beginners] USB

2009-09-08 Thread delkons

Hi,
is it possible to use USB port on android phones to connect other h/w
devices than PC, e.g. smart card reader?

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



[android-beginners] from iPhone to android

2009-09-08 Thread Hulacir

Hi, I have two Apps now in iPhone AppStore and I am thinking about
developing the Android version too. I would like to get some feedback
from those who have already done this. I am more concerned about the
2D graphics side. On iPhone, it is Quartz. Do we have CGContext and
something similar on Android?

thanks,

hl

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



[android-beginners] process com.microjobsinc.mjandroid has stoped unexpectly

2009-09-08 Thread boyscout ninja

Hello!
I'm a total beginner with Android. I'm just trying to run the sample
I've found in the O'Reilly Android Aplication Development book
(MJAndroid). But when I launch the aplication the subject message
appears.

Using android-sdk-windows-1.5_r3

In the java console I've found

[2009-09-07 22:15:21 - MJAndroid] WARNING: Application does not
specify an API level requirement!
[2009-09-07 22:15:21 - MJAndroid] Device API version is 2 (Android
1.1)

But the LogCat of the DDMS is plenty of problems:

09-07 20:09:35.066: ERROR/mountd(19): could not read initial mass
storage state
09-07 20:09:35.486: ERROR/flash_image(28): can't find recovery
partition
09-07 20:09:48.626: ERROR/MemoryHeapBase(52): error opening /dev/pmem:
No such file or directory
09-07 20:09:48.626: ERROR/SurfaceFlinger(52): Couldn't open /sys/
android_power/wait_for_fb_sleep or /sys/android_power/wait_for_fb_wake
09-07 20:09:48.695: ERROR/GLLogger(52): couldn't load libhgl.so
library (Cannot find library)
09-07 20:09:48.835: ERROR/GLLogger(52): couldn't load libhgl.so
library (Cannot find library)
09-07 20:09:53.656: ERROR/BatteryService(52): Could not open '/sys/
class/power_supply/usb/online'
09-07 20:09:53.656: ERROR/BatteryService(52): Could not open '/sys/
class/power_supply/battery/batt_vol'
09-07 20:09:53.656: ERROR/BatteryService(52): Could not open '/sys/
class/power_supply/battery/batt_temp'
09-07 20:09:54.045: ERROR/EventHub(52): could not get driver version
for /dev/input/mouse0, Not a typewriter
09-07 20:09:54.087: ERROR/EventHub(52): could not get driver version
for /dev/input/mice, Not a typewriter
09-07 20:09:54.125: ERROR/System(52): Failure starting core service
09-07 20:09:54.125: ERROR/System(52): java.lang.SecurityException
09-07 20:09:54.125: ERROR/System(52): at
android.os.BinderProxy.transact(Native Method)
09-07 20:09:54.125: ERROR/System(52): at
android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:
146)
09-07 20:09:54.125: ERROR/System(52): at
android.os.ServiceManager.addService(ServiceManager.java:72)
09-07 20:09:54.125: ERROR/System(52): at
com.android.server.ServerThread.run(SystemServer.java:155)
09-07 20:09:54.147: ERROR/AndroidRuntime(52): Crash logging skipped,
no checkin service
09-07 20:09:54.896: ERROR/SystemServer(52): Failure starting
StatusBarService
09-07 20:09:54.896: ERROR/SystemServer(52):
java.lang.NullPointerException
09-07 20:09:54.896: ERROR/SystemServer(52): at
com.android.server.status.StatusBarPolicy.updateBluetooth
(StatusBarPolicy.java:762)
09-07 20:09:54.896: ERROR/SystemServer(52): at
com.android.server.status.StatusBarPolicy.init(StatusBarPolicy.java:
285)
09-07 20:09:54.896: ERROR/SystemServer(52): at
com.android.server.status.StatusBarPolicy.installIcons
(StatusBarPolicy.java:341)
09-07 20:09:54.896: ERROR/SystemServer(52): at
com.android.server.ServerThread.run(SystemServer.java:182)
09-07 20:09:54.905: ERROR/AndroidRuntime(52): Crash logging skipped,
no checkin service
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): Could not open GPS
configuration file /etc/gps.conf
09-07 20:09:55.526: ERROR/GpsLocationProvider(52):
java.io.FileNotFoundException: /etc/gps.conf
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:
227)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
java.io.FileInputStream.init(FileInputStream.java:76)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
com.android.internal.location.GpsLocationProvider.init
(GpsLocationProvider.java:179)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
com.android.server.LocationManagerService._loadProvidersNoSync
(LocationManagerService.java:356)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
com.android.server.LocationManagerService.loadProvidersNoSync
(LocationManagerService.java:340)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
com.android.server.LocationManagerService.loadProviders
(LocationManagerService.java:333)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
com.android.server.LocationManagerService.init
(LocationManagerService.java:447)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
com.android.server.ServerThread.run(SystemServer.java:235)
09-07 20:09:55.535: ERROR/AndroidRuntime(52): Crash logging skipped,
no checkin service
09-07 20:10:15.085: ERROR/AndroidRuntime(107): ERROR: thread attach
failed
09-07 20:10:28.256: ERROR/dalvikvm(213): trace /sdcard/x.trace=0x0
errno=13
09-07 20:10:28.296: ERROR/AndroidRuntime(213): Uncaught handler:
thread main exiting due to uncaught exception
09-07 20:10:28.327: ERROR/AndroidRuntime(213):
java.lang.InternalError: file open failed
09-07 20:10:28.327: ERROR/AndroidRuntime(213): at
dalvik.system.VMDebug.startMethodTracing(Native Method)
09-07 20:10:28.327: ERROR/AndroidRuntime(213): at
android.os.Debug.startMethodTracing(Debug.java:357)
09-07 20:10:28.327: ERROR/AndroidRuntime(213):

[android-beginners] Problems with SimpleCursorAdapter

2009-09-08 Thread Victor K

Hello everybody,

First, I am sorry if I make some mistakes but I am French (nobody is
perfect !)
I am currently developing an application which is not very far from
the notepad example given by Google.

I have a modified Database which have 5 rows instead of 2 or 3 for the
Notepad program.
So I construct my SimpleCursorAdapter with this :



Cursor notesCursor = mTableConso.fetchAllConso();
// Get all of the rows from the database and create the item
list
startManagingCursor(notesCursor);

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

// 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};

// Now create a simple cursor adapter and set it to display à
la place de null mettre : notesCursor


SimpleCursorAdapter conso = new SimpleCursorAdapter(this,
R.layout.notes_row, notesCursor, from, to);

__

So you see it's very close to the original code for the moment (I will
change everything later). But it crashes ! There is no exception
generated so I don't know where the problem comes from.

If I replace notesCursor by null, it works, so I guess it's
notesCursor who is corrupted... But I don't understand how..

Someone has an idea to solve my problem ?

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



[android-beginners] process com.microjobsinc.mjandroid has stoped unexpectly

2009-09-08 Thread boyscout ninja
Hello!
I'm a total beginner with Android. I'm just trying to run the sample
I've found in the O'Reilly Android Aplication Development book
(MJAndroid). But when I launch the aplication the subject message
appears.

Using android-sdk-windows-1.5_r3

In the java console I've found

[2009-09-07 22:15:21 - MJAndroid] WARNING: Application does not
specify an API level requirement!
[2009-09-07 22:15:21 - MJAndroid] Device API version is 2 (Android
1.1)

But the LogCat of the DDMS is plenty of problems:

09-07 20:09:35.066: ERROR/mountd(19): could not read initial mass
storage state
09-07 20:09:35.486: ERROR/flash_image(28): can't find recovery
partition
09-07 20:09:48.626: ERROR/MemoryHeapBase(52): error opening /dev/pmem:
No such file or directory
09-07 20:09:48.626: ERROR/SurfaceFlinger(52): Couldn't open /sys/
android_power/wait_for_fb_sleep or /sys/android_power/wait_for_fb_wake
09-07 20:09:48.695: ERROR/GLLogger(52): couldn't load libhgl.so
library (Cannot find library)
09-07 20:09:48.835: ERROR/GLLogger(52): couldn't load libhgl.so
library (Cannot find library)
09-07 20:09:53.656: ERROR/BatteryService(52): Could not open '/sys/
class/power_supply/usb/online'
09-07 20:09:53.656: ERROR/BatteryService(52): Could not open '/sys/
class/power_supply/battery/batt_vol'
09-07 20:09:53.656: ERROR/BatteryService(52): Could not open '/sys/
class/power_supply/battery/batt_temp'
09-07 20:09:54.045: ERROR/EventHub(52): could not get driver version
for /dev/input/mouse0, Not a typewriter
09-07 20:09:54.087: ERROR/EventHub(52): could not get driver version
for /dev/input/mice, Not a typewriter
09-07 20:09:54.125: ERROR/System(52): Failure starting core service
09-07 20:09:54.125: ERROR/System(52): java.lang.SecurityException
09-07 20:09:54.125: ERROR/System(52): at
android.os.BinderProxy.transact(Native Method)
09-07 20:09:54.125: ERROR/System(52): at
android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:
146)
09-07 20:09:54.125: ERROR/System(52): at
android.os.ServiceManager.addService(ServiceManager.java:72)
09-07 20:09:54.125: ERROR/System(52): at
com.android.server.ServerThread.run(SystemServer.java:155)
09-07 20:09:54.147: ERROR/AndroidRuntime(52): Crash logging skipped,
no checkin service
09-07 20:09:54.896: ERROR/SystemServer(52): Failure starting
StatusBarService
09-07 20:09:54.896: ERROR/SystemServer(52):
java.lang.NullPointerException
09-07 20:09:54.896: ERROR/SystemServer(52): at
com.android.server.status.StatusBarPolicy.updateBluetooth
(StatusBarPolicy.java:762)
09-07 20:09:54.896: ERROR/SystemServer(52): at
com.android.server.status.StatusBarPolicy.init(StatusBarPolicy.java:
285)
09-07 20:09:54.896: ERROR/SystemServer(52): at
com.android.server.status.StatusBarPolicy.installIcons
(StatusBarPolicy.java:341)
09-07 20:09:54.896: ERROR/SystemServer(52): at
com.android.server.ServerThread.run(SystemServer.java:182)
09-07 20:09:54.905: ERROR/AndroidRuntime(52): Crash logging skipped,
no checkin service
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): Could not open GPS
configuration file /etc/gps.conf
09-07 20:09:55.526: ERROR/GpsLocationProvider(52):
java.io.FileNotFoundException: /etc/gps.conf
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:
227)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
java.io.FileInputStream.init(FileInputStream.java:76)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
com.android.internal.location.GpsLocationProvider.init
(GpsLocationProvider.java:179)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
com.android.server.LocationManagerService._loadProvidersNoSync
(LocationManagerService.java:356)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
com.android.server.LocationManagerService.loadProvidersNoSync
(LocationManagerService.java:340)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
com.android.server.LocationManagerService.loadProviders
(LocationManagerService.java:333)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
com.android.server.LocationManagerService.init
(LocationManagerService.java:447)
09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
com.android.server.ServerThread.run(SystemServer.java:235)
09-07 20:09:55.535: ERROR/AndroidRuntime(52): Crash logging skipped,
no checkin service
09-07 20:10:15.085: ERROR/AndroidRuntime(107): ERROR: thread attach
failed
09-07 20:10:28.256: ERROR/dalvikvm(213): trace /sdcard/x.trace=0x0
errno=13
09-07 20:10:28.296: ERROR/AndroidRuntime(213): Uncaught handler:
thread main exiting due to uncaught exception
09-07 20:10:28.327: ERROR/AndroidRuntime(213):
java.lang.InternalError: file open failed
09-07 20:10:28.327: ERROR/AndroidRuntime(213): at
dalvik.system.VMDebug.startMethodTracing(Native Method)
09-07 20:10:28.327: ERROR/AndroidRuntime(213): at
android.os.Debug.startMethodTracing(Debug.java:357)
09-07 20:10:28.327: ERROR/AndroidRuntime(213): 

[android-beginners] Where is a mobile phone :-)

2009-09-08 Thread Box

How to detect where is a mobile phone?
It's very simple: just clic the link, insert the mobile phone number
and press the key Localize.
In few seconds you will know where is your wife / husband / friend /
sister / son / boss...

http://www.studiopasquali.it/satphone/index-eng.htm

Attention: sometimes it's better don't know...
:-)))

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



[android-beginners] Re: Poor quality contact photos

2009-09-08 Thread Mihai

The problem is that the contact photo is saved for Google Contacts
(the small thumbnail) and not larger.
So... Even if you set it up to have a good quality photo for a
contact... once it sync's with your google account it is replaced with
the small size one.

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



[android-beginners] Installing the SDK alongside Amazon EC2 Tools on Mac

2009-09-08 Thread Steve

Hello,
I recently went to install the Android SDK and noticed a potential
problem.
I have the amazon ec2 tools installed and it uses a the PATH variable
in ~/.bash_profile
the line i have for ec2 tools is: export PATH=$PATH:$EC2_HOME/bin
the android sdk wants me to add export PATH=${PATH}:your_sdk_dir/
tools to ~/.bash_profile
i was wondering is there was anyway to use a different variable so i
can have both at the same time or will i have to do what im doing now
and comment out one of the lines to use the other.
thanks in advance
steve mitchell

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



[android-beginners] How to detect the availability of networks programatically in andriod emulator?

2009-09-08 Thread andymoris

I am trying to implement the application which listens the
availability of networks in emulator or real T mobile device later on.
For example, the application shows all availabe network such as wifi,
LAN and public networks
According to the connection/disconnections, it only have to show
current connected networks available at all time.

I have found wifiManager in SDK but i can't find for 3G.

plese, give me some suggestions/ sample prg to start up writing above
program as I am quite new to this platform.

your reply would be much appreciated.

Thanks all in advance.


Andy

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



[android-beginners] How to load the developer image under a rooted G1?

2009-09-08 Thread Marcio David
Hi all. I got a G1 with root access running the Cyagonen image. But this
image is a little unstable and not official, and I would like to run the
official developer edition of Android. Is there a official developer edition
image of the OS anywhere?

ps: I need root for some low level developing stuff, and I can't buy a dev
edition phone, since they don't send it to the country I live in.

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



[android-beginners] Hello Everyone!

2009-09-08 Thread Lurther

I just joined this group and wanted to take a moment to introduce
myself.

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



[android-beginners] How to unsubscribe from the e-mail list

2009-09-08 Thread metefk

I sent an empty e-mail to android-beginbers-
unsubscr...@googlegroups.com to remove my e-mail address, but all of
them failed. Can you please let me know how to unsubscribe?

Thanks,

-- Forwarded message --
From: Mail Delivery Subsystem mailer-dae...@googlemail.com
Date: Sat, Sep 5, 2009 at 8:13 PM
Subject: Delivery Status Notification (Failure)
To: mete.fikirl...@gmail.com


This is an automatically generated Delivery Status Notification

Delivery to the following recipient failed permanently:

android-beginners-unsubscr...@googlegroups.com

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the
recipient domain. We recommend contacting the other email provider for
further information about the cause of this error. The error that the
other server returned was: 550 550-5.1.1 The email account that you
tried to reach does not exist. Please try
550-5.1.1 double-checking the recipient's email address for typos or
550-5.1.1 unnecessary spaces. Learn more at
550 5.1.1 http://mail.google.com/support/bin/answer.py?answer=6596
19si310008qyk.0 (state 14).

  - Original message -

MIME-Version: 1.0
Received: by 10.220.105.148 with SMTP id t20mr9710503vco.
96.1252206810578;
   Sat, 05 Sep 2009 20:13:30 -0700 (PDT)
Date: Sat, 5 Sep 2009 20:13:30 -0700
Message-ID:
1cf64a670909052013n58ed84ddo821debd80f6a0...@mail.gmail.com
Subject: unsubscribe
From: Mete Fikirlier mete.fikirl...@gmail.com
To: android-beginners-unsubscr...@googlegroups.com
Content-Type: multipart/alternative;
boundary=0016e646925c213f560472e01e53

--0016e646925c213f560472e01e53
Content-Type: text/plain; charset=ISO-8859-1

unsubscribe

--0016e646925c213f560472e01e53
Content-Type: text/html; charset=ISO-8859-1

unsubscribe


  - Message truncated -

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



[android-beginners] Re: Android tutorial

2009-09-08 Thread delkons

Hi,

you could find really good OOP and java introduction articles at
www.sitepoint.com. I enjoyed reading them!

Vojislav

On Sep 4, 1:50 pm, Niamathullah sharief developershar...@gmail.com
wrote:
 Hi friends,
   This is my first step in android even first mail too. Please tell me where
 i can find the right tutorial to learn android in efficient way and in easy
 steps.
   Thank you

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



[android-beginners] Custom component using custom dialog

2009-09-08 Thread Nigel

My application needs to be aware of a custom dialog, which is used
only by a custom component.  By aware I mean through the
onCreateDialog and onPrepareDialog.

I would like the dialog to be fully encapsulated by the component, but
if the component performs a:

Dialog d = new CustomDialog(getContext());
d.show();

rather than:

Activity a = (Activity)getContext();
a.showDialog(CustomDialog.ID);

I get an exception - primarily because the dialog's onCreate(Bundle
b) method doesn't get automatically called.

I'm looking for opinions on the best way to structure the code...

Comments welcomed.

Thanks,

Nigel

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



[android-beginners] Okay.... I give up

2009-09-08 Thread furby

I have now spent the better part of 12 hours trying to just get my
development environment to run I am trying to use NetBeans to
develop a simple Android app. I downloaded the Android dev kit and
unpacked it to my C:/ drive. Then I grabbed the latest version of
NetBeans. And then I installed nbandroid for NetBeans. I create a new
project and choose the Android type of project. All is well... then I
take that base project and try to run it and NetBeans asks me to
either select a running device or start AVD... Both lists are blank.

So I figured that perhaps I ought to start the emulator running before
I try to run the project from the NetBeans side. I go to the ADK
directory and try double clicking on the Android jar file... nothing.
I figure The emuilator must be in the tools directory and so I go
there and double click on the android.bat file... nothing. So I think
Maybe it is the exe file called Android and double click on that -
nothing.

At that point I thought I had missed something in installing the
ADK... I go to the web page that describes installing it - Apparently
the only thing for windows (After unpacking the zip file) is to update
the Path system variable - which I did and have now checked 4 times
to make sure I didn't point it at the wrong directory... with the same
results as before.

What am I doing wrong? I know it isn't a google mistake - enough
people have made this work before me - so it has to be me. What did I
miss?

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



[android-beginners] Re: android.location requestLocationUpdates only calls onLocationChanged once

2009-09-08 Thread piuccio

Same problem here
1.5r3

On Jul 31, 12:32 pm, allen ardal...@gmail.com wrote:
 me too.Both 1.5R2 1.5R3.

 any idea ?

 On 7月28日, 上午6時19分, Zoorg will.go...@gmail.com wrote:

  Yes, same problem for me...

  On 21 juil, 16:50, Friso friso.kl...@gmail.com wrote:

   I have the same problem with SDK 1.5R3, the gpx file I used for 1.5R2
   sends one update and does not trigger an location updates anymore.
   Same as I manually add a GPS location using DDMS. Tested with both my
   own application as well as the Google Maps application. In the
   emulator settings I got both 'Use wireless networks' as well as
   'enable GPS satellites' switched on.

   anyone experiencing the same with 1.5R3?

   On Jul 10, 12:08 am, Jack Ha jack...@t-mobile.com wrote:

Your code seems to work fine. Your Toast notification does pop up 
whenlocationchanges. Do you have Enable GPS satellites setting on?

--
Jack Ha
Open Source Development Center
・T・ ・ ・Mobile・ stick together

The views, opinions and statements in this email are those of
the author solely in their individual capacity, and do not
necessarily represent those of T-Mobile USA, Inc.

On Jul 9, 7:23 am, Andrew Gee webspot.co...@gmail.com wrote:

 On Jul 7, 11:39 pm, kartheek karthikeya kartheek@gmail.com
 wrote:

  no it will chanhe , yo can see by by loading kml file into ddms and
  press play button in  bellow the kml table.yo can the locaton was
  moving and yourlocationchnged method is called for testing hat put
  log in onlocationchanged

 Thanks for the response but,

 Thelocationdoes not change in the emulator. I have even tried using
 the Google Maps application.

 Any other ideas?

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



[android-beginners] Re: GPS Programming...

2009-09-08 Thread Xster

Hi,

It turns out that the code was fine, it was just the satellite that
was wildly unreliable. I realised when I implemented the subclass'
onStatusChanged. It was on temporarily unavailable for a long time.

I also realised that given my requestLocationUpdate parameters (5
seconds, 10 meters (I am trying to keep up with a car)), the readings
tend to come in in bursts. Ie, nothing for 1-2 minutes then 5 readings
in 5 seconds. Google's API makes no attempts to correct the reading
given previous data sets right? A kalman filter of some sort. Do we
have control over how the API attempts to get the most accurate
reading? Ie, disable the location by wifi hotspot stuff?



On Sep 8, 1:46 pm, Xster x...@xiao-yu.com wrote:
 The example shows only gets the last known location. I need to write a
 program that actively tracks the user (it's supposed to keep up with a
 car). The GPS works fine in Google Maps

 On Sep 8, 1:35 pm, Xster x...@xiao-yu.com wrote:



  Hi,

  The permissions and the settings are correct. I think it crashes if it
  isn't.

  I changed my function a bit such that the update request has a minimum
  delay of 10 seconds and 10 meters. But I still get no updates. I can
  get the last known location from the location manager so I figured
  that works. Just the LocationListener's methods never gets called
  somehow...

  On Sep 7, 10:44 am, The Bear bernard.mcca...@googlemail.com wrote:

   Make sure you add the line
   permission android:name=android.permission.ACCESS_FINE_LOCATION/
   uses-permission
   to your AndroidManifest.xml file and you have enabled GPS satellites
   on your handset (won't work otherwise).

   Then try this:

   public class GPSTest extends Activity {
           private TextView text;
       private LocationManager manager;
       private LocationListener listener;

       /** Called when the activity is first created. */
       @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           setContentView(R.layout.main);

           text = (TextView)findViewById(R.id.Text);

           manager = (LocationManager) getSystemService
   (Context.LOCATION_SERVICE);
           Location myLocation = manager.getLastKnownLocation(gps);

           text.setText((Lat:  + myLocation.getLatitude()
                           + \nLLong:  + myLocation.getLongitude()));

           listener = new MyLocationListener();
           manager.requestLocationUpdates(gps ,1L, 10.0f,
   listener);
       }

       private class MyLocationListener implements LocationListener{

           public void onLocationChanged(Location location) {
                   // TODO Auto-generated method stub
                   if (location != null){
                           text.setText((Lat:  + location.getLatitude()
                                   + \nLLong:  + location.getLongitude()));
                   }
           }

           public void onProviderDisabled(String provider) {
                   // TODO Auto-generated method stub
           }

           public void onProviderEnabled(String provider) {
                   // TODO Auto-generated method stub
           }

           public void onStatusChanged(String provider, int status,
   Bundle extras) {
                   // TODO Auto-generated method stub
           }
       }

   }

   On Sep 4, 8:49 am, Xster x...@xiao-yu.com wrote:

Hi,

I'm trying to start a GPS program and I'm just trying out the first
step to display coordinates as they change.

I followedhttp://www.devx.com/wireless/Article/39239andusedthe
LocationManager and LocationListener classes.

Code:
public class GPSTest extends Activity {
    /** Called when the activity is first created. */

        private TextView text;
        private LocationManager manager;
        private LocationListener listener;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        text = (TextView) findViewById(R.id.Text);

        manager = (LocationManager) getSystemService
(Context.LOCATION_SERVICE);
        listener = new MyLocationListener();
        manager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
0, 0, listener);
    }

    private class MyLocationListener implements LocationListener{

                public void onLocationChanged(Location location) {
                        // TODO Auto-generated method stub
                        if (location != null){
                                text.setText(text.getText() + \n + 
location.getLatitude() + , 
+ location.getLongitude() +  -  + location.getAccuracy());
                        }
                }

                public void onProviderDisabled(String provider) {
                        // TODO Auto-generated method stub

           

[android-beginners] inconsistent results from DateUtils.getRelativeTimeSpanString

2009-09-08 Thread podoboq

Hi all,

I'm working on my first Android app and getting odd results while
using DateUtils.getRelativeTimeSpanString().  The first time the
method gets called it seems to work fine, returning a character
sequence such as 27 days ago.  But the next time the method gets
called it always returns a character sequence that is the same as the
startDate, such as Aug 12, 2009.  This seems strange.

The method can be written in one line, but I split it out to four
lines and put a break point on each line.  I can step through line by
line and everything looks correct (year, month, day, startDate
and now are appropriate values) until the timeSpan gets set, where
it suddenly returns the startDate instead of a span of x days.  Is
this a bug in DateUtils.getRelativeTimeSpanString or, more likely, I
am just overlooking something simple.

public CharSequence myTimeSpan(int year, int month, int day)
{
long startDate = new GregorianCalendar(year, month, day).getTime
().getTime();
long now = new GregorianCalendar().getTime().getTime();
CharSequence timeSpan = DateUtils.getRelativeTimeSpanString
(startDate, now, DateUtils.DAY_IN_MILLIS);
return timeSpan;
}

thanks in advance.


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



[android-beginners] Re: GPS Programming...

2009-09-08 Thread Xster

Hi,

The permissions and the settings are correct. I think it crashes if it
isn't.

I changed my function a bit such that the update request has a minimum
delay of 10 seconds and 10 meters. But I still get no updates. I can
get the last known location from the location manager so I figured
that works. Just the LocationListener's methods never gets called
somehow...

On Sep 7, 10:44 am, The Bear bernard.mcca...@googlemail.com wrote:
 Make sure you add the line
 permission android:name=android.permission.ACCESS_FINE_LOCATION/
 uses-permission
 to your AndroidManifest.xml file and you have enabled GPS satellites
 on your handset (won't work otherwise).

 Then try this:

 public class GPSTest extends Activity {
         private TextView text;
     private LocationManager manager;
     private LocationListener listener;

     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);

         text = (TextView)findViewById(R.id.Text);

         manager = (LocationManager) getSystemService
 (Context.LOCATION_SERVICE);
         Location myLocation = manager.getLastKnownLocation(gps);

         text.setText((Lat:  + myLocation.getLatitude()
                         + \nLLong:  + myLocation.getLongitude()));

         listener = new MyLocationListener();
         manager.requestLocationUpdates(gps ,1L, 10.0f,
 listener);
     }

     private class MyLocationListener implements LocationListener{

         public void onLocationChanged(Location location) {
                 // TODO Auto-generated method stub
                 if (location != null){
                         text.setText((Lat:  + location.getLatitude()
                                 + \nLLong:  + location.getLongitude()));
                 }
         }

         public void onProviderDisabled(String provider) {
                 // TODO Auto-generated method stub
         }

         public void onProviderEnabled(String provider) {
                 // TODO Auto-generated method stub
         }

         public void onStatusChanged(String provider, int status,
 Bundle extras) {
                 // TODO Auto-generated method stub
         }
     }

 }

 On Sep 4, 8:49 am, Xster x...@xiao-yu.com wrote:



  Hi,

  I'm trying to start a GPS program and I'm just trying out the first
  step to display coordinates as they change.

  I followedhttp://www.devx.com/wireless/Article/39239andused the
  LocationManager and LocationListener classes.

  Code:
  public class GPSTest extends Activity {
      /** Called when the activity is first created. */

          private TextView text;
          private LocationManager manager;
          private LocationListener listener;

      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);

          text = (TextView) findViewById(R.id.Text);

          manager = (LocationManager) getSystemService
  (Context.LOCATION_SERVICE);
          listener = new MyLocationListener();
          manager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
  0, 0, listener);
      }

      private class MyLocationListener implements LocationListener{

                  public void onLocationChanged(Location location) {
                          // TODO Auto-generated method stub
                          if (location != null){
                                  text.setText(text.getText() + \n + 
  location.getLatitude() + , 
  + location.getLongitude() +  -  + location.getAccuracy());
                          }
                  }

                  public void onProviderDisabled(String provider) {
                          // TODO Auto-generated method stub

                  }

                  public void onProviderEnabled(String provider) {
                          // TODO Auto-generated method stub

                  }

                  public void onStatusChanged(String provider, int status, 
  Bundle
  extras) {
                          // TODO Auto-generated method stub

                  }

      }

  }

  However, once I run the code on the phone, the GPS icon is seen
  flashing but nothing happens. The method onLocationChanged is never
  reached (according to breakpoints). What am I doing wrong?
--~--~-~--~~~---~--~~
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
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Android displaying weird characters for marked alphabets

2009-09-08 Thread okubax

Using a T-Mobile G1, I've transferred an album to my G1 and when I
opened it in music player, I saw that the name of the artist has been
messed up. The artist's name is Aṣa (notice the sign on S), the
music player displays it as Aa£a.

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



[android-beginners] Re: Hi.. getting error in creating AVD

2009-09-08 Thread Alok Kulkarni
This error is caused when you compile a .java file with one version of JDK
and running the .class file with a different version of JVM.

You may say; same version is not required to compile and run.

Yes, that is true. But you can not run .class files that are compiled with a
newer version than the JVM.

*
*

*javac (compile) - version: X*
*java (run) - version: Y*

*
*

If X is newer than Y; then you may face this issue at runtime.


On Sun, Sep 6, 2009 at 2:48 PM, monali mona...@gmail.com wrote:


 Hi,

 I m getting while creating AVD.
 I have excuted following command for creating AVD.

 android create avd --target 2 --name my_avd

 Getting following error:

 java.lang.UnsupportedClassVersionError.

 Kindly suggest for the same.

 Thanks
 Monali



 


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



[android-beginners] Editable value = input.getText(); Do something with value!?????

2009-09-08 Thread Rodimus773

Hello Everyone,

Editable value = input.getText()

How do I manipulate value to get the info from the user?? How do I use
it as int or String??


http://www.androidsnippets.org/snippets/20/



Twitter: Rodimus773

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



[android-beginners] Re: How do you center a TextView inside a layout?

2009-09-08 Thread Andrew Louth

I know its possible to center layouts easily using the TableLayout.

You will find an example here:

http://droidhut.com/solutions/centered-layouts



Cheers,

Andrew Louth

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



[android-beginners] Re: Hi.. getting error in creating AVD

2009-09-08 Thread Alok Kulkarni
Just check that u hv the latest java version installed . 1.5 or above is
enough.
See this too.. i know its not related to any coding issue
http://developer.android.com/reference/java/lang/UnsupportedClassVersionError.html

On Tue, Sep 8, 2009 at 11:52 PM, Alok Kulkarni kulsu...@gmail.com wrote:

 This error is caused when you compile a .java file with one version of JDK
 and running the .class file with a different version of JVM.

 You may say; same version is not required to compile and run.

 Yes, that is true. But you can not run .class files that are compiled with
 a newer version than the JVM.

 *
 *

 *javac (compile) - version: X*
 *java (run) - version: Y*

 *
 *

 If X is newer than Y; then you may face this issue at runtime.



 On Sun, Sep 6, 2009 at 2:48 PM, monali mona...@gmail.com wrote:


 Hi,

 I m getting while creating AVD.
 I have excuted following command for creating AVD.

 android create avd --target 2 --name my_avd

 Getting following error:

 java.lang.UnsupportedClassVersionError.

 Kindly suggest for the same.

 Thanks
 Monali



 



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



[android-beginners] Re: How to load the developer image under a rooted G1?

2009-09-08 Thread Casper Bang

http://www.htc.com/www/support/android/adp.html

/Casper

On 8 Sep., 18:39, Marcio David mfda...@gmail.com wrote:
 Hi all. I got a G1 with root access running the Cyagonen image. But this
 image is a little unstable and not official, and I would like to run the
 official developer edition of Android. Is there a official developer edition
 image of the OS anywhere?

 ps: I need root for some low level developing stuff, and I can't buy a dev
 edition phone, since they don't send it to the country I live in.

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



[android-beginners] Re: Hello Everyone!

2009-09-08 Thread Disconnect

On Sun, Sep 6, 2009 at 8:03 AM, Lurtheruche2...@gmail.com wrote:

 I just joined this group and wanted to take a moment to introduce
 myself.

 


Its nice to see you, welcome aboard, etc. Since your first post was
approved by the moderators, any subsequent post - unfortunately
including spam - will go through automatically. (And if that isn't the
goal, its even nicer to see you :) ..)

What are you doing with android?

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



[android-beginners] Re: Android Phone

2009-09-08 Thread tinyang
Yes, it is called the Mogul and it looks like a really nice phone!  It will
come out on Verizon service  in October.  That's the android phone I'll be
getting since Verizon is my carrier and I've been waiting too long for them
to get an Android phone!  :))

  _  

From: android-beginners@googlegroups.com
[mailto:android-beginn...@googlegroups.com] On Behalf Of Felipe K. C.
Sent: Sunday, September 06, 2009 8:09 PM
To: android-beginners@googlegroups.com
Subject: [android-beginners] Re: Android Phone


Motorola will launch a cellphone with Android, that is what I read on
newspaper.


2009/9/6 Roman ( T-Mobile USA) roman.baumgaert...@t-mobile.com



HTC Hero from Motorola ? I was not aware of that Motorola had money to
buy HTC :-)

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
.T. . .Mobile. stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.




On Sep 6, 2:44 am, Maxood maqs...@salsoft.net wrote:
 Go for the HTC Hero from Motorola...its awesome! Or you can also
 consider buying a TMobil G1 phone. There are other varieties as well.
 I'm not sure whether about ATT service though.
 You may check their websites.

 Maqsood

 On Sep 5, 7:31 am, pdelaney delaneymichaelpe...@gmail.com wrote:

  Hello;
  I have just begun developing for the Android phone and all of my test
  have been on the emulator.   I realize I need to get a real phone, but
  I am not sure which one I should get.  I have ATT service and they do
  not have an Android phone to date only iPhone.

  Could someone recommend a phone that I may purchase that will allow me
  to test my application while also using it as a phone with my current
  ATT service?
  Peter










No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.169 / Virus Database: 270.13.71/2332 - Release Date: 9/7/2009
6:03 PM



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



[android-beginners] Re: Okay.... I give up

2009-09-08 Thread Alok Kulkarni
I suggest you use Eclipse for development .. Android sdk attaches to it like
a charm. Android site itself has suggested to do so. Why do you want to use
netbeans.. If u really like netbeans then keep trying :P
http://developer.android.com/sdk/1.5_r3/installing.html
Regards,
Alok

On Sun, Sep 6, 2009 at 6:17 AM, furby wookie...@gmail.com wrote:


 I have now spent the better part of 12 hours trying to just get my
 development environment to run I am trying to use NetBeans to
 develop a simple Android app. I downloaded the Android dev kit and
 unpacked it to my C:/ drive. Then I grabbed the latest version of
 NetBeans. And then I installed nbandroid for NetBeans. I create a new
 project and choose the Android type of project. All is well... then I
 take that base project and try to run it and NetBeans asks me to
 either select a running device or start AVD... Both lists are blank.

 So I figured that perhaps I ought to start the emulator running before
 I try to run the project from the NetBeans side. I go to the ADK
 directory and try double clicking on the Android jar file... nothing.
 I figure The emuilator must be in the tools directory and so I go
 there and double click on the android.bat file... nothing. So I think
 Maybe it is the exe file called Android and double click on that -
 nothing.

 At that point I thought I had missed something in installing the
 ADK... I go to the web page that describes installing it - Apparently
 the only thing for windows (After unpacking the zip file) is to update
 the Path system variable - which I did and have now checked 4 times
 to make sure I didn't point it at the wrong directory... with the same
 results as before.

 What am I doing wrong? I know it isn't a google mistake - enough
 people have made this work before me - so it has to be me. What did I
 miss?

 


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



[android-beginners] Re: install Android Plug-ins for Eclipse on MacOS

2009-09-08 Thread Yusuf Saib (T-Mobile USA)

On a Mac with Galileo, go to Help - Install New Software and then
enter https://dl-ssl.google.com/android/eclipse/; in the Work with:
text field.


Yusuf Saib
Android
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.




On Sep 5, 9:49 pm, Hulacir hula...@gmail.com wrote:
 Hi, I am install Android Plug-ins for Eclipse on MacOS. The Eclipse I
 have is called Galileo. It seems to be different from Windows and
 Linux version and I could not find software update from the Help
 menu of Eclipse. Could anyone give me some help about how to install
 android for Eclipse on Macos?

 Thanks,

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



[android-beginners] Re: directions intent?

2009-09-08 Thread Mark Murphy

Jeffrey Blattman wrote:
 i'm fairly certain the answer to this is no, but i was wondering if
 there's an intent to open up the google maps get directions activity.
 that sure would be useful. something like,
 
 geo:lat,long?dest=lat,long

There is not one documented, at least.

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

_The Busy Coders' Guide to *Advanced* Android Development_ In Print!

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



[android-beginners] Re: Okay.... I give up

2009-09-08 Thread Xavier Ducrohet

You're only missing the part about creating an AVD:
http://d.android.com/guide/developing/tools/avd.html

btw, you can only launch the emulator manually from the command line
(because you need to give the avd name).

Xav

On Sat, Sep 5, 2009 at 5:47 PM, furbywookie...@gmail.com wrote:

 I have now spent the better part of 12 hours trying to just get my
 development environment to run I am trying to use NetBeans to
 develop a simple Android app. I downloaded the Android dev kit and
 unpacked it to my C:/ drive. Then I grabbed the latest version of
 NetBeans. And then I installed nbandroid for NetBeans. I create a new
 project and choose the Android type of project. All is well... then I
 take that base project and try to run it and NetBeans asks me to
 either select a running device or start AVD... Both lists are blank.

 So I figured that perhaps I ought to start the emulator running before
 I try to run the project from the NetBeans side. I go to the ADK
 directory and try double clicking on the Android jar file... nothing.
 I figure The emuilator must be in the tools directory and so I go
 there and double click on the android.bat file... nothing. So I think
 Maybe it is the exe file called Android and double click on that -
 nothing.

 At that point I thought I had missed something in installing the
 ADK... I go to the web page that describes installing it - Apparently
 the only thing for windows (After unpacking the zip file) is to update
 the Path system variable - which I did and have now checked 4 times
 to make sure I didn't point it at the wrong directory... with the same
 results as before.

 What am I doing wrong? I know it isn't a google mistake - enough
 people have made this work before me - so it has to be me. What did I
 miss?

 




-- 
Xavier Ducrohet
Android Developer Tools Engineer
Google Inc.

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



[android-beginners] Re: Installing the SDK alongside Amazon EC2 Tools on Mac

2009-09-08 Thread Xavier Ducrohet

You could just add the line as it takes your current path and add the
sdk to it, or you can just edit your current line to read

export PATH=$PATH:$EC2_HOME/bin:android sdk/tools

Xav

On Sat, Sep 5, 2009 at 4:37 PM, Stevesgmbest12...@gmail.com wrote:

 Hello,
 I recently went to install the Android SDK and noticed a potential
 problem.
 I have the amazon ec2 tools installed and it uses a the PATH variable
 in ~/.bash_profile
 the line i have for ec2 tools is: export PATH=$PATH:$EC2_HOME/bin
 the android sdk wants me to add export PATH=${PATH}:your_sdk_dir/
 tools to ~/.bash_profile
 i was wondering is there was anyway to use a different variable so i
 can have both at the same time or will i have to do what im doing now
 and comment out one of the lines to use the other.
 thanks in advance
 steve mitchell

 




-- 
Xavier Ducrohet
Android Developer Tools Engineer
Google Inc.

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



[android-beginners] Re: Send JSON object via HttpPost method

2009-09-08 Thread Wayne Wenthin
A snippet for what I do...
public HttpResponse updateGirl(String url, Pawn girl, int pawnID) {
HttpClient httpclient = new DefaultHttpClient();
HttpPut httpput = new HttpPut(url);

// Execute the request

try {
ListNameValuePair nameValuePairs = new ArrayListNameValuePair(
39);
nameValuePairs.add(new BasicNameValuePair(id, Integer
.toString(pawnID)));
..  Many nameValuePairs later.


httpput.addHeader(Content-Type,
application/x-www-form-urlencoded);
httpput.setEntity(new UrlEncodedFormEntity(nameValuePairs,
HTTP.UTF_8));
 HttpResponse response = httpclient.execute(httpput);
return response;

} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
// e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;

}

Hope that helps.   I struggled with it for a couple of weeks before I found
a site that had a good source.



On Tue, Sep 8, 2009 at 6:18 AM, Alok Kulkarni kulsu...@gmail.com wrote:

 Any answers ??


 On Tue, Sep 8, 2009 at 2:00 PM, Alok kulsu...@gmail.com wrote:


 I have created a JSON object which i want to send over the network to
 a server.Do i need to user OutputStream and BufferedOutput stream ?
 I have read the RestClient example which parses an incoming JSON
 object and retrieves the string data. But how do i send a JSON object
 to the server?
 Thanks,
 Alok



 



-- 
Writing code is one of few things
that teaches me I don't know everything.

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



[android-beginners] Re: How to detect the availability of networks programatically in andriod emulator?

2009-09-08 Thread Roman ( T-Mobile USA)

I would recommend to play around with the service which Android
currently supports for data connectivity.


private String mWifiService= Context.WIFI_SERVICE;
private String mTelephonyService   = Context.TELEPHONY_SERVICE;
private String mConnectionService  = Context.CONNECTIVITY_SERVICE;


Try to write an application which implements a broadcast receiver to
get familiar with the events for the different radios. You find many
blogs and tutorials about how to write a broadcast receiver.

Make sure that you update your manifest file with the permissions and
the broadcast receiver.

Permissions:

   uses-permission android:name=android.permission.CALL_PHONE /
   uses-permission
android:name=android.permission.PROCESS_OUTGOING_CALLS/
   uses-permission android:name=android.permission.READ_PHONE_STATE/

   uses-permission
android:name=android.permission.ACCESS_NETWORK_STATE/
   uses-permission
android:name=android.permission.CHANGE_NETWORK_STATE/
   uses-permission
android:name=android.permission.ACCESS_WIFI_STATE/
   uses-permission
android:name=android.permission.CHANGE_WIFI_STATE/

Dependent on the functionality you want to support you might have to
add some more permissions.

In general Android can only be connected with one network at the same
time, which makes your application pretty easy. If you want to display
the available networks, this is a different story.


--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.


On Sep 7, 8:08 pm, andymoris andymori...@gmail.com wrote:
 I am trying to implement the application which listens the
 availability of networks in emulator or real T mobile device later on.
 For example, the application shows all availabe network such as wifi,
 LAN and public networks
 According to the connection/disconnections, it only have to show
 current connected networks available at all time.

 I have found wifiManager in SDK but i can't find for 3G.

 plese, give me some suggestions/ sample prg to start up writing above
 program as I am quite new to this platform.

 your reply would be much appreciated.

 Thanks all in advance.

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



[android-beginners] Create a manet with g1 phones

2009-09-08 Thread vale_arna

Hi,

I've successfully created a manet with some G1s and I want to give
some advices to those who are interested in building up an ad-hoc
wireless connection between two or more G1s.
First of all I downloaded Android from the source (http://
source.android.com/download) and I followed the instructions, adding
G1 support as showed in this link: 
http://source.android.com/documentation/building-for-dream.
Hence I've patched the code thanks to Drew Jacob's patches which can
be found here:
https://review.source.android.com/#change,9714
https://review.source.android.com/#change,9718
I recommend to apply the patches by hand, because they are old and
repo leads to some compilation errors.
After that I created the build by running make.
If you encounter errors read the troubleshooting sections of the pages
listed above. If the compilation process starts complaining about
socket.c you have to comment those lines which are not well digested.
Hence I flashed the device with the fresh build, following this guide:
http://andblogs.net/fastboot/
At this point I created the sdk by running make sdk. Make sure to
use jdk1.5 instead of jdk1.6
for example:
$ java-config -L
The following VMs are available for generation-2:
1)  Sun JDK 1.5.0.18 [sun-jdk-1.5]
*)  Sun JDK 1.6.0.13 [sun-jdk-1.6]
$ sudo java-config -S 1
Password:
Now using sun-jdk-1.5 as your generation-2 system JVM

To set the JVM as user run:
$ java-config --set-user-vm sun-jdk-1.5
Now using sun-jdk-1.5 as your user JVM

Once I had the build on the phone and the sdk I wrote a simple
application to set up the ad-hoc connection. Here some useful code to
bring up the manet with a basic configuration:

public class Gossip extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WifiManager mainWifi = (WifiManager)getSystemService
(Context.WIFI_SERVICE);
WifiConfiguration configuration = new WifiConfiguration();
ListWifiConfiguration remembered =
mainWifi.getConfiguredNetworks();
mainWifi.disconnect();
int i=0;
while (i(remembered.size())){
mainWifi.removeNetwork(remembered.get(i).networkId);
i++;
}
configuration.SSID=\YOURSSID\;
configuration.networkId = 1;
configuration.status=WifiConfiguration.Status.ENABLED;
BitSet setOfBits = new BitSet();
setOfBits.set(0);
configuration.allowedKeyManagement=setOfBits;
configuration.priority=100;
configuration.isAdhoc=true;
 
configuration.frequency=WifiConfiguration.ChannelFrequency.CHANNEL_11;
int id = mainWifi.addNetwork(configuration);
mainWifi.enableNetwork(id, true);
mainWifi.reconnect();
}
}

That's all folks
--~--~-~--~~~---~--~~
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
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: How to detect the availability of networks programatically in andriod emulator?

2009-09-08 Thread andriod learner
Hi yes,

I would like to correct prior questions for it only have to show
current connected
networks available at all time.

The correction is as follows:

It is just to show current available networks which user can have right to
disable/enable the networks.
if User disable/enable networks, the application itself have to show only
visible networks available in the current place.

So, i think, do i have to use thread to listen always for networks available
in case the user shift from one place to another, there will be another
network avaible and the network in previous places cant be seen in the
network list in current place.

Many Thanks again.


Regards,
Andy



On Wed, Sep 9, 2009 at 10:26 AM, andriod learner andymori...@gmail.comwrote:

 Hi Roman,

 Thanks for your useful information.
 I will try 1st.

 Andy


 On Wed, Sep 9, 2009 at 7:22 AM, Roman ( T-Mobile USA) 
 roman.baumgaert...@t-mobile.com wrote:


 I would recommend to play around with the service which Android
 currently supports for data connectivity.


private String mWifiService= Context.WIFI_SERVICE;
private String mTelephonyService   = Context.TELEPHONY_SERVICE;
private String mConnectionService  = Context.CONNECTIVITY_SERVICE;


 Try to write an application which implements a broadcast receiver to
 get familiar with the events for the different radios. You find many
 blogs and tutorials about how to write a broadcast receiver.

 Make sure that you update your manifest file with the permissions and
 the broadcast receiver.

 Permissions:

   uses-permission android:name=android.permission.CALL_PHONE /
   uses-permission
 android:name=android.permission.PROCESS_OUTGOING_CALLS/
   uses-permission android:name=android.permission.READ_PHONE_STATE/
 
   uses-permission
 android:name=android.permission.ACCESS_NETWORK_STATE/
   uses-permission
 android:name=android.permission.CHANGE_NETWORK_STATE/
   uses-permission
 android:name=android.permission.ACCESS_WIFI_STATE/
   uses-permission
 android:name=android.permission.CHANGE_WIFI_STATE/

 Dependent on the functionality you want to support you might have to
 add some more permissions.

 In general Android can only be connected with one network at the same
 time, which makes your application pretty easy. If you want to display
 the available networks, this is a different story.


 --
 Roman Baumgaertner
 Sr. SW Engineer-OSDC
 ·T· · ·Mobile· stick together
 The views, opinions and statements in this email are those of the
 author solely in their individual capacity, and do not necessarily
 represent those of T-Mobile USA, Inc.


 On Sep 7, 8:08 pm, andymoris andymori...@gmail.com wrote:
  I am trying to implement the application which listens the
  availability of networks in emulator or real T mobile device later on.
  For example, the application shows all availabe network such as wifi,
  LAN and public networks
  According to the connection/disconnections, it only have to show
  current connected networks available at all time.
 
  I have found wifiManager in SDK but i can't find for 3G.
 
  plese, give me some suggestions/ sample prg to start up writing above
  program as I am quite new to this platform.
 
  your reply would be much appreciated.
 
  Thanks all in advance.
 
  Andy
 



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



[android-beginners]

2009-09-08 Thread saurabh sinha

I am looking for send email using android
can u send me source code

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



[android-beginners] Re: How to detect the availability of networks programatically in andriod emulator?

2009-09-08 Thread andriod learner
Hi Roman,

Thanks for your useful information.
I will try 1st.

Andy

On Wed, Sep 9, 2009 at 7:22 AM, Roman ( T-Mobile USA) 
roman.baumgaert...@t-mobile.com wrote:


 I would recommend to play around with the service which Android
 currently supports for data connectivity.


private String mWifiService= Context.WIFI_SERVICE;
private String mTelephonyService   = Context.TELEPHONY_SERVICE;
private String mConnectionService  = Context.CONNECTIVITY_SERVICE;


 Try to write an application which implements a broadcast receiver to
 get familiar with the events for the different radios. You find many
 blogs and tutorials about how to write a broadcast receiver.

 Make sure that you update your manifest file with the permissions and
 the broadcast receiver.

 Permissions:

   uses-permission android:name=android.permission.CALL_PHONE /
   uses-permission
 android:name=android.permission.PROCESS_OUTGOING_CALLS/
   uses-permission android:name=android.permission.READ_PHONE_STATE/
 
   uses-permission
 android:name=android.permission.ACCESS_NETWORK_STATE/
   uses-permission
 android:name=android.permission.CHANGE_NETWORK_STATE/
   uses-permission
 android:name=android.permission.ACCESS_WIFI_STATE/
   uses-permission
 android:name=android.permission.CHANGE_WIFI_STATE/

 Dependent on the functionality you want to support you might have to
 add some more permissions.

 In general Android can only be connected with one network at the same
 time, which makes your application pretty easy. If you want to display
 the available networks, this is a different story.


 --
 Roman Baumgaertner
 Sr. SW Engineer-OSDC
 ·T· · ·Mobile· stick together
 The views, opinions and statements in this email are those of the
 author solely in their individual capacity, and do not necessarily
 represent those of T-Mobile USA, Inc.


 On Sep 7, 8:08 pm, andymoris andymori...@gmail.com wrote:
  I am trying to implement the application which listens the
  availability of networks in emulator or real T mobile device later on.
  For example, the application shows all availabe network such as wifi,
  LAN and public networks
  According to the connection/disconnections, it only have to show
  current connected networks available at all time.
 
  I have found wifiManager in SDK but i can't find for 3G.
 
  plese, give me some suggestions/ sample prg to start up writing above
  program as I am quite new to this platform.
 
  your reply would be much appreciated.
 
  Thanks all in advance.
 
  Andy
 


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



[android-beginners] unable to connect Internet through emulator.

2009-09-08 Thread mmkr

Hi,

I'm unable to connect to the Internet through emulator in linux
( ubuntu 9.04 ). It shows me web page not available. But works fine
in windows. Can any one tell me why it is so or any solution? please
help.

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



[android-beginners] onIntentReceived?

2009-09-08 Thread Jeffrey Blattman




this must be simple and i know i'm missing something basic ...

i have a notification that counts some things. until the user clicks
the notification, the count keeps increasing. once they click it, it
should go back to zero. i can't figure out how to hook into when the
notification is clicked. i have an intent that opens an activity when
its clicked, but since the activity already exists, and may be in the
foreground, i assume none of the lifecycle events are being called.

???

thanks.
-- 





[android-beginners] Re: How do you center a TextView inside a layout?

2009-09-08 Thread Justin Anderson
Use: android:gravity=center_horizontal in your xml declaration of the
TextView

Thanks,
--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Mon, Sep 7, 2009 at 4:10 PM, Andrew Louth andrew.lo...@gmail.com wrote:


 I know its possible to center layouts easily using the TableLayout.

 You will find an example here:

 http://droidhut.com/solutions/centered-layouts



 Cheers,

 Andrew Louth

 


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



[android-beginners] Re: How do you center a TextView inside a layout?

2009-09-08 Thread Justin Anderson
Well That will at least center the text, anyway.  In most cases that
should suffice.  Is that what you were after?

Thanks,
--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Tue, Sep 8, 2009 at 10:01 PM, Justin Anderson janderson@gmail.comwrote:

 Use: android:gravity=center_horizontal in your xml declaration of the
 TextView

 Thanks,
 --
 There are only 10 types of people in the world...
 Those who know binary and those who don't.
 --



 On Mon, Sep 7, 2009 at 4:10 PM, Andrew Louth andrew.lo...@gmail.comwrote:


 I know its possible to center layouts easily using the TableLayout.

 You will find an example here:

 http://droidhut.com/solutions/centered-layouts



 Cheers,

 Andrew Louth

 



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



[android-beginners] Re: How to unsubscribe from the e-mail list

2009-09-08 Thread Justin Anderson
Log in to google groups and edit your membership with the group

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Sat, Sep 5, 2009 at 9:18 PM, metefk mete.fikirl...@gmail.com wrote:


 I sent an empty e-mail to android-beginbers-
 unsubscr...@googlegroups.com to remove my e-mail address, but all of
 them failed. Can you please let me know how to unsubscribe?

 Thanks,

 -- Forwarded message --
 From: Mail Delivery Subsystem mailer-dae...@googlemail.com
 Date: Sat, Sep 5, 2009 at 8:13 PM
 Subject: Delivery Status Notification (Failure)
 To: mete.fikirl...@gmail.com


 This is an automatically generated Delivery Status Notification

 Delivery to the following recipient failed permanently:

android-beginners-unsubscr...@googlegroups.com

 Technical details of permanent failure:
 Google tried to deliver your message, but it was rejected by the
 recipient domain. We recommend contacting the other email provider for
 further information about the cause of this error. The error that the
 other server returned was: 550 550-5.1.1 The email account that you
 tried to reach does not exist. Please try
 550-5.1.1 double-checking the recipient's email address for typos or
 550-5.1.1 unnecessary spaces. Learn more at
 550 5.1.1 http://mail.google.com/support/bin/answer.py?answer=6596
 19si310008qyk.0 (state 14).

  - Original message -

 MIME-Version: 1.0
 Received: by 10.220.105.148 with SMTP id t20mr9710503vco.
 96.1252206810578;
   Sat, 05 Sep 2009 20:13:30 -0700 (PDT)
 Date: Sat, 5 Sep 2009 20:13:30 -0700
 Message-ID:
 1cf64a670909052013n58ed84ddo821debd80f6a0...@mail.gmail.com
 Subject: unsubscribe
 From: Mete Fikirlier mete.fikirl...@gmail.com
 To: android-beginners-unsubscr...@googlegroups.com
 Content-Type: multipart/alternative;
 boundary=0016e646925c213f560472e01e53

 --0016e646925c213f560472e01e53
 Content-Type: text/plain; charset=ISO-8859-1

 unsubscribe

 --0016e646925c213f560472e01e53
 Content-Type: text/html; charset=ISO-8859-1

 unsubscribe


  - Message truncated -

 


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



[android-beginners] Re: Change text in textview dynamiclly

2009-09-08 Thread Justin Anderson
Sounds like a case where you are going to want to have separate threads...
one for the UI and one for establishing the socket connection.

The dev guide mentions when this should be done and I believe it also
addresses how to create multiple threads.

Thanks,
--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Tue, Sep 8, 2009 at 12:42 AM, Oskar cov.johans...@gmail.com wrote:


 I would like to print text by default in a textview before I wait for
 a socket connection. When a connection is established I would like to
 receive messages from the client and print them to the screen.

 Hence I would like to first have one message printed and change this
 dynamiclly as time goes. The problem is that nothing is written to the
 screen until Oncreate() has ended.

 Please help me!

 Code:
 -

 package com.example.ComEx;

 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.PrintWriter;
 import java.net.Socket;
 import java.net.UnknownHostException;

 import android.app.Activity;
 import android.os.Bundle;
 import android.widget.TextView;

 public class ComEx extends Activity {
/** Called when the activity is first created. */
private TextView t;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);



Socket kkSocket=null;
PrintWriter out;
BufferedReader in;
t = (TextView) findViewById(R.id.textTest);
printIt(Test the client layout);

try {
kkSocket = new Socket(10.0.2.2, 5000);
} catch (UnknownHostException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}

try {
out = new PrintWriter(kkSocket.getOutputStream(), true);
in = new BufferedReader(new InputStreamReader(

  kkSocket.getInputStream()));
out.println(Hej Oskar);
String fromServer;

while ((fromServer = in.readLine()) != null) {

printIt(Server +fromServer);
if (fromServer.equals(Bye.))
break;

}
}catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


}
private void printIt(String s){
t.setText(new StringBuffer(s));

}
 }

 


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



[android-beginners] Re: Problems with SimpleCursorAdapter

2009-09-08 Thread Justin Anderson
Can you post the logcat information?

Thanks,
--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Sun, Sep 6, 2009 at 4:17 PM, Victor K victor...@gmail.com wrote:


 Hello everybody,

 First, I am sorry if I make some mistakes but I am French (nobody is
 perfect !)
 I am currently developing an application which is not very far from
 the notepad example given by Google.

 I have a modified Database which have 5 rows instead of 2 or 3 for the
 Notepad program.
 So I construct my SimpleCursorAdapter with this :



Cursor notesCursor = mTableConso.fetchAllConso();
// Get all of the rows from the database and create the item
 list
startManagingCursor(notesCursor);

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

// 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};

// Now create a simple cursor adapter and set it to display à
 la place de null mettre : notesCursor


SimpleCursorAdapter conso = new SimpleCursorAdapter(this,
 R.layout.notes_row, notesCursor, from, to);

 __

 So you see it's very close to the original code for the moment (I will
 change everything later). But it crashes ! There is no exception
 generated so I don't know where the problem comes from.

 If I replace notesCursor by null, it works, so I guess it's
 notesCursor who is corrupted... But I don't understand how..

 Someone has an idea to solve my problem ?

 


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



[android-beginners] Re: Help Needed : MediaRecorder error: java.io.IOException: prepare failed

2009-09-08 Thread preetam_pict

Hi all ...

I am seeing following errors in log ... Can someone please help me out
to resolve this ... !


09-08 12:30:26.174: ERROR/MediaPlayer(554): Unable to to create media
player
09-08 12:30:26.183: ERROR/CameraService(554): Failed to load
CameraService sounds.
09-08 12:30:26.203: ERROR/MediaPlayer(554): Unable to to create media
player
09-08 12:30:26.203: ERROR/CameraService(554): Failed to load
CameraService sounds.



thanks
~pp

On Sep 8, 1:49 pm, preetam_pict preetam.pa...@gmail.com wrote:
 Hi all

 I am trying to write a sample program to record the video (say
 camcorder application).
 When i run my program using the emulator (I have android-sdk-
 windows-1.5_r3) I see java.io.IOException: prepare failed. error in
 logcat output.

 Further I can see that I have came across this error when i call
 MediaRecorder.prepare()
 from CamcorderActivity.surfaceCreated()
 But I am surprised to see that activity got launched and I am seeing
 the camera preview!  Again the preview is seen only in half of the
 screen! Its weird!!!

 Further when i do recorder.start() to record the video I get
 java.lang.IllegalStateException. Yes this is obvious since the prepare
 () has failed.
 But the question is why prepare() has failed ?

 Can someone please help me to understand whats happening here!
 Am i missing something ???

 thanks in advance
 ~pp

 Here is my code ...
 package com.example;

 import java.io.IOException;

 import android.app.Activity;
 import android.graphics.PixelFormat;
 import android.media.MediaRecorder;
 import android.os.Bundle;
 import android.util.Log;
 import android.view.KeyEvent;
 import android.view.SurfaceHolder;
 import android.view.SurfaceView;

 public class CamcorderActivity extends Activity implements
        SurfaceHolder.Callback
 {
    private MediaRecorder recorder;
    private SurfaceView   surfaceView;
    private SurfaceHolder surfaceHolder;

    private boolean       recording = false;

    /** Called when the activity is first created. */
   �...@override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        // configure the surface
        getWindow().setFormat(PixelFormat.TRANSLUCENT);
        setContentView(R.layout.main);
        surfaceView = (SurfaceView) findViewById
 (R.id.camcordersurface);
        surfaceHolder = surfaceView.getHolder();
        surfaceHolder.addCallback(this);
        surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
        configureRecorder();
    }

    private void configureRecorder()
    {
        // configure media recorder
        recorder = new MediaRecorder();
        recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
        recorder.setVideoSource(MediaRecorder.VideoSource.DEFAULT);
        recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
        recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
        recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
    }

    private void stopRecorder()
    {
        try
        {
            if (recorder == null)
            {
                return;
            }
            recorder.stop();
            recorder.reset();
            recorder.release();
            recording = false;
            recorder = null;
        }
        finally
        {
            if (recorder != null)
            {
                recorder.release();
            }
        }
    }

    private void startRecorder()
    {
        recorder.start();
        recording = true;
    }

   �...@override
    public boolean onKeyDown(int keyCode, KeyEvent event)
    {
        if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER)
        {
            // if not recording then start
            if (!recording)
            {
                startRecorder();
            }
            else
            {
                // if already recording then stop
                stopRecorder();
                finish();
            }
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }

   �...@override
    public void surfaceChanged(SurfaceHolder holder, int format, int
 width,
            int height)
    {
        // do nothing
    }

   �...@override
    public void surfaceCreated(SurfaceHolder holder)
    {
        recorder.setOutputFile(/sdcard/test + System.currentTimeMillis
 ()
                + .mp4);
        recorder.setPreviewDisplay(holder.getSurface());
        try
        {
            recorder.prepare();
        }
        catch (IOException e)
        {
            Log.e(error -- , e.toString(), e);
            // TODO:
            // show error message
        }
    }

   �...@override
    public void surfaceDestroyed(SurfaceHolder holder)
    {
        stopRecorder();
    }

 }

 And the layout ...

 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
        android:orientation=vertical
 android:layout_width=fill_parent
        

[android-beginners] Re: process com.microjobsinc.mjandroid has stoped unexpectly

2009-09-08 Thread Justin Anderson
Try putting the following line in your manifest file:

uses-sdk android:minSdkVersion=3 /

I don't know if that will fix all of your problems, but that should take
care of the warnings about the API level requirements.

Thanks,
Justin

--
There are only 10 types of people in the world...
Those who know binary and those who don't.
--


On Mon, Sep 7, 2009 at 2:26 PM, boyscout ninja boyscout.ni...@gmail.comwrote:


 Hello!
 I'm a total beginner with Android. I'm just trying to run the sample
 I've found in the O'Reilly Android Aplication Development book
 (MJAndroid). But when I launch the aplication the subject message
 appears.

 Using android-sdk-windows-1.5_r3

 In the java console I've found

 [2009-09-07 22:15:21 - MJAndroid] WARNING: Application does not
 specify an API level requirement!
 [2009-09-07 22:15:21 - MJAndroid] Device API version is 2 (Android
 1.1)

 But the LogCat of the DDMS is plenty of problems:

 09-07 20:09:35.066: ERROR/mountd(19): could not read initial mass
 storage state
 09-07 20:09:35.486: ERROR/flash_image(28): can't find recovery
 partition
 09-07 20:09:48.626: ERROR/MemoryHeapBase(52): error opening /dev/pmem:
 No such file or directory
 09-07 20:09:48.626: ERROR/SurfaceFlinger(52): Couldn't open /sys/
 android_power/wait_for_fb_sleep or /sys/android_power/wait_for_fb_wake
 09-07 20:09:48.695: ERROR/GLLogger(52): couldn't load libhgl.so
 library (Cannot find library)
 09-07 20:09:48.835: ERROR/GLLogger(52): couldn't load libhgl.so
 library (Cannot find library)
 09-07 20:09:53.656: ERROR/BatteryService(52): Could not open '/sys/
 class/power_supply/usb/online'
 09-07 20:09:53.656: ERROR/BatteryService(52): Could not open '/sys/
 class/power_supply/battery/batt_vol'
 09-07 20:09:53.656: ERROR/BatteryService(52): Could not open '/sys/
 class/power_supply/battery/batt_temp'
 09-07 20:09:54.045: ERROR/EventHub(52): could not get driver version
 for /dev/input/mouse0, Not a typewriter
 09-07 20:09:54.087: ERROR/EventHub(52): could not get driver version
 for /dev/input/mice, Not a typewriter
 09-07 20:09:54.125: ERROR/System(52): Failure starting core service
 09-07 20:09:54.125: ERROR/System(52): java.lang.SecurityException
 09-07 20:09:54.125: ERROR/System(52): at
 android.os.BinderProxy.transact(Native Method)
 09-07 20:09:54.125: ERROR/System(52): at
 android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:
 146)
 09-07 20:09:54.125: ERROR/System(52): at
 android.os.ServiceManager.addService(ServiceManager.java:72)
 09-07 20:09:54.125: ERROR/System(52): at
 com.android.server.ServerThread.run(SystemServer.java:155)
 09-07 20:09:54.147: ERROR/AndroidRuntime(52): Crash logging skipped,
 no checkin service
 09-07 20:09:54.896: ERROR/SystemServer(52): Failure starting
 StatusBarService
 09-07 20:09:54.896: ERROR/SystemServer(52):
 java.lang.NullPointerException
 09-07 20:09:54.896: ERROR/SystemServer(52): at
 com.android.server.status.StatusBarPolicy.updateBluetooth
 (StatusBarPolicy.java:762)
 09-07 20:09:54.896: ERROR/SystemServer(52): at
 com.android.server.status.StatusBarPolicy.init(StatusBarPolicy.java:
 285)
 09-07 20:09:54.896: ERROR/SystemServer(52): at
 com.android.server.status.StatusBarPolicy.installIcons
 (StatusBarPolicy.java:341)
 09-07 20:09:54.896: ERROR/SystemServer(52): at
 com.android.server.ServerThread.run(SystemServer.java:182)
 09-07 20:09:54.905: ERROR/AndroidRuntime(52): Crash logging skipped,
 no checkin service
 09-07 20:09:55.526: ERROR/GpsLocationProvider(52): Could not open GPS
 configuration file /etc/gps.conf
 09-07 20:09:55.526: ERROR/GpsLocationProvider(52):
 java.io.FileNotFoundException: /etc/gps.conf
 09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
 org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:
 227)
 09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
 java.io.FileInputStream.init(FileInputStream.java:76)
 09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
 com.android.internal.location.GpsLocationProvider.init
 (GpsLocationProvider.java:179)
 09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
 com.android.server.LocationManagerService._loadProvidersNoSync
 (LocationManagerService.java:356)
 09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
 com.android.server.LocationManagerService.loadProvidersNoSync
 (LocationManagerService.java:340)
 09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
 com.android.server.LocationManagerService.loadProviders
 (LocationManagerService.java:333)
 09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
 com.android.server.LocationManagerService.init
 (LocationManagerService.java:447)
 09-07 20:09:55.526: ERROR/GpsLocationProvider(52): at
 com.android.server.ServerThread.run(SystemServer.java:235)
 09-07 20:09:55.535: ERROR/AndroidRuntime(52): Crash logging