[android-developers] Re: Downloading any file using browser.

2008-09-07 Thread otiasj

Hello,

Does anyone now how to actually download the file?

Right now when I click on the file of a certain type, my activity
launches correctly
and I get the url using getIntent().getData()
But is there a way to use the download manager? (through a
contentProvider for example)

Thank you



On 4 sep, 21:29, szeldon <[EMAIL PROTECTED]> wrote:
> Thanks. It really works. Knowledge +1
>
> On Sep 4, 1:28 pm, Peli <[EMAIL PROTECTED]> wrote:
>
> > You could write an intent filter in the following way:
>
> >        
> >             
> >                 
> >                  > android:name="android.intent.category.DEFAULT" />
> >                  > android:name="android.intent.category.BROWSABLE" />
> >                 
> >                 
> >            
> >         
>
> > Here you have to replace "?" by the mime-type you intend to
> > handle. Then your activity will be called by thebrowser, and you can
> > use getIntent() 
> > (http://code.google.com/android/reference/android/app/Activity.html#ge...()
> > ) to get more information about the intent.
>
> > Peliwww.openintents.org
>
> > On Sep 4, 11:12 am, szeldon <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > Currently I'm working on a program that needs to download files using
> > > defaultbrowser, saving them somewhere (it may be a mobile/emulator or
> > > SD card on one of them) and then using my program with them. It would
> > > be great if my program could react on specific filetype opened by a
> > >browser, but if that's not possible, I'd at least like save to them.
> > > Opening could be done in my application.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Downloading any file using browser.

2008-09-07 Thread otiasj

Hello,
Does anyone know how to actually download the file?

If I do what you say, I can launch an activity when I click on a
certain link in the browser,
but the file does not start downloading in the download manager.
I can get the url through getIntent().getData(), but I wonder if there
is anyway to get the file from the download manager. (maybe using a
contentProvider?)

Thank you

On 4 sep, 18:12, szeldon <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Currently I'm working on a program that needs to download files using
> defaultbrowser, saving them somewhere (it may be a mobile/emulator or
> SD card on one of them) and then using my program with them. It would
> be great if my program could react on specific filetype opened by abrowser, 
> but if that's not possible, I'd at least like save to them.
> Opening could be done in my application.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Change color of RatingBar stars

2008-09-07 Thread Christian Wiesbauer
Hello, 
 
is it possible to change the color of the stars of a RatingBar? I also want
to change the style of the borders if it’s possible.
 
Thanks,
Christian Wiesbauer 
 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView

2008-09-07 Thread dai

Hi...somebody knows the way to keep web surfing on WebView
component..?
Does WebView allow to show web page at first so far?

Thanks in advnace

On 9月7日, 午後5:53, "Dai Odahara" <[EMAIL PROTECTED]> wrote:
> hi I mean that I do nt open new window. Is it possible not to open web
> window from web view comp?
>
> On 9/7/08, dai <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm trying to display web page (html / javascript) on WebView
> > component.
> > You know, it's ok to show the page on the WebView comp initially but
> > after clicking a link (like weather, finance), the web-browser
> > embedded on Android originally.
>
> > Does someone know how to keep showing web page on the WebView
> > componenet??
>
> > Thank you very much
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView loadUrl does not seem to work...

2008-09-07 Thread dai

Hi, Megha. Thank you very much. it works well by enabling javasript.
Grazie so much

On 9月7日, 午後7:01, "Megha Joshi" <[EMAIL PROTECTED]> wrote:
> 2008/9/7 dai <[EMAIL PROTECTED]>
>
>
>
> > Hi, Mark. I'm also wondering why accessting to google.com shows
> > white..
> > it might be happening because of javasript or something..?
>
> Yes you are on the right track...please see the resolution at the link
> below:http://code.google.com/p/android/issues/detail?id=678
>
>
>
> > Thank you so much
>
> > On 9月6日, 午前9:57, Mark Murphy <[EMAIL PROTECTED]> wrote:
> > > RPO wrote:
> > > > This sample is from your book (which I subscribed to)!
>
> > > Well, then *clearly* some moron wrote that example!
>
> > > Oh, wait...
>
> > > ;-)
>
> > > More seriously, version 1.2 of the book -- certified for Android 0.9 SDK
> > > -- should be available within 48 hours, barring a shift in 'urricane
> > > 'anna's path to cause me problems.
>
> > > By eyeball, the only serious difference I see between yours and my
> > > updated one is your choice of URLs to load.
>
> > > And I just tried it, and usingwww.google.comfailsfor me too.
>
> > > I ran into this problem with M5 as well. I tried Google's home page, got
> > > nothing, tried mine, got it to work, and wrote it off as a
> > > browser-sniffing problem on Google's server.
>
> > > And it's not like I broke into the Android version control system and
> > > hacked it to only show the CommonsWare site -- 
> > > news.google.comandwww.yahoo.comworkfine, as I've tried them just now.
>
> > > So, I'm still chalking it up to being something with the Google home
> > > page. After all, there's virtually no code to the sample, so it's
> > > difficult to imagine how it could be right for these other pages and
> > > wrong for the Google home page.
>
> > > I apologize for the difficulty. And thanks for subscribing!
>
> > > --
> > > Mark Murphy (a Commons Guy)http://commonsware.com
> > > _The Busy Coder's Guide to Android Development_ Version 1.1 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android SoftKeyboard Released(Both English and Chinese Input) !

2008-09-07 Thread PowerGUI

I have not handwriting recognition code in hand,that needs third party
support.
If somebody has such library,I can integrated it with the
softkeyboard.

Best Regards
PowerGUI
--
Android DotPhone Team
http://www.dotphone.org/english/
http://groups.google.com/group/android-dotphone

On 9月7日, 上午3时23分, Eric <[EMAIL PROTECTED]> wrote:
> Nice work.
> Going to support character recognition next?
>
> Eric
> Portable Electronics Ltdwww.hdmp4.com
>
> On Sep 7, 1:09 am, PowerGUI <[EMAIL PROTECTED]> wrote:
>
> > Dear Androiders,
> >   I am glad to release the Android SoftKeyboard,support both
> > English and Chinese input use SoftKeyboard. If you have android
> > dotphone development evaluation or other android hardware which
> > supports touchscreen, it is also for you.   :D
> >   here is the steps:
> >  1)please download the TestSoftKeyboard.tgz and SoftKey.apk
> >  2)adb install SoftKey.apk
> >  3)extract the TestSoftKeyboard.tgz,you can compile it.then
> > generate
> > TestSoftKeyboard.apk (or TestSoftKeyboad-debug.apk)
> >  4)adb install TestSoftKeyboard.apk (a compiled
> > TestSoftkeyboard.apk is ready,please checkt it)
> >  5)when the window of TestSoftKeyboard.apk appears,then click the
> > edittext area(need click two times,bugs in android?), popup the
> > SoftKeyboard windows,input anythings as you like.
> >  6)click ok or cancel to return your window
> >  7)TestSoftKeyboard is just a samples,you can use the same rule to
> > make your program to support input method.
>
> >   the screenshot ,related program and TestSoftKeyboard Source code
> > is avaiable at:
> >   1)http://www.dotphone.org/english
> >   2)http://groups.google.com/group/android-dotphone
>
> > Any feedbacks is appreciate.
>
> > Best Regards
> > Android DotPhone Teamhttp://www.dotphone.org/english/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Code working in standalone java; doesnot work in android (android-sdk-windows-0.9_beta)

2008-09-07 Thread haig

I am having similar problems, hope someone can help.

In my example, "myService" is a GoogleService

GoogleService myService = new GoogleService("blogger", "exampleCo-
exampleApp-1");

Standalone client works fine, but not in my android app.

Error from logcat:

 com.google.gdata.util.AuthenticationException: Error connecting with
login URI
 at
com.google.gdata.client.GoogleAuthTokenFactory.getAuthToken(Unknown
Source)
 at
com.google.gdata.client.GoogleAuthTokenFactory.setUserCredentials(Unknown
Source)
 at
com.google.gdata.client.GoogleService.setUserCredentials(Unknown
Source)
 at
com.google.gdata.client.GoogleService.setUserCredentials(Unknown
Source)
 at com.travelrecorder.network.Blogger.publish_post(Blogger.java:
32)
 at com.travelrecorder.network.AlarmService_Service
$1.run(AlarmService_Service.java:71)
 at java.lang.Thread.run(Thread.java:914)
 Caused by: java.io.IOException: Hostname  was not
verified
 at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.getSecureSocket(HttpConnection.java:
169)
 at
org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnection
$HttpsEngine.connect(HttpsURLConnection.java:398)
 at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:
1129)
 at
org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnection.getOutputStream(HttpsURLConnection.java:
262)
 at
com.google.gdata.client.GoogleAuthTokenFactory.makePostRequest(Unknown
Source)
 ... 7 more



On Aug 25, 1:40 pm, "Justin (Google Employee)" <[EMAIL PROTECTED]>
wrote:
> You didn't answer what type "myService" is here.
>
> Cheers,
> Justin
> Android Team @ Google

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem with sensors

2008-09-07 Thread Peli

The Android emulator is currently set up so that it returns that no
sensors are available.
(you can check this with the SensorsManager method getSensors() which
returns 0).

One way to simulate sensors on Android is to use the OpenIntents
SensorSimulator:

http://www.openintents.org/en/node/6
http://www.openintents.org/en/download

This can simulate orientation, accelerometer, and compass sensors,
(even the temperature sensor), through the same API that Android uses.
One only needs to replace the system's SensorManager by the
OpenIntents SensorManager. Please have a look at the samples provided
with the download there (OpenGLSensors and ApiDemosSensors) to see how
to set things up.

Let me know if you have further questions.

Peli
www.openintents.org

On 7 Sep., 15:30, max <[EMAIL PROTECTED]> wrote:
> I'm trying to access the sensors under the new 0.9 SDK. But I just
> don't get it to work. I distilled the essential code from the API
> demos, but registerListener() always returns false and I get this on
> logcat: "W/SensorService(   46): could not enable sensor 1". This is
> the code:
>
> public class TestActivity extends Activity {
>
>     @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         mSensorManager =
> (SensorManager)getSystemService(Context.SENSOR_SERVICE);
>         setContentView(R.layout.main);
>     }
>
>     @Override
>     protected void onResume()
>     {
>         super.onResume();
>         mSensorManager.registerListener(mListener,
> SensorManager.SENSOR_ORIENTATION, SensorManager.SENSOR_DELAY_GAME);
>     }
>
>     @Override
>     protected void onStop()
>     {
>         mSensorManager.unregisterListener(mListener);
>         super.onStop();
>     }
>
>     private SensorManager mSensorManager;
>     private final SensorListener mListener = new SensorListener() {
>         public void onSensorChanged(int sensor, float[] values) {
>                 Log.i("*","SENSOR CHANGED");
>         }
>     };
>
>
>
> }- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] send SMS

2008-09-07 Thread jphdsn

hello, I'm a new french developer on android.


I try the "SMSAPISample" but it doesn't work.

"import android.app.PendingIntent" is not recognize.

I 've take a look to the documentation and It seems that there is no
other way to send SMS.

Someone have tried and succeed with the sample or with another method?

Someone have a response?  thank's



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to display a local file in the browser?

2008-09-07 Thread [EMAIL PROTECTED]

Nothing to do.
I wrote a ContentProvider returning a cursor pointing to a database
record having '_id' and '_data' columns filled (the last one contains
a full path to the file, as remarked on the documentation, in case of
binary data).
Passing url 'content://polito.mailandroid/1' to WebView method
loadUrl, it notifies that there's no supported file.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] getFromLocation not returning street names

2008-09-07 Thread Huebi

I am just wondering why the Geocoder does not return street names if I
do reverse geocoding. Will that be added somewhen? Will it be
available in the final version used on the phones?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Problem with sensors

2008-09-07 Thread max

I'm trying to access the sensors under the new 0.9 SDK. But I just
don't get it to work. I distilled the essential code from the API
demos, but registerListener() always returns false and I get this on
logcat: "W/SensorService(   46): could not enable sensor 1". This is
the code:

public class TestActivity extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mSensorManager =
(SensorManager)getSystemService(Context.SENSOR_SERVICE);
setContentView(R.layout.main);
}

@Override
protected void onResume()
{
super.onResume();
mSensorManager.registerListener(mListener,
SensorManager.SENSOR_ORIENTATION, SensorManager.SENSOR_DELAY_GAME);
}

@Override
protected void onStop()
{
mSensorManager.unregisterListener(mListener);
super.onStop();
}

private SensorManager mSensorManager;
private final SensorListener mListener = new SensorListener() {
public void onSensorChanged(int sensor, float[] values) {
Log.i("*","SENSOR CHANGED");
}
};

}


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Android SoftKeyboard Released(Both English and Chinese Input) !

2008-09-07 Thread Eric

Nice work.
Going to support character recognition next?

Eric
Portable Electronics Ltd
www.hdmp4.com

On Sep 7, 1:09 am, PowerGUI <[EMAIL PROTECTED]> wrote:
> Dear Androiders,
>       I am glad to release the Android SoftKeyboard,support both
> English and Chinese input use SoftKeyboard. If you have android
> dotphone development evaluation or other android hardware which
> supports touchscreen, it is also for you.   :D
>       here is the steps:
>      1)please download the TestSoftKeyboard.tgz and SoftKey.apk
>      2)adb install SoftKey.apk
>      3)extract the TestSoftKeyboard.tgz,you can compile it.then
> generate
> TestSoftKeyboard.apk (or TestSoftKeyboad-debug.apk)
>      4)adb install TestSoftKeyboard.apk (a compiled
> TestSoftkeyboard.apk is ready,please checkt it)
>      5)when the window of TestSoftKeyboard.apk appears,then click the
> edittext area(need click two times,bugs in android?), popup the
> SoftKeyboard windows,input anythings as you like.
>      6)click ok or cancel to return your window
>      7)TestSoftKeyboard is just a samples,you can use the same rule to
> make your program to support input method.
>
>       the screenshot ,related program and TestSoftKeyboard Source code
> is avaiable at:
>       1)http://www.dotphone.org/english
>       2)http://groups.google.com/group/android-dotphone
>
> Any feedbacks is appreciate.
>
> Best Regards
> Android DotPhone Teamhttp://www.dotphone.org/english/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView loadUrl does not seem to work...

2008-09-07 Thread Megha Joshi
2008/9/7 dai <[EMAIL PROTECTED]>

>
> Hi, Mark. I'm also wondering why accessting to google.com shows
> white..
> it might be happening because of javasript or something..?


Yes you are on the right track...please see the resolution at the link
below:
http://code.google.com/p/android/issues/detail?id=678

>
>
> Thank you so much
>
> On 9月6日, 午前9:57, Mark Murphy <[EMAIL PROTECTED]> wrote:
> > RPO wrote:
> > > This sample is from your book (which I subscribed to)!
> >
> > Well, then *clearly* some moron wrote that example!
> >
> > Oh, wait...
> >
> > ;-)
> >
> > More seriously, version 1.2 of the book -- certified for Android 0.9 SDK
> > -- should be available within 48 hours, barring a shift in 'urricane
> > 'anna's path to cause me problems.
> >
> > By eyeball, the only serious difference I see between yours and my
> > updated one is your choice of URLs to load.
> >
> > And I just tried it, and usingwww.google.comfails for me too.
> >
> > I ran into this problem with M5 as well. I tried Google's home page, got
> > nothing, tried mine, got it to work, and wrote it off as a
> > browser-sniffing problem on Google's server.
> >
> > And it's not like I broke into the Android version control system and
> > hacked it to only show the CommonsWare site -- 
> > news.google.comandwww.yahoo.comwork fine, as I've tried them just now.
> >
> > So, I'm still chalking it up to being something with the Google home
> > page. After all, there's virtually no code to the sample, so it's
> > difficult to imagine how it could be right for these other pages and
> > wrong for the Google home page.
> >
> > I apologize for the difficulty. And thanks for subscribing!
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > _The Busy Coder's Guide to Android Development_ Version 1.1 Published!
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView

2008-09-07 Thread Dai Odahara

hi I mean that I do nt open new window. Is it possible not to open web
window from web view comp?

On 9/7/08, dai <[EMAIL PROTECTED]> wrote:
>
> I'm trying to display web page (html / javascript) on WebView
> component.
> You know, it's ok to show the page on the WebView comp initially but
> after clicking a link (like weather, finance), the web-browser
> embedded on Android originally.
>
> Does someone know how to keep showing web page on the WebView
> componenet??
>
> Thank you very much
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: UnsupportedOperationException: ArrayAdapter's add and insert methods

2008-09-07 Thread Romain Guy

No, the documentation at
http://code.google.com/android/reference/android/widget/ArrayAdapter.html
shows two constructors to which you can pass a List.

On Sat, Sep 6, 2008 at 11:20 PM, squeakypants <[EMAIL PROTECTED]> wrote:
>
> Thanks, that did it! :)
>
> The docs said Object[], so I assumed only an array could be passed.
>
> --squeakypants
>
> On Sep 6, 9:37 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote:
>> It's because you passed an array of Integer[]. Pass a List
>> instead and you will be able to add/remove/insert/etc.
>>
>>
>>
>> On Sat, Sep 6, 2008 at 3:40 PM, squeakypants <[EMAIL PROTECTED]> wrote:
>>
>> > I've created an ArrayAdapter for a ListView as such:
>> >aa = new ArrayAdapter(
>> >this,
>> >R.layout.centered_list,
>> >new Integer[] {0,1,2});
>> > (very similarly, anyway)
>>
>> > If I try using aa.add(3) or aa.insert(3,3), I get an
>> > UnsupportedOperationException. Here's the full output:
>> > 09-06 18:22:07.102: WARN/dalvikvm(1643): threadid=3: thread exiting
>> > with uncaught exception (group=0x40010e28)
>> > 09-06 18:22:07.102: ERROR/AndroidRuntime(1643): Uncaught handler:
>> > thread main exiting due to uncaught exception
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):
>> > java.lang.UnsupportedOperationException
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > java.util.AbstractList.add(AbstractList.java:399)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.widget.ArrayAdapter.insert(ArrayAdapter.java:194)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > the.android.DiceRoller.DiceRoller.add_num(DiceRoller.java:52)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > the.android.DiceRoller.DiceRoller$3.onClick(DiceRoller.java:139)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.view.View.performClick(View.java:2068)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.view.View.onTouchEvent(View.java:3453)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.widget.TextView.onTouchEvent(TextView.java:4347)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.view.View.dispatchTouchEvent(View.java:3108)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > com.android.internal.policy.impl.PhoneWindow
>> > $DecorView.superDispatchTouchEvent(PhoneWindow.java:1552)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneW
>> >  indow.java:
>> > 1059)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.app.Dialog.dispatchTouchEvent(Dialog.java:562)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > com.android.internal.policy.impl.PhoneWindow
>> > $DecorView.dispatchTouchEvent(PhoneWindow.java:1536)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.view.ViewRoot.handleMessage(ViewRoot.java:1088)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.os.Handler.dispatchMessage(Handler.java:88)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.os.Looper.loop(Looper.java:123)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > android.app.ActivityThread.main(ActivityThread.java:3708)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > java.lang.reflect.Method.invokeNative(Native Method)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > java.lang.reflect.Method.invoke(Method.java:492)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > com.android.internal.os.ZygoteInit
>> > $MethodAndArgsCaller.run(ZygoteInit.java:734)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:492)
>> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643): at
>> > dalvik.system.NativeStart.main(Native Method)
>>
>> > The only problem I can think of is that it is an "Array"Adapter,
>> > rather than another form of container, but I assumed that was only
>> > because you input an array. Why even have add, insert, or remove
>> > methods?
>>
>> > Does anyone else get this exception? Does anyone have a fix?
>>
>> --
>> Romain Guywww.curious-creature.org
>
> 

[android-developers] Re: UnsupportedOperationException: ArrayAdapter's add and insert methods

2008-09-07 Thread squeakypants

Thanks, that did it! :)

The docs said Object[], so I assumed only an array could be passed.

--squeakypants

On Sep 6, 9:37 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote:
> It's because you passed an array of Integer[]. Pass a List
> instead and you will be able to add/remove/insert/etc.
>
>
>
> On Sat, Sep 6, 2008 at 3:40 PM, squeakypants <[EMAIL PROTECTED]> wrote:
>
> > I've created an ArrayAdapter for a ListView as such:
> >        aa = new ArrayAdapter(
> >                        this,
> >                        R.layout.centered_list,
> >                        new Integer[] {0,1,2});
> > (very similarly, anyway)
>
> > If I try using aa.add(3) or aa.insert(3,3), I get an
> > UnsupportedOperationException. Here's the full output:
> > 09-06 18:22:07.102: WARN/dalvikvm(1643): threadid=3: thread exiting
> > with uncaught exception (group=0x40010e28)
> > 09-06 18:22:07.102: ERROR/AndroidRuntime(1643): Uncaught handler:
> > thread main exiting due to uncaught exception
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):
> > java.lang.UnsupportedOperationException
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > java.util.AbstractList.add(AbstractList.java:399)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.widget.ArrayAdapter.insert(ArrayAdapter.java:194)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > the.android.DiceRoller.DiceRoller.add_num(DiceRoller.java:52)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > the.android.DiceRoller.DiceRoller$3.onClick(DiceRoller.java:139)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.view.View.performClick(View.java:2068)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.view.View.onTouchEvent(View.java:3453)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.widget.TextView.onTouchEvent(TextView.java:4347)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.view.View.dispatchTouchEvent(View.java:3108)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:841)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > com.android.internal.policy.impl.PhoneWindow
> > $DecorView.superDispatchTouchEvent(PhoneWindow.java:1552)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneW 
> > indow.java:
> > 1059)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.app.Dialog.dispatchTouchEvent(Dialog.java:562)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > com.android.internal.policy.impl.PhoneWindow
> > $DecorView.dispatchTouchEvent(PhoneWindow.java:1536)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.view.ViewRoot.handleMessage(ViewRoot.java:1088)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.os.Handler.dispatchMessage(Handler.java:88)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.os.Looper.loop(Looper.java:123)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > android.app.ActivityThread.main(ActivityThread.java:3708)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > java.lang.reflect.Method.invokeNative(Native Method)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > java.lang.reflect.Method.invoke(Method.java:492)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > com.android.internal.os.ZygoteInit
> > $MethodAndArgsCaller.run(ZygoteInit.java:734)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:492)
> > 09-06 18:22:07.160: ERROR/AndroidRuntime(1643):     at
> > dalvik.system.NativeStart.main(Native Method)
>
> > The only problem I can think of is that it is an "Array"Adapter,
> > rather than another form of container, but I assumed that was only
> > because you input an array. Why even have add, insert, or remove
> > methods?
>
> > Does anyone else get this exception? Does anyone have a fix?
>
> --
> Romain Guywww.curious-creature.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK bet

[android-developers] Using socket connection in 9 beta

2008-09-07 Thread [EMAIL PROTECTED]

Hi!
Can anybody explain why new Socket("10.0.2.2",9009); does not work in
9 beta?
It worked in m5.

Thank you.
Vit

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] several wav sounds in Beta 9 plaies bad

2008-09-07 Thread [EMAIL PROTECTED]

Hi!
Can anybody say, why several wav sounds in Beta 9 plaies bad?
One or two lpays good, but next plays half path or not plays?
In m5 all wasgood.
Thank's
Vit

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] connecting to "127.0.0.1" via "10.0.2.2" in Beta 9

2008-09-07 Thread [EMAIL PROTECTED]

Could anybody use Socket() for connecting to "127.0.0.1" via
"10.0.2.2" in Beta 9?
It worked in m5, but doesn't work in in Beta 9.
Thank's
Vit

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: WebView loadUrl does not seem to work...

2008-09-07 Thread dai

Hi, Mark. I'm also wondering why accessting to google.com shows
white..
it might be happening because of javasript or something..?

Thank you so much

On 9月6日, 午前9:57, Mark Murphy <[EMAIL PROTECTED]> wrote:
> RPO wrote:
> > This sample is from your book (which I subscribed to)!
>
> Well, then *clearly* some moron wrote that example!
>
> Oh, wait...
>
> ;-)
>
> More seriously, version 1.2 of the book -- certified for Android 0.9 SDK
> -- should be available within 48 hours, barring a shift in 'urricane
> 'anna's path to cause me problems.
>
> By eyeball, the only serious difference I see between yours and my
> updated one is your choice of URLs to load.
>
> And I just tried it, and usingwww.google.comfails for me too.
>
> I ran into this problem with M5 as well. I tried Google's home page, got
> nothing, tried mine, got it to work, and wrote it off as a
> browser-sniffing problem on Google's server.
>
> And it's not like I broke into the Android version control system and
> hacked it to only show the CommonsWare site -- news.google.com 
> andwww.yahoo.comwork fine, as I've tried them just now.
>
> So, I'm still chalking it up to being something with the Google home
> page. After all, there's virtually no code to the sample, so it's
> difficult to imagine how it could be right for these other pages and
> wrong for the Google home page.
>
> I apologize for the difficulty. And thanks for subscribing!
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.1 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] WebView

2008-09-07 Thread dai

I'm trying to display web page (html / javascript) on WebView
component.
You know, it's ok to show the page on the WebView comp initially but
after clicking a link (like weather, finance), the web-browser
embedded on Android originally.

Does someone know how to keep showing web page on the WebView
componenet??

Thank you very much
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Phone states?

2008-09-07 Thread Peli

> What I'll like to do is to start a LBS service at phone boot and then
> bring up a message when I reach a certain GPS position.

Applications should not "pop up" a message, but rather use
notification:

>From the docs:
"Notifications can take different forms:
* A persistent icon that goes in the status bar and is accessible
through the launcher, (when the user selects it, a designated Intent
can be launched),
* Turning on or flashing LEDs on the device, or
* Alerting the user by flashing the backlight, playing a sound, or
vibrating. "
http://code.google.com/android/reference/android/app/NotificationManager.html

See also API Demos / App / Notification / Notifying Service Controller

I guess the framework will take care that the notification reaches the
user propely.

Peli
www.openintents.org


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListActivity getSelectedItemId() and AlertDialog()

2008-09-07 Thread Peli

> Is there any examples in the ApiDemos?

Yes:
* API Demos / Views / Expandable Lists / 1. Custom Adapter
* API Demos / Views / Gallery / 1. Photos

Peli
www.openintents.org

>
> Best regards,
>
>   Jorge
>
> On Sep 6, 11:34 pm, Peli <[EMAIL PROTECTED]> wrote:
>
>
>
> > > it seems more convenient to me
> > > to delete from the list view (as in the tutorial) than having to get
> > > into each of the items (like in the contacts application).
>
> > You don't have to get into each item in the contacts application. This
> > is just one possibility. The second possibility is: in the contacts
> > tab where you see the list of all contacts lng click on a
> > contact. Then a context menu opens where you can select "delete"
> > directly.
>
> > Peli- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Orientation changes simulation

2008-09-07 Thread Peli

Hi blindfold,

> How can I have a simple switch (in Eclipse) during
> the development cycle such that I can easily build with and without
> the OpenIntents Sensor simulator?

By default, the SensorManagerSimulator transparently passes requests
to Android's internal sensor, so if you remove the line
requiresOpenIntents() and deactivate the menus for Settings and
Connect, you have your original functionality back. (even though OI
code remains that increases your apk file size).

If you completely want to get rid of OI code, I guess there is no way
other than manually removing the lib from your project and commenting
out the two additional OI code sections in your code - which is
quickly done.

Maybe you can set up two projects in Eclipse: One is your original
project, and the second one is your test project that depends on the
first project, but additionally contains the lib. I haven't actually
tried this, and I don't know if it is worth the effort, given that one
can easily add lib + code section in a few minutes and remove them
(remove lib and comment out code) before distribution in a few seconds
without leaving any traces.

Let me know if you have further questions.

Peli

On 7 Sep., 08:31, blindfold <[EMAIL PROTECTED]> wrote:
> Thanks Peli! I may check it out if I do not fully trust my
> compass. :-)
>
> From your readme.txt:
>
> > To use this JAR file in another project:
>
> > 1) Create a "lib" folder in your project and
> >    copy openintents-lib.jar there.
>
> > 2) In the package explorer, right-click on your project, select
> >    "Properties", then "Java Build Path"/"Libraries".
>
> > 3) "Add JARs...". Select "lib/openintents-lib.jar"
>
> In view of step 1) How can I have a simple switch (in Eclipse) during
> the development cycle such that I can easily build with and without
> the OpenIntents Sensor simulator? I have to make absolutely sure that
> my release builds will not accidentally contain some trace of
> OpenIntents as used for testing.
>
> Regards
>
> The vOICe Android for Android Phoneshttp://www.seeingwithsound.com/android.htm
>
> On Sep 7, 12:52 am, Peli <[EMAIL PROTECTED]> wrote:
>
>
>
> > Just to let you know, we have updated the OpenIntents Sensor simulator
> > to work with the SDK 
> > 0.9.http://www.openintents.org/en/http://www.openintents.org/en/download
>
> > We have also modified the API demos slightly to work with the sensor
> > simulator:http://www.openintents.org/en/node/32
>
> > Sensor values that are provided by the simulator agree with the
> > conventions outlined in the documentation.
> > blindfold, this should give you the tools to test your talking
> > compass :-)
>
> > Peliwww.openintents.org- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new Android 0.9 SDK beta!
http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---