[android-developers] Re: Idle time in android?

2009-10-16 Thread pk

Also i want to add that i need to do this in the SDK build.I saw how
this works in the framework code but there seems to be no way to find
if the device has been idle from the released sdk apis.

On Oct 15, 1:32 pm, pk prabhakarku...@gmail.com wrote:
 Hi,

 I have an application(service) that needs to display an activity if
 there has been no user activity for a certain period.Is there any way
 to detect if a device has been idle for a certain time or not?
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread Beowolve

I take one too, if you have some left. Thx a lot

On 16 Okt., 05:41, Kenneth Adam Miller kennethadammil...@gmail.com
wrote:
 Who wants to be in Google wave?
 I have 16 invitations
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to find out if a device has flash player

2009-10-16 Thread tomei.ninge...@gmail.com

Is there a programmatic way on Android (inside Java code, or in
JavaScript code in a WebView) to determine if the device has flash
player?
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] ADC2 Tea-Party2

2009-10-16 Thread Mobidev

Any news from your sources regarding progress/start of ADC2 Round2 Tea-
Party? I’m looking forward to taste at least 50 cups of tea out of 200
that will be offered.

Isn’t it taking a bit longer to review Round-1 scores? Though we are
not in position to judge how complex it might get beind the scene to
review 1219*103 scores. Yet, what’s your best guess that’s taking it
so long?

I believe best 200 apps are now identified and preparations are
underway to provide these to expert-judges on 1.5 devices. If you
missed ADC1, apps were deployed on 140 cloned- laptops(Ubuntu) and 115
of these were shipped globally. If you weren’t here during ADC1 and
haven’t come across Dan’s ADC1 behind-the-scene post, you can find it
here: 
http://android-developers.blogspot.com/2008/05/challenge-in-more-than-one-way.html

Well that was pre-G1 era. Though devices are available now, I don’t
think all “expert” judges will be able to discover the ADC2 judging
app to start with. Also, community-judging app “as-is” may not be
suitable for judging by the experts. They might not be allowed to skip
a cup of stewed tea if it is offered by the app. ADC1 took great care
to provide neutral and identical judging environment. Similarly ADC2
might provide a separate judging platform (1.5 device and a modified
judging app) to expert-judges.

When will the Round2 start? Calculating it in reverse chronological
order. ADC2 ends by last week of November. Two weeks before that to
collate the scores and get the winners list out. A cooling-off week to
let the judging app stop accepting reviews from community judges. Two
weeks to judge the apps after announcing the start of judging for
Round 2 (which again might be cut short for same reason). So that
brings us to expect Round 2 announcement either today or latest by
next week. It’s appreciated that Adc2 has not seen any slippage from
announced dates so far.

P.S
Tea isn’t my cup of tea.
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Confusion about necessity to override onConfigurationChanged()

2009-10-16 Thread westmeadboy

OK thanks for explaining.

So, overriding onConfigurationChanged() is for handling resource
differences resulting from the configuration change rather than just
redrawing the screen (using the existing resources).

On Oct 16, 12:58 am, Dianne Hackborn hack...@android.com wrote:
 You are using layout managers that know how to layout to different screen
 sizes.  Note, however, that any resources you have that change for landscape
 vs. portrait will -not- be changed.

 On Thu, Oct 15, 2009 at 4:52 AM, westmeadboy westmead...@yahoo.co.ukwrote:







  I've seen numerous posts about letting the app control the handling of
  orientation changes by setting the android:configChanges attribute
  and overriding onConfigurationChanged().

  However, it seems that its not necessary to override
  onConfigurationChanged() at all. How is this possible?

  I have a simple activity containing a ListView containing many items
  (TextViews). I'm not overriding onConfigurationChanged() but when the
  orientation is changed everything is redrawn/scaled perfectly. I can
  confirm that the activity is not being destroyed and recreated.

  I'm sure there is a perfectly logical explanation for this, but I
  would be very interested to know what that is!

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread Evgeny V
Yes, please.
Thanks,
Evgeny

On Fri, Oct 16, 2009 at 5:41 AM, Kenneth Adam Miller 
kennethadammil...@gmail.com wrote:

 Who wants to be in Google wave?
 I have 16 invitations

 


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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread ani rudh
one for me please :) , thanks

On Fri, Oct 16, 2009 at 12:06 PM, Evgeny V evgen...@gmail.com wrote:

 Yes, please.
 Thanks,
 Evgeny

 On Fri, Oct 16, 2009 at 5:41 AM, Kenneth Adam Miller 
 kennethadammil...@gmail.com wrote:

 Who wants to be in Google wave?
 I have 16 invitations




 



-- 
@nirudh

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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread Desu Vinod Kumar
HI me also One ...please...


On Fri, Oct 16, 2009 at 12:08 PM, ani rudh anirudh11777s...@gmail.comwrote:

 one for me please :) , thanks

 On Fri, Oct 16, 2009 at 12:06 PM, Evgeny V evgen...@gmail.com wrote:

 Yes, please.
 Thanks,
 Evgeny

 On Fri, Oct 16, 2009 at 5:41 AM, Kenneth Adam Miller 
 kennethadammil...@gmail.com wrote:

 Who wants to be in Google wave?
 I have 16 invitations








 --
 @nirudh


 



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

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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread westmeadboy

me too :)

On Oct 16, 11:41 am, Kenneth Adam Miller kennethadammil...@gmail.com
wrote:
 Who wants to be in Google wave?
 I have 16 invitations
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Advice on Beta Release

2009-10-16 Thread Al Sutton

At AndAppStore You can mark a release as being Alpha, Beta, or Release
Candidate quality and it'll get listed in the Pre-release section.
That way you can do some ramp up publicity pointing at the download as
opposed to risking getting bug reports in your comments if people
think its' a full release.

Al.
--

* Looking for Android Apps? - Try http://andappstore.com/ *

==
Funky Android Limited is registered in England  Wales with the
company number  6741909.

The views expressed in this email are those of the author and not
necessarily those of Funky Android Limited, it's associates, or it's
subsidiaries.

On Oct 16, 12:46 am, Andrei gml...@gmail.com wrote:
 Publish it as beta, tell people email you any bugs, if you see
 problems you can Unpublish app
 and fix bugs, publish newer version

 On Oct 15, 3:57 pm, Smelly Eddie ollit...@gmail.com wrote:



  SO i have an application that is doing pretty well on my dev. device,
  and it is almost ready for prime time.

  Trouble is I am only one man, so I would like to release the
  application under a beta release to work out any prominent bugs with a
  more strenuous workout.

  So I was thinking;

  * Just release the app through the Market and note in the description
  and title that the app is in beta mode, and to use at own risk

  * Round up a group of friendly strangers with android devices and
  share a signed (short lifespan) package directly with them.

  * push and pray - just release the app and hope the community will
  overlook a few undocumented features (I would like to avoid this!)

  Has anyone else taken a phased approach to releases? Any advice for a
  first time publisher?

  P.S. - My app will be free, and likely released as open source of
  flavor, so I am not worried about losing profits.
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread Hao

Me t!!

Thanks a lot!

On Oct 16, 5:41 am, Kenneth Adam Miller kennethadammil...@gmail.com
wrote:
 Who wants to be in Google wave?
 I have 16 invitations
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread vishal bhoj
Please , send  one to me too :)

On Fri, Oct 16, 2009 at 9:14 AM, Guru gurudut...@gmail.com wrote:

 I want it.Thanks very much!

 On Fri, Oct 16, 2009 at 9:11 AM, Kenneth Adam Miller 
 kennethadammil...@gmail.com wrote:

 Who wants to be in Google wave?
 I have 16 invitations





 --
 Thanks and Regards
 Gurudutt P.S.


 



-- 
with regards vishal

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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread Raghavendra R
hi,
please give me ..

On Fri, Oct 16, 2009 at 12:41 PM, Kenneth Adam Miller 
kennethadammil...@gmail.com wrote:

 Who wants to be in Google wave?
 I have 16 invitations

 


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



[android-developers] Re: SAR(Specific Absorption Rate) values of Android phones on the market

2009-10-16 Thread Cédric Berger

On Thu, Oct 15, 2009 at 21:46, Mark Murphy mmur...@commonsware.com wrote:

 The FCC IDs of phones, hyperlinked to the FCC filings, are on
 phonescoop.com. Just search for the phones you want.


I do not know if you care, but for european phones :
models/frequencies may be different, and SAR is not mesured the same
way.
(US : W/kg over 1g of tissue / EU : W/kg averaged on 10g of tissue)
Also, maximum allowed is different (US : 1.6 W/kg,  EU : 2 W/kg )

European law imposes SAR (DAS in french) values to be shown to
buyers in specifications. So you may just check on sellers websites
(ex. providers : sfr , orange , bouygues , )

Note that though the HTC Dream (G1) is reported with the same SAR in
US and france (1.11 W/kg),
the Sapphire is not : in US  the HTC MyTouch 3G has SAR = 1.55 W/kg
In France the HTC Magic  has SAR = 0.95 W/kg
A bit weird...

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



[android-developers] Re: paid apps

2009-10-16 Thread MrChaz

It seems that a lot of US cards don't allow foreign currency purchases
so if you application isn't in dollars they can't buy it.

On Oct 16, 1:08 am, Andrei gml...@gmail.com wrote:
 For paid apps on average there is like 15 - 20% declined credit card
 rate, why is it so high?
 The message is: The authorization of the customer's credit card
 failed
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread bear tung
me too ! thanks!!

On Fri, Oct 16, 2009 at 3:40 PM, Raghavendra R
raghavendrars...@gmail.comwrote:

 hi,
 please give me ..

 On Fri, Oct 16, 2009 at 12:41 PM, Kenneth Adam Miller 
 kennethadammil...@gmail.com wrote:

 Who wants to be in Google wave?
 I have 16 invitations



 



Bear

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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread spocky12

I'm interested, if you've got one left.

On Oct 16, 5:41 am, Kenneth Adam Miller kennethadammil...@gmail.com
wrote:
 Who wants to be in Google wave?
 I have 16 invitations
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Advice on Beta Release

2009-10-16 Thread André

I have implemented the Flurry API (see flurry.com) into my own game
Puzzle Blox Arcade! and released it as Beta on both AndAppStore.com
and SlideMe.org. On both websites I have marked it as BETA release in
the summary/description.

Flurry enables you to get detailed statistics about the users of your
app, the devices used including screen resolution and firmware
version, etc. Everything anonymously of course but very helpful to
find out who your customers are. The most important feature though is
to report errors and unhandled exceptions. This helps you to find a
lot of bugs and issues!

If you don't like Flurry and the statistics it generates you might
want to implement such an error reporting feature yourself of course.
And make sure the user can disable the statistics as not everybody
likes to be such transparent obviously.

Both AndAppStore.com and SlideMe.org are very good start to publish
your apps. Depending on the type of application you will get a few
dozen daily downloads.  In the meantime I have several hundreds of
installs which provides my with a very good overview of the average
fail rate. Once the rate of failure goes down to an acceptable level I
will release it to the Google Android Market finally.

-- André
http://android.rabold.org




On 15 Okt., 21:57, Smelly Eddie ollit...@gmail.com wrote:
 SO i have an application that is doing pretty well on my dev. device,
 and it is almost ready for prime time.

 Trouble is I am only one man, so I would like to release the
 application under a beta release to work out any prominent bugs with a
 more strenuous workout.

 So I was thinking;

 * Just release the app through the Market and note in the description
 and title that the app is in beta mode, and to use at own risk

 * Round up a group of friendly strangers with android devices and
 share a signed (short lifespan) package directly with them.

 * push and pray - just release the app and hope the community will
 overlook a few undocumented features (I would like to avoid this!)

 Has anyone else taken a phased approach to releases? Any advice for a
 first time publisher?

 P.S. - My app will be free, and likely released as open source of
 flavor, so I am not worried about losing profits.
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread nisha.devit

Yeah, M interested..
Send one me to. :)

On Fri, Oct 16, 2009 at 1:55 PM, spocky12 spock...@gmail.com wrote:

 I'm interested, if you've got one left.

 On Oct 16, 5:41 am, Kenneth Adam Miller kennethadammil...@gmail.com
 wrote:
 Who wants to be in Google wave?
 I have 16 invitations






-- 
Regards,
Nisha

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



[android-developers] trouble sending an mms

2009-10-16 Thread sdphil

I am trying to send an MMS message like this --

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(sms_body, hello world);
sendIntent.setType(vnd.android-dir/mms-sms);
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File
(url)));  // I have tried Uri.parse(url) here
sendIntent.setType(image/*);   // I have tried image/jpg and
impage/jpeg here...
startActivity(sendIntent);

The file that I'm trying to send is in my application sandbox.

/data/data/com.myapp.test/files/myco/cache/1234.jpg

However, every time I send the message, I get --

10-16 01:46:51.371: ERROR/MediaModel(3298): IOException caught while
opening or reading stream
10-16 01:46:51.371: ERROR/MediaModel(3298):
java.io.FileNotFoundException: /data/data/com.myapp.test/files/myco/
cache/1234.jpg
10-16 01:46:51.371: ERROR/MediaModel(3298): at
org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:
231)
10-16 01:46:51.371: ERROR/MediaModel(3298): at
java.io.FileInputStream.init(FileInputStream.java:80)

Is this because the file I'm pointing at is in my local sandbox?  And
if it is, how do I expose it to the MMS app.  I have thought about
copying it to the SD card first, but that seems like a really bad
solution...

Can I have the intent run as thought the person who received it is
me?  (I thought I remembered reading that somewhere...)

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



[android-developers] Re: How to start a service without using any activity??

2009-10-16 Thread André

It solely depends upon your implementation whether a service starts,
shuts down or restarts; regardless whether you do this from your
application or an activity. In other words you shouldn't shut down the
service once the activity finishes. This will keep it running and next
time your activity starts it will simply connect to the already
running service again. That's exactly what I'm doing in my current
project.

I suggest you check out the Remote Service Tutorial over at anddev.org
- It should give you a quite good start: 
http://www.anddev.org/remote_service_tutorial-t8127.html

-- André
http://android.rabold.org




On 16 Okt., 06:38, pink 444 pnk...@gmail.com wrote:
 Hai,

      My application has a background process which continuously waits
 on a  socket for receiving messages and it should be started only once
 and at the time of application starting.Thus i want to do that
 background job in a service.

     The service should not be started from the  activity ,it should be
 started at the application starting.

     How can i define the service,which will be started at the time of
 application starting?

    If at all the service is started from activity.The activity can be
 destroyed
 and restarted.when this happens the service also be restarted .

 Any help will be appreciated highly.

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



[android-developers] NPE while trying to start AppWidgetManager.ACTION_APPWIDGET_PICK intent

2009-10-16 Thread Nikolay Ivanov

Hi all, I have a problem then trying to put an intent with
AppWidgetManager.ACTION_APPWIDGET_PICK there is a problem somethere
inside of android AppWidget ecosystem as I can see from the logs. So
that I doing wrong?
Code:
public class NPEDemoActivity extends Activity {

private final static int HOST_CODE = 1024;

private AppWidgetHost host;
private AppWidgetManager manager;
private int PICK_WIDGET_RC = 1;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
host = new AppWidgetHost(this, HOST_CODE);
host.startListening();
manager = AppWidgetManager.getInstance(this);
Button b = (Button)findViewById(R.id.Button01);
b.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View v) {
int nextId = host.allocateAppWidgetId();
Intent pickIntent = new Intent
(AppWidgetManager.ACTION_APPWIDGET_PICK);
pickIntent.putExtra
(AppWidgetManager.EXTRA_APPWIDGET_ID, nextId);
startActivityForResult(pickIntent, PICK_WIDGET_RC);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
super.onActivityResult(requestCode, resultCode, data);
}
}

Exception happens upon button click.
Stack trace:
0-15 17:33:06.873: ERROR/AndroidRuntime(821):
java.lang.RuntimeException: Unable to start activity ComponentInfo
{com.android.settings/com.android.settings.AppWidgetPickActivity}:
java.lang.NullPointerException
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2401)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2417)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
android.app.ActivityThread.access$2100(ActivityThread.java:116)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
android.os.Handler.dispatchMessage(Handler.java:99)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
android.os.Looper.loop(Looper.java:123)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
android.app.ActivityThread.main(ActivityThread.java:4203)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
java.lang.reflect.Method.invokeNative(Native Method)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
java.lang.reflect.Method.invoke(Method.java:521)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:791)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
dalvik.system.NativeStart.main(Native Method)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): Caused by:
java.lang.NullPointerException
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
com.android.settings.AppWidgetPickActivity.putAppWidgetItems
(AppWidgetPickActivity.java:170)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
com.android.settings.AppWidgetPickActivity.putCustomAppWidgets
(AppWidgetPickActivity.java:132)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
com.android.settings.AppWidgetPickActivity.getItems
(AppWidgetPickActivity.java:208)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
com.android.settings.ActivityPicker.onCreate(ActivityPicker.java:99)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
com.android.settings.AppWidgetPickActivity.onCreate
(AppWidgetPickActivity.java:63)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
10-15 17:33:06.873: ERROR/AndroidRuntime(821): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2364)
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread Nivek

Hello,

I counted 16 replies... but if it's not too late could you please send
me one ?

Thanks !

Nivek

On 16 oct, 10:49, nisha.devit nisha.de...@gmail.com wrote:
 Yeah, M interested..
 Send one me to. :)

 On Fri, Oct 16, 2009 at 1:55 PM, spocky12 spock...@gmail.com wrote:

  I'm interested, if you've got one left.

  On Oct 16, 5:41 am, Kenneth Adam Miller kennethadammil...@gmail.com
  wrote:
  Who wants to be in Google wave?
  I have 16 invitations

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



[android-developers] Re: Memory leak or feature

2009-10-16 Thread Mika

Hi Dianne,

This is what I assumed also. Do you have any ideas where the leak
could be in the sample app that I posted? I also checked the music
player app with meminfo and it behaves similarly leaving activities in
memory even after the ui is closed and system_process and
com.android.music processes are GCed from DDMS. I also tested with 1.1
SDK and Emulator and there everything works as presumed and no
activities stay in memory after they are closed.

-Mika

On Oct 15, 7:56 pm, Dianne Hackborn hack...@android.com wrote:
 If you press back and let the system finish the activity, all references to
 it will be gone, so though your process is there after it GCs the resources
 (views etc) associated with the activity should be gone.  If you still see
 them after you know the process has GCed, then you have a leak in your app.

 On Thu, Oct 15, 2009 at 7:57 AM, String sterling.ud...@googlemail.comwrote:







  On Oct 15, 3:08 pm, Mika mika.ristim...@tkk.fi wrote:

   So the problem is quite simple. I start a Service from an Activity,
   the user presses back, the Activity goes away and the Service stays
   running in the background. However the activity (and it's views) still
   stay in memory.

  Feature. It's central to the Android architecture that activities
  aren't killed by the system until their resources are needed
  elsewhere. The idea, I think, is that if the user goes back into your
  activity before that happens, it's ready and waiting.

  Some good discussion of it in this thread:

 http://groups.google.com/group/android-developers/browse_thread/threa...

  String

 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] SQLiteDatabaseCorruptException

2009-10-16 Thread Lazarus 101

Just got this exception on 1.6 emulator. Everything in my database was
lost, the db file was still there but the tables were gone. Did anyone
else experienced this? What might have caused this? I hope this is
just an emulator bug...

E/Database(  876): Failed to setLocale() when constructing, closing
the
database
E/Database(  876):
android.database.sqlite.SQLiteDatabaseCorruptException: database disk
image is malformed
E/Database(  876):  at
android.database.sqlite.SQLiteDatabase.native_setLocale(Native
Method)
E/Database(  876):  at
android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:
1637)
E/Database(  876):  at
android.database.sqlite.SQLiteDatabase.init(SQLiteDatabase.java:
1587)
E/Database(  876):  at
android.database.sqlite.SQLiteDatabase.openDatabase
(SQLiteDatabase.java:638)
E/Database(  876):  at
android.database.sqlite.SQLiteDatabase.openOrCreateDatabase
(SQLiteDatabase.java:659)
...
E/Database(  876):  at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
E/Database(  876):  at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2364)
E/Database(  876):  at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2417)
E/Database(  876):  at android.app.ActivityThread.access$2100
(ActivityThread.java:
116)
E/Database(  876):  at android.app.ActivityThread$H.handleMessage
(ActivityThread.java:
1794)
E/Database(  876):  at android.os.Handler.dispatchMessage
(Handler.java:
99)
E/Database(  876):  at android.os.Looper.loop(Looper.java:
123)
E/Database(  876):  at android.app.ActivityThread.main
(ActivityThread.java:
4203)
E/Database(  876):  at java.lang.reflect.Method.invokeNative
(Native
Method)
E/Database(  876):  at java.lang.reflect.Method.invoke(Method.java:
521)
E/Database(  876):  at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:
791)
E/Database(  876):  at com.android.internal.os.ZygoteInit.main
(ZygoteInit.java:
549)
E/Database(  876):  at dalvik.system.NativeStart.main(Native
Method)
E/Database(  876): Deleting and re-creating corrupt database /data/
data/com.test/test.db
E/Database(  876):
android.database.sqlite.SQLiteDatabaseCorruptException: database disk
image is malformed
E/Database(  876):  at
android.database.sqlite.SQLiteDatabase.native_setLocale(Native
Method)
E/Database(  876):  at
android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:
1637)
E/Database(  876):  at
android.database.sqlite.SQLiteDatabase.init(SQLiteDatabase.java:
1587)
E/Database(  876):  at
android.database.sqlite.SQLiteDatabase.openDatabase
(SQLiteDatabase.java:638)
E/Database(  876):  at
android.database.sqlite.SQLiteDatabase.openOrCreateDatabase
(SQLiteDatabase.java:659)
...
E/Database(  876):  at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
E/Database(  876):  at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2364)
E/Database(  876):  at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2417)
E/Database(  876):  at android.app.ActivityThread.access$2100
(ActivityThread.java:
116)
E/Database(  876):  at android.app.ActivityThread$H.handleMessage
(ActivityThread.java:
1794)
E/Database(  876):  at android.os.Handler.dispatchMessage
(Handler.java:
99)
E/Database(  876):  at android.os.Looper.loop(Looper.java:
123)
E/Database(  876):  at android.app.ActivityThread.main
(ActivityThread.java:
4203)
E/Database(  876):  at java.lang.reflect.Method.invokeNative
(Native
Method)
E/Database(  876):  at java.lang.reflect.Method.invoke(Method.java:
521)
E/Database(  876):  at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:
791)
E/Database(  876):  at com.android.internal.os.ZygoteInit.main
(ZygoteInit.java:
549)
E/Database(  876):  at dalvik.system.NativeStart.main(Native
Method)

E/Database(  876): Failure 1 (no such table: app_data) on 0x1d0b68
when preparing 'DELETE from app_data WHERE key='102''.
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Programmatically get maximum heap size?

2009-10-16 Thread String

On Oct 16, 1:18 am, fadden fad...@android.com wrote:

 java.lang.Runtime.maxMemory()

That's the one I needed. Many thanks!

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



[android-developers] Change button color on Focus and on click

2009-10-16 Thread Shoby

Hi i am developing an application that has a button whose color should
change green color on focusing on the button and the color of button
should change to red on clicking the button. I am using
setBackgroundResource() in the onClick and onLongClick listeners.
Though it changes the button color, it also changes the button shape
by making it look like a rectangle. How can this be solved?  i have
used the below code to do the same:

final Button b = (Button)findViewById(R.id.Button01);
b.setOnLongClickListener(new View.OnLongClickListener(){

public boolean onLongClick(View v) {
b.setBackgroundResource(R.color.green);
return false;
}
});

   b.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
b.setBackgroundResource(R.color.red);
}

});

How can i achieve the functionality with out changing the shape of the
button
Can someone tell me how this functionality can be achieved?
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to redirect the Logs into an file.

2009-10-16 Thread peeyush varshney
Hi,
  I want to redirect the Logs into an file. How should i proceed
?

-- 
Thank  Regards
Peeyush Varshney

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



[android-developers] How to use CursorJoiner to join two table?

2009-10-16 Thread Victor Lin

Hi, I have two tables:

Category(_id, name)
Spend(_id, spend, category_id)

I want to join these two tables. I tried to use CursorJoiner:

Cursor spendCursor = managedQuery(
AccountBook.Spend.CONTENT_URI,
new String[] { AccountBook.Spend._ID,
AccountBook.Spend.SPEND, AccountBook.Spend.CATEGORY_ID },
null, null, AccountBook.Spend.CATEGORY_ID
);

Cursor categoryCursor = managedQuery(
AccountBook.Category.CONTENT_URI,
new String[] { AccountBook.Category._ID,
AccountBook.Category.NAME },
null, null, AccountBook.Category._ID
);

CursorJoiner joiner = new CursorJoiner(
spendCursor, new String[] { AccountBook.Spend.CATEGORY_ID },
categoryCursor, new String[] { AccountBook.Category._ID }
);

With following data:

Spend's category_id: 1, 1, 1, 1, 2
Category's _id: 1, 2, 3

I got following results of CursorJoiner :

BOTH
LEFT
LEFT
LEFT
BOTH
RIGHT

That's strange, it seems the behavior of CursorJoiner is not like the
behavior of join of usual database. What I want is, list all spends in
list with its category's name.

For example:

Spends (_id, spends, category_id) :
1, 999, 1
2, 55, 2
3, 30, 2
4,, 60, 3

Categories (_id, name):
1, food
2. tips
3. 3C products

And I want the list looks like:

(spend.spend, category.name)
999, food
55, tips
30, tips
60, 3C products

How can I achieve this with Android?

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



[android-developers] Re: How to start a service without using any activity??

2009-10-16 Thread Farproc

  First, you do not have to start/stop a service from a Activity. You
can
do that in anywhere via a Context object(which is very easy to
retrieve).

  If you want to start a service, just call Context.startService(),
form
then on the service will keep running in background until you
explicitly
call Context.stopService(). Then call Context.bindService() if you
want
to control the service and Context.unbindService() when you do not
want to communicate with the service anymore.

  Finally, Call Context.stopService() to terminate the service when it
is
not needed.

  ps: Though a service runs in background, it runs in the main(UI)
thread.



On 10月16日, 下午12时38分, pink 444 pnk...@gmail.com wrote:
 Hai,

  My application has a background process which continuously waits
 on a  socket for receiving messages and it should be started only once
 and at the time of application starting.Thus i want to do that
 background job in a service.

 The service should not be started from the  activity ,it should be
 started at the application starting.

 How can i define the service,which will be started at the time of
 application starting?

If at all the service is started from activity.The activity can be
 destroyed
 and restarted.when this happens the service also be restarted .

 Any help will be appreciated highly.

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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread Farproc

Am I lucky? ;)

On 10月16日, 上午11时41分, Kenneth Adam Miller kennethadammil...@gmail.com
wrote:
 Who wants to be in Google wave?
 I have 16 invitations
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Change button color on Focus and on click

2009-10-16 Thread Farproc

Set button's background to a StateListDrawable object or xml resource.

Here is a sample to use StateListDrawable resource. It's very easy you
event do not need to write the listeners!!!

On 10月16日, 下午5时43分, Shoby shoby.su...@wipro.com wrote:
 Hi i am developing an application that has a button whose color should
 change green color on focusing on the button and the color of button
 should change to red on clicking the button. I am using
 setBackgroundResource() in the onClick and onLongClick listeners.
 Though it changes the button color, it also changes the button shape
 by making it look like a rectangle. How can this be solved?  i have
 used the below code to do the same:

 final Button b = (Button)findViewById(R.id.Button01);
 b.setOnLongClickListener(new View.OnLongClickListener(){

 public boolean onLongClick(View v) {
 b.setBackgroundResource(R.color.green);
 return false;
 }
 });

b.setOnClickListener(new View.OnClickListener() {
 public void onClick(View view) {
 b.setBackgroundResource(R.color.red);
 }

 });

 How can i achieve the functionality with out changing the shape of the
 button
 Can someone tell me how this functionality can be achieved?
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Change button color on Focus and on click

2009-10-16 Thread Shoby

Hi Farproc,

Could you please provide a sample code or a link to a sample code for
the same?

Thanks,
Shoby


On Oct 16, 3:04 pm, Farproc farp...@gmail.com wrote:
 Set button's background to a StateListDrawable object or xml resource.

 Here is a sample to use StateListDrawable resource. It's very easy you
 event do not need to write the listeners!!!

 On 10月16日, 下午5时43分, Shoby shoby.su...@wipro.com wrote:

  Hi i am developing an application that has a button whose color should
  change green color on focusing on the button and the color of button
  should change to red on clicking the button. I am using
  setBackgroundResource() in the onClick and onLongClick listeners.
  Though it changes the button color, it also changes the button shape
  by making it look like a rectangle. How can this be solved?  i have
  used the below code to do the same:

  final Button b = (Button)findViewById(R.id.Button01);
  b.setOnLongClickListener(new View.OnLongClickListener(){

  public boolean onLongClick(View v) {
  b.setBackgroundResource(R.color.green);
  return false;
  }
  });

 b.setOnClickListener(new View.OnClickListener() {
  public void onClick(View view) {
  b.setBackgroundResource(R.color.red);
  }

  });

  How can i achieve the functionality with out changing the shape of the
  button
  Can someone tell me how this functionality can be achieved?


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



[android-developers] Re: How to use CursorJoiner to join two table?

2009-10-16 Thread RichardC

You can use a JOIN clause in SQLiteQueryBuilder.setTables

http://developer.android.com/reference/android/database/sqlite/SQLiteQueryBuilder.html#setTables%28java.lang.String%29

--
RichardC

On Oct 16, 10:50 am, Victor Lin borns...@gmail.com wrote:
 Hi, I have two tables:

 Category(_id, name)
 Spend(_id, spend, category_id)

 I want to join these two tables. I tried to use CursorJoiner:

         Cursor spendCursor = managedQuery(
                 AccountBook.Spend.CONTENT_URI,
                 new String[] { AccountBook.Spend._ID,
 AccountBook.Spend.SPEND, AccountBook.Spend.CATEGORY_ID },
                 null, null, AccountBook.Spend.CATEGORY_ID
         );

         Cursor categoryCursor = managedQuery(
                 AccountBook.Category.CONTENT_URI,
                 new String[] { AccountBook.Category._ID,
 AccountBook.Category.NAME },
                 null, null, AccountBook.Category._ID
         );

         CursorJoiner joiner = new CursorJoiner(
                 spendCursor, new String[] { AccountBook.Spend.CATEGORY_ID },
                 categoryCursor, new String[] { AccountBook.Category._ID }
         );

 With following data:

 Spend's category_id: 1, 1, 1, 1, 2
 Category's _id: 1, 2, 3

 I got following results of CursorJoiner :

 BOTH
 LEFT
 LEFT
 LEFT
 BOTH
 RIGHT

 That's strange, it seems the behavior of CursorJoiner is not like the
 behavior of join of usual database. What I want is, list all spends in
 list with its category's name.

 For example:

 Spends (_id, spends, category_id) :
 1, 999, 1
 2, 55, 2
 3, 30, 2
 4,, 60, 3

 Categories (_id, name):
 1, food
 2. tips
 3. 3C products

 And I want the list looks like:

 (spend.spend, category.name)
 999, food
 55, tips
 30, tips
 60, 3C products

 How can I achieve this with Android?

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



[android-developers] Re: ARCHOS 5: MediaPlayer create method returns null

2009-10-16 Thread Mark Murphy

n.a wrote:
 Hi, my app is working perfectly and playing its music in the 1.5 and
 1.6 emulators, my ADP1, and for everyone in the Android Market (at
 least there were no complaints).
 
 The problem is that when the app is run on the ARCHOS 5 tabled, the
 MediaPlayer.create(Context context, int resid) method returns null.
 
 I guess there might be a problem with the ARCHOS' Android
 implementation, but did anyone experience the same problem? What might
 be a possible reason for the create method to return false? The docs
 don't say anything.

http://github.com/commonsguy/cw-advandroid/tree/master/Media/Audio/

The above project, which uses a MediaPlayer with an OGG resource, works
fine on my ARCHOS 5 tablet.

Give it a try. If it works, then there is something specific about your
code that is causing your problems on the ARCHOS. If my code fails,
check your firmware version (I'm on 1.1.01, which appears to be the latest).

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

_Beginning Android_ from Apress Now Available!

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



[android-developers] Re: Screen size

2009-10-16 Thread Sikus

I don't understand where is problem in QVGA distinction. I have banner
which I load from server. Therefor I  need recognize programatically
absolute size of the physical screen that I have right width of
banner. Is there any way how can I recognize right physical screen
width?

On 15 říj, 23:39, Dianne Hackborn hack...@android.com wrote:
 Because you are running in density compatibility mode.

 And for the most part, it is far better to get the screen size by creating
 your view hierarchy and seeing what size the view(s) get set to.  The size
 you get from Display is the absolute size of the physical screen, which
 doesn't account for screen decorations like the status bar, soft keyboard,
 and who knows what other things may be added on some devices in the future.

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



[android-developers] R.drawable.my_icon Missing

2009-10-16 Thread Ne0

Hi,

For some strange reason one of my drawable resources will not get
written to R.drawable!?!

The icon i am trying to use is in the correct directory, has a legal
name, but when i compile i get:

target Java: MobilePowerSurvey (out/target/common/obj/APPS/
MobilePowerSurvey_intermediates/classes)
packages/apps/MobilePowerSurvey/src/com/mobilepowersurvey/
MobilePowerSurvey.java:174: cannot find symbol
symbol  : variable close
location: class com.mobilepowersurvey.R.drawable
.setIcon(R.drawable.close);

I have done exactly the same thing with many other icons and it all
compiles fine. My only concern is that there is a limit to the amount
of resources you can add, but i haven't noticed this documented any
where, does anyone know if this is the case? or if i could be doing
something stupid and not noticing it!?!

Cheers,

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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread ColletJb

I think there are no invitation left from Kenneth Adam Miller.

But if anyone invited by him has invitation and can invite me, It
would be great ;)


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



[android-developers] Re: How to use CursorJoiner to join two table?

2009-10-16 Thread Victor Lin

But how about ContentProvider? I didn't query database directly, I
used ContentProvider.

On 10月16日, 下午6時39分, RichardC richard.crit...@googlemail.com wrote:
 You can use a JOIN clause in SQLiteQueryBuilder.setTables

 http://developer.android.com/reference/android/database/sqlite/SQLite...

 --
 RichardC

 On Oct 16, 10:50 am, Victor Lin borns...@gmail.com wrote:

  Hi, I have two tables:

  Category(_id, name)
  Spend(_id, spend, category_id)

  I want to join these two tables. I tried to use CursorJoiner:

          Cursor spendCursor = managedQuery(
                  AccountBook.Spend.CONTENT_URI,
                  new String[] { AccountBook.Spend._ID,
  AccountBook.Spend.SPEND, AccountBook.Spend.CATEGORY_ID },
                  null, null, AccountBook.Spend.CATEGORY_ID
          );

          Cursor categoryCursor = managedQuery(
                  AccountBook.Category.CONTENT_URI,
                  new String[] { AccountBook.Category._ID,
  AccountBook.Category.NAME },
                  null, null, AccountBook.Category._ID
          );

          CursorJoiner joiner = new CursorJoiner(
                  spendCursor, new String[] { AccountBook.Spend.CATEGORY_ID },
                  categoryCursor, new String[] { AccountBook.Category._ID }
          );

  With following data:

  Spend's category_id: 1, 1, 1, 1, 2
  Category's _id: 1, 2, 3

  I got following results of CursorJoiner :

  BOTH
  LEFT
  LEFT
  LEFT
  BOTH
  RIGHT

  That's strange, it seems the behavior of CursorJoiner is not like the
  behavior of join of usual database. What I want is, list all spends in
  list with its category's name.

  For example:

  Spends (_id, spends, category_id) :
  1, 999, 1
  2, 55, 2
  3, 30, 2
  4,, 60, 3

  Categories (_id, name):
  1, food
  2. tips
  3. 3C products

  And I want the list looks like:

  (spend.spend, category.name)
  999, food
  55, tips
  30, tips
  60, 3C products

  How can I achieve this with Android?

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



[android-developers] Re: How to use CursorJoiner to join two table?

2009-10-16 Thread RichardC

I do the join in the content provider using a different Uri for the
joined view.  For example you could use

content://com.example.my_provider/spend_with_category

as the Uri and do the join when you create the cursor.

--
RichardC

On Oct 16, 12:34 pm, Victor Lin borns...@gmail.com wrote:
 But how about ContentProvider? I didn't query database directly, I
 used ContentProvider.

 On 10月16日, 下午6時39分, RichardC richard.crit...@googlemail.com wrote:

  You can use a JOIN clause in SQLiteQueryBuilder.setTables

 http://developer.android.com/reference/android/database/sqlite/SQLite...

  --
  RichardC

  On Oct 16, 10:50 am, Victor Lin borns...@gmail.com wrote:

   Hi, I have two tables:

   Category(_id, name)
   Spend(_id, spend, category_id)

   I want to join these two tables. I tried to use CursorJoiner:

           Cursor spendCursor = managedQuery(
                   AccountBook.Spend.CONTENT_URI,
                   new String[] { AccountBook.Spend._ID,
   AccountBook.Spend.SPEND, AccountBook.Spend.CATEGORY_ID },
                   null, null, AccountBook.Spend.CATEGORY_ID
           );

           Cursor categoryCursor = managedQuery(
                   AccountBook.Category.CONTENT_URI,
                   new String[] { AccountBook.Category._ID,
   AccountBook.Category.NAME },
                   null, null, AccountBook.Category._ID
           );

           CursorJoiner joiner = new CursorJoiner(
                   spendCursor, new String[] { AccountBook.Spend.CATEGORY_ID 
   },
                   categoryCursor, new String[] { AccountBook.Category._ID }
           );

   With following data:

   Spend's category_id: 1, 1, 1, 1, 2
   Category's _id: 1, 2, 3

   I got following results of CursorJoiner :

   BOTH
   LEFT
   LEFT
   LEFT
   BOTH
   RIGHT

   That's strange, it seems the behavior of CursorJoiner is not like the
   behavior of join of usual database. What I want is, list all spends in
   list with its category's name.

   For example:

   Spends (_id, spends, category_id) :
   1, 999, 1
   2, 55, 2
   3, 30, 2
   4,, 60, 3

   Categories (_id, name):
   1, food
   2. tips
   3. 3C products

   And I want the list looks like:

   (spend.spend, category.name)
   999, food
   55, tips
   30, tips
   60, 3C products

   How can I achieve this with Android?

   Thanks.
   Victor Lin.


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



[android-developers] Animation between 2 activities?

2009-10-16 Thread Marc Reichelt

Hi there!

I program on an application where different views are arranged
horizontally, each view of screen size. The user should be able to
switch between these views using his finger. I first used the
ViewFlipper, which was great for simple layouts, but which is *way*
too slow if the layouts of the views are more complex, because all
Views are drawn.

A much better method would be to place one layout per activity and
switch between these activities using the slide in / slide out
animations.
Is something in this direction possible with Android right now? Any
recommendations or best practices?


Regards  great thanks in advance

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



[android-developers] Re: Animation between 2 activities?

2009-10-16 Thread Mark Murphy

Marc Reichelt wrote:
 I program on an application where different views are arranged
 horizontally, each view of screen size. The user should be able to
 switch between these views using his finger. I first used the
 ViewFlipper, which was great for simple layouts, but which is *way*
 too slow if the layouts of the views are more complex, because all
 Views are drawn.

Step #1: Put only the first screen's worth of content into the
ViewFlipper in your layout upon creation of your activity.

Step #2: On the first swipe/tap/gesture/whatever to a never-before-seen
page, inflate the content, add it to the ViewFlipper, and make it the
displayed child.

Step #3: On the second and subsequent moves to the page, just make it
the displayed child.

 A much better method would be to place one layout per activity and
 switch between these activities using the slide in / slide out
 animations.
 Is something in this direction possible with Android right now? Any
 recommendations or best practices?

Users control the animations between activities (Settings  Sound 
display  Animation), not developers. You are welcome to use a
swipe/tap/gesture/whatever to elect to start or finish an activity, but
the user will control whether or not there are animations between them.

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

_Beginning Android_ from Apress Now Available!

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



[android-developers] issue with playing .wma file

2009-10-16 Thread manoj

Hi all,

I tried to play a .wma file in android phone. It didn't play. I dont
know why. I played the media file in vlc player on pc. It worked.

And also I found that some .wma files are playing and some are not
playing.

I tried to figure out the diff between the two.

The audio codec is wma2 for playing media file in android.

the audio codec is wma9 for non playing media file in android.

Is there any other way to decode the wma9 to wma2 or lessthan this.

Please suggest me.

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



[android-developers] Audio Playback while Recording... ------- attemp playback while recording, cheat it! ----- error

2009-10-16 Thread Vishal

Hello,

I have a Java application where in I am trying to read Audio samples
from the mic into a buffer and then write the samples back to speaker
from a buffer for playing.

I have used AudioRecord and AudioTrack interfaces. Below are my
configurations for the Record and Track object creation. AudioTrack(0,
8000, 2, 2, playBufSize, 1); AudioRecord(1, 8000, 2, 2, recBufSize);
Using AudioRecord interface I am able to read the samples from mic
continiously (8000 sampling rate and 640 samples per read). In the
similar way I am also able to write some pcm samples to the speaker
from a buffer and play it continuously using the AudioTrack interface
(without record).

But when I try to do both record and play simultaneously I am able to
only record audio from mic but I am not able to play any samples to
speaker. I am getting this error  --- attemp playback while
recording, cheat it! -   in the log cat.

I have given the following permissions
android.permission.RECORD_AUDIO and
android.permission.MODIFY_AUDIO_SETTINGS in the Manifest file. I
didn't find any special permission to play the audio.

Is there anything else that I need to enable?

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



[android-developers] Re: How to capture audio data from mic into a buffer?

2009-10-16 Thread Vishal

Have found the solution. Used the AudioRecord and AudioTrack
interfaces.

On Sep 24, 3:10 pm, Vishal Gaonkar vishal.andr...@gmail.com wrote:
 I am working on a packet switched network. I want to capture the audio
 data from mic into a buffer at a desired sample rate.

 How can I capture the audio data from mic into a buffer instead of a
 file?
 Also how can I control the audio capture rate as per the desired
 sample rate?
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: R.drawable.my_icon Missing

2009-10-16 Thread Ne0

Sorted, as i had mode no changes to the manifest it was rebuilding the
resources, hence the reason it was saying it couldn't find the files.

Liam

On Oct 16, 12:30 pm, Ne0 liamjamesalf...@googlemail.com wrote:
 Hi,

 For some strange reason one of my drawable resources will not get
 written to R.drawable!?!

 The icon i am trying to use is in the correct directory, has a legal
 name, but when i compile i get:

 target Java: MobilePowerSurvey (out/target/common/obj/APPS/
 MobilePowerSurvey_intermediates/classes)
 packages/apps/MobilePowerSurvey/src/com/mobilepowersurvey/
 MobilePowerSurvey.java:174: cannot find symbol
 symbol  : variable close
 location: class com.mobilepowersurvey.R.drawable
                 .setIcon(R.drawable.close);

 I have done exactly the same thing with many other icons and it all
 compiles fine. My only concern is that there is a limit to the amount
 of resources you can add, but i haven't noticed this documented any
 where, does anyone know if this is the case? or if i could be doing
 something stupid and not noticing it!?!

 Cheers,

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



[android-developers] Re: How to configure the sampling rate/period while audio capture?

2009-10-16 Thread Vishal

Have found the solution. Used the AudioRecord and AudioTrack
interfaces.

On Sep 24, 12:55 pm, Vishal.Android vishal.andr...@gmail.com
wrote:
 How to capture the audio data from mic into a buffer instead of a
 file?

 On Sep 23, 2:43 pm, Vishal Gaonkar vishal.andr...@gmail.com wrote:

  I am working on a VOIP based application. I need to capture the audio
  from mic at 8000 hz sampling rate, get the 20msec packets, encode and
  send the packets over the network.

  Can somebody tell me how to configure the mic for the desired sampling
  rate?
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: R.drawable.my_icon Missing

2009-10-16 Thread Ne0

The Fix (Short answer): If you have this problem, make a change to
manifest, save and rebuild, sorts it all out!

Liam

On Oct 16, 12:30 pm, Ne0 liamjamesalf...@googlemail.com wrote:
 Hi,

 For some strange reason one of my drawable resources will not get
 written to R.drawable!?!

 The icon i am trying to use is in the correct directory, has a legal
 name, but when i compile i get:

 target Java: MobilePowerSurvey (out/target/common/obj/APPS/
 MobilePowerSurvey_intermediates/classes)
 packages/apps/MobilePowerSurvey/src/com/mobilepowersurvey/
 MobilePowerSurvey.java:174: cannot find symbol
 symbol  : variable close
 location: class com.mobilepowersurvey.R.drawable
                 .setIcon(R.drawable.close);

 I have done exactly the same thing with many other icons and it all
 compiles fine. My only concern is that there is a limit to the amount
 of resources you can add, but i haven't noticed this documented any
 where, does anyone know if this is the case? or if i could be doing
 something stupid and not noticing it!?!

 Cheers,

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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread GSC

If anyone else has an available invitiation, please send me one.

Thanks

On Oct 16, 7:31 am, ColletJb collet...@gmail.com wrote:
 I think there are no invitation left from Kenneth Adam Miller.

 But if anyone invited by him has invitation and can invite me, It
 would be great ;)
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to use CursorJoiner to join two table?

2009-10-16 Thread RichardC

From the documentation for CursorJoiner the following line -

This joiner only supports the case where the tuple of key column
values is unique.

- worries me in that the key column AccountBook.Spend.CATEGORY_ID is
not unique (it can't be as it is the link to the parent table).

I am not sure I am right about this and will need to spend some time
with some test data.  But if I am then CursorJoiner does not suitable
choice to implement one-to-many joins, but only one-to-one optional
joins.

As I said I am not sure about this and am going to do some testing.
Will let you know what I find.

--
RichardC


On Oct 16, 12:42 pm, RichardC richard.crit...@googlemail.com wrote:
 I do the join in the content provider using a different Uri for the
 joined view.  For example you could use

 content://com.example.my_provider/spend_with_category

 as the Uri and do the join when you create the cursor.

 --
 RichardC

 On Oct 16, 12:34 pm, Victor Lin borns...@gmail.com wrote:

  But how about ContentProvider? I didn't query database directly, I
  used ContentProvider.

  On 10月16日, 下午6時39分, RichardC richard.crit...@googlemail.com wrote:

   You can use a JOIN clause in SQLiteQueryBuilder.setTables

  http://developer.android.com/reference/android/database/sqlite/SQLite...

   --
   RichardC

   On Oct 16, 10:50 am, Victor Lin borns...@gmail.com wrote:

Hi, I have two tables:

Category(_id, name)
Spend(_id, spend, category_id)

I want to join these two tables. I tried to use CursorJoiner:

        Cursor spendCursor = managedQuery(
                AccountBook.Spend.CONTENT_URI,
                new String[] { AccountBook.Spend._ID,
AccountBook.Spend.SPEND, AccountBook.Spend.CATEGORY_ID },
                null, null, AccountBook.Spend.CATEGORY_ID
        );

        Cursor categoryCursor = managedQuery(
                AccountBook.Category.CONTENT_URI,
                new String[] { AccountBook.Category._ID,
AccountBook.Category.NAME },
                null, null, AccountBook.Category._ID
        );

        CursorJoiner joiner = new CursorJoiner(
                spendCursor, new String[] { 
AccountBook.Spend.CATEGORY_ID },
                categoryCursor, new String[] { AccountBook.Category._ID 
}
        );

With following data:

Spend's category_id: 1, 1, 1, 1, 2
Category's _id: 1, 2, 3

I got following results of CursorJoiner :

BOTH
LEFT
LEFT
LEFT
BOTH
RIGHT

That's strange, it seems the behavior of CursorJoiner is not like the
behavior of join of usual database. What I want is, list all spends in
list with its category's name.

For example:

Spends (_id, spends, category_id) :
1, 999, 1
2, 55, 2
3, 30, 2
4,, 60, 3

Categories (_id, name):
1, food
2. tips
3. 3C products

And I want the list looks like:

(spend.spend, category.name)
999, food
55, tips
30, tips
60, 3C products

How can I achieve this with Android?

Thanks.
Victor Lin.


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



[android-developers] Big problem with extra data in intent

2009-10-16 Thread DaminouU

Hi,

I want to send RINGER_MODE update to an activity using an alarm
manager and a BroadcastReceiver.

So, in the file which is listening to
android.media.EXTRA_RINGER_MODE, I have this :

if(intent.getAction().equals(android.media.RINGER_MODE_CHANGED)) {
myAudio.setRingerMode(intent.getIntExtra
(android.media.EXTRA_RINGER_MODE, -1));
System.out.println(Changement de son:   + 
Intent.getIntExtra
(android.media.EXTRA_RINGER_MODE, -1));
System.out.println(bla :  + getRingerMode());
sendRingerModeChangedBroadcast(getRingerMode());
}

...

Intent i = new Intent(com.tests.AudioInfo.RINGER_MODE_CHANGED);
i.putExtra(myMode, newMode);
PendingIntent broadcastSender = 
PendingIntent.getBroadcast(context,
0, i, 0);
am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,
SystemClock.elapsedRealtime(), broadcastSender);
System.out.println(here:  + i.getIntExtra(myMode, 
55));
...


And then in another file which receives it, I have :

public void onReceive(Context context, Intent intent) {
...
   else if(intent.getAction().equals
(com.tests.AudioInfo.RINGER_MODE_CHANGED)) {
int newMode = intent.getIntExtra(myMode, 55);
System.out.println(there:  + newMode);
System.out.println(Ringer mode changed:  + 
intent.getIntExtra
(myMode, 55));
   }


So in here: and there: I should have the same value.
It works when this function is called for the first time but after,
here: is always followed by the new values whereas there: is
followed by the first value.
So the line int newMode = intent.getIntExtra(myMode, 55);  does not
work anymore.

Could you explain to me why?

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



[android-developers] Re: Interrupted audio playback.

2009-10-16 Thread Mike

Thank you very much for your advice!

I have not tried to raise MediaPlayers thread priority yet, but I'll
try it next. Although i must admit that i am not convinced with this
solution. The game is opengl powered. Input processing, game logic and
rendering are each separated in a dedicated thread (all with default
priority). The game usually runs at 50+ frames without input and 40+
frames during input. Considering the implementation, there's nothing
special, so i expect MediaPlayers default priority to be sufficient.

Maybe there's an other, more efficient way to play background music
instead.
The ogg streaming seems to cost a lot of cpu time. Do you know of a
more efficient way? Would mp3 be more (or maybe less) efficient? Do
different sample- or bitrates have an impact on playback performance?
Would reading/decoding the audio data myself, without the use of
MediaPlayer, be a viable solution?
Any advice is welcome!

Thanks,
Mike.



On 15 Okt., 14:52, Mike internet...@hotmail.com wrote:
 Hello,

 the game I am working on uses SoundPool for sound effects and
 MediaPlayer for background music playback.
 Input happens enirely through the touch screen, with a 20 mS delay
 after each processed MotionEvent.
 Sometimes (very rarely) it happens that the background music gets
 interrupted for a fraction of a second during input.
 Do you have any ideas how to ensure MediaPlayer continues audio
 playback during touch screen input?

 All audio files are in ogg format with various sample and bit rates.
 Would it be an advantage if all audio files would share the same
 samplerate and/or bitrate?

 Do you have any other ideas how to improve audo playback performance?

 Any advice is welcome!
 Thanks in advance,
 Mike.
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] R.drawable

2009-10-16 Thread nisha.devit

Hi,

How we can store image files(*.png) to the folder R.drawable at runtime?

-- 
Regards,
n!$h

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



[android-developers] PendingIntent.getService Returns an existing or new PendingIntent matching the given parameters

2009-10-16 Thread Neil

In the documentation for PendingIntent.getService it says it Returns
an existing or new PendingIntent matching the given parameters.  What
does that mean?

I have one notification which calls
pendingIntent = PendingIntent.getService(context, 0, new Intent
(context, XXXService.class).putExtra(action, 3), 0));
setLatestEventInfo(context, title, text, pendingIntent);

I have another notification which calls
deleteIntent = PendingIntent.getService(context, 0, new Intent
(context, XXXService.class).putExtra(action, 4), 0);

And nowhere else in the code that uses these two actions (3 and 4).

However when I click on the first notification it invokes onStart on
XXXService as expected, but the extra action has the value 4, ie the
extra from the second notification.

I'm guessing that PendingIntent.getService returns the same
PendingIntent both times, ignoring the extras the second time.

So how can I have two different notifications with PendingIntents
which invoke the same service but with different extras?

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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread Kenneth Adam Miller
 Have any of you gotten an email yet?
I swear I've sent them out...
perhaps they're just nominations for a possible invite to google wave and
not you know actual concrete invitations
I don't know, but I'm guessing that you guys would still want it.
Hahah

:)
I'm in class right now, but I'll review all you guys


On Fri, Oct 16, 2009 at 7:40 AM, GSC greg.ch...@gmail.com wrote:


 If anyone else has an available invitiation, please send me one.

 Thanks

 On Oct 16, 7:31 am, ColletJb collet...@gmail.com wrote:
  I think there are no invitation left from Kenneth Adam Miller.
 
  But if anyone invited by him has invitation and can invite me, It
  would be great ;)
 


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



[android-developers] Re: Big problem with extra data in intent

2009-10-16 Thread Mark Murphy



 Hi,

 I want to send RINGER_MODE update to an activity using an alarm
 manager and a BroadcastReceiver.

 So, in the file which is listening to
 android.media.EXTRA_RINGER_MODE, I have this :

 if(intent.getAction().equals(android.media.RINGER_MODE_CHANGED)) {
   myAudio.setRingerMode(intent.getIntExtra
 (android.media.EXTRA_RINGER_MODE, -1));
   System.out.println(Changement de son:   + 
 Intent.getIntExtra
 (android.media.EXTRA_RINGER_MODE, -1));
   System.out.println(bla :  + getRingerMode());
   sendRingerModeChangedBroadcast(getRingerMode());
   }

 ...

 Intent i = new Intent(com.tests.AudioInfo.RINGER_MODE_CHANGED);
   i.putExtra(myMode, newMode);
   PendingIntent broadcastSender = 
 PendingIntent.getBroadcast(context,
 0, i, 0);
   am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,
 SystemClock.elapsedRealtime(), broadcastSender);
   System.out.println(here:  + i.getIntExtra(myMode, 
 55));
 ...


 And then in another file which receives it, I have :

 public void onReceive(Context context, Intent intent) {
 ...
else if(intent.getAction().equals
 (com.tests.AudioInfo.RINGER_MODE_CHANGED)) {
   int newMode = intent.getIntExtra(myMode, 55);
   System.out.println(there:  + newMode);
   System.out.println(Ringer mode changed:  + 
 intent.getIntExtra
 (myMode, 55));
}


 So in here: and there: I should have the same value.
 It works when this function is called for the first time but after,
 here: is always followed by the new values whereas there: is
 followed by the first value.
 So the line int newMode = intent.getIntExtra(myMode, 55);  does not
 work anymore.

 Could you explain to me why?

You need to cancel your PendingIntent after it is used. Otherwise, Android
will ignore your new PendingIntent and will keep using the old one (since
the Intent matches on things like action and so on).

-- 
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 Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread Gavin Aiken
Takes at least 24 hours in my experience :) have fun waving!
On Fri, Oct 16, 2009 at 2:09 PM, Kenneth Adam Miller 
kennethadammil...@gmail.com wrote:

  Have any of you gotten an email yet?
 I swear I've sent them out...
 perhaps they're just nominations for a possible invite to google wave and
 not you know actual concrete invitations
 I don't know, but I'm guessing that you guys would still want it.
 Hahah

 :)
 I'm in class right now, but I'll review all you guys



 On Fri, Oct 16, 2009 at 7:40 AM, GSC greg.ch...@gmail.com wrote:


 If anyone else has an available invitiation, please send me one.

 Thanks

 On Oct 16, 7:31 am, ColletJb collet...@gmail.com wrote:
  I think there are no invitation left from Kenneth Adam Miller.
 
  But if anyone invited by him has invitation and can invite me, It
  would be great ;)



 


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



[android-developers] Re: PendingIntent.getService Returns an existing or new PendingIntent matching the given parameters

2009-10-16 Thread Neil

Sorry, I should have searched this group better before posting.  The
solution is here:
http://groups.google.com/group/android-developers/browse_thread/thread/2b98206d18a0192f/


On Oct 16, 2:59 pm, Neil neilb...@gmail.com wrote:
 In the documentation for PendingIntent.getService it says it Returns
 an existing or new PendingIntent matching the given parameters.  What
 does that mean?

 I have one notification which calls
 pendingIntent = PendingIntent.getService(context, 0, new Intent
 (context, XXXService.class).putExtra(action, 3), 0));
 setLatestEventInfo(context, title, text, pendingIntent);

 I have another notification which calls
 deleteIntent = PendingIntent.getService(context, 0, new Intent
 (context, XXXService.class).putExtra(action, 4), 0);

 And nowhere else in the code that uses these two actions (3 and 4).

 However when I click on the first notification it invokes onStart on
 XXXService as expected, but the extra action has the value 4, ie the
 extra from the second notification.

 I'm guessing that PendingIntent.getService returns the same
 PendingIntent both times, ignoring the extras the second time.

 So how can I have two different notifications with PendingIntents
 which invoke the same service but with different extras?
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread Carl Whalley

I'd love an invite too ... anyone ... thanks!

On Oct 16, 2:26 pm, Gavin Aiken gavin.ai...@imperial.ac.uk wrote:
 Takes at least 24 hours in my experience :) have fun waving!
 On Fri, Oct 16, 2009 at 2:09 PM, Kenneth Adam Miller 



 kennethadammil...@gmail.com wrote:
   Have any of you gotten an email yet?
  I swear I've sent them out...
  perhaps they're just nominations for a possible invite to google wave and
  not you know actual concrete invitations
  I don't know, but I'm guessing that you guys would still want it.
  Hahah

  :)
  I'm in class right now, but I'll review all you guys

  On Fri, Oct 16, 2009 at 7:40 AM, GSC greg.ch...@gmail.com wrote:

  If anyone else has an available invitiation, please send me one.

  Thanks

  On Oct 16, 7:31 am, ColletJb collet...@gmail.com wrote:
   I think there are no invitation left from Kenneth Adam Miller.

   But if anyone invited by him has invitation and can invite me, It
   would be great ;)
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to specify the maxWidth of a TextView as a percentage of screen width?

2009-10-16 Thread Streets Of Boston

Wrap another Layout (ViewGroup) around your text-view.

Set this new layout's width to 50% of the parent's width (using Weight
(or WeightSum... i can't remember) of 100 in the parent and
layoutWeight or 50 of your new layout. Then the child of your new
layout, your text-view, has a layoutWidth of 'wrap_content'. You may
need an extra new layout-out with layoutWeight of 50 as well, to make
sure the total is 100.


+--+
|  |
|  |
|  |
+---100+
|+---50--+---50---+|
||   |||
||[TextView] |||
||   |||
|+---++|
++---+++


On Oct 15, 11:24 pm, westmeadboy westmead...@yahoo.co.uk wrote:
 Thanks but (though maybe I've misunderstood) isn't that for specifying
 the width as a percentage? I want to specify the maxWidth as a
 percentage. The width just needs to wrap the content (but no more than
 the maxWidth).

 On Oct 15, 10:51 pm, RichardC richard.crit...@googlemail.com wrote:



  Took me a while to find it, original discussion 
  link:http://groups.google.com/group/android-developers/browse_thread/threa...

  --
  RichardC

  On Oct 15, 3:19 pm, RichardC richard.crit...@googlemail.com wrote:

   One workaround - you could put your controls into a horizontal
   LinearLayout (with it's width set to fill_parent) and then set the
   weights of each control inside the LinearLayout so that they total to
   100.

   For example, if you had 3 controls inside the LinearLayout you could
   use 10, 60, 30 for their weights.  That should cause the 1st control
   to use 10%, the second 60% and the third 30% (total 100%).

   Hope this works for you.

   --
   RichardC

   On Oct 15, 12:19 pm, westmeadboy westmead...@yahoo.co.uk wrote:

Thanks for your help.

I've looked into this a bit more and it seems that, for what I want to
do, its enough just to define another layout in the layout-land
folder.

Its not perfect, because I'm currently assuming just two possible
screen widths (320 and 480) and so setting the maxWidth accordingly
for those two scenarios. This might need a little reworking with the
new support of multiple screen-sizes in 1.6, but it will do for now...

On Oct 15, 1:50 pm, String sterling.ud...@googlemail.com wrote:

 On Oct 15, 5:32 am, westmeadboy westmead...@yahoo.co.uk wrote:

  For example, in the layout xml, is it possible to get a handle on 
  the
  screen width and apply some kind of arithmetic to it (e.g.
  maxWidth=(60 * @screenWidth) / 100px)

 AFAIK, no calculation is possible in the XML. I'd recommend doing this
 in your activity's Java code instead, using the TextView.setWidth()
 method.

  Also would this approach mean the maxWidth would be automatically
  recalculated on orientation changes?

 If you do it in Java, you can handle this yourself, as the activity
 gets recreated when the orientation changes.

 String- Hide quoted text -

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



[android-developers] Re: How to specify the maxWidth of a TextView as a percentage of screen width?

2009-10-16 Thread westmeadboy

Thanks, thats a nice solution. Useful diagram too.

However, I probably should have explained more about what I'm trying
to do, because if I understand you correctly, that solution does not
help what I want to do.

In my horizontal LinearLayout, there are actually two TextViews which
sit side by side one another (no gap). In the normal (i.e. not too
long text) situation the two TextViews are wide enough to fit all the
text on one line. However, when the text is too long then the text
needs to wrap and so I want to set the maxWidth of the first TextView
(or the minWidth of the second TextView).

Here is a two-item ListView I have. Each item is a LinearLayout
containing the two TextViews:

+--+
This is short | This is also short
+--+
This is not at all short | This is not so
so I need to wrap| short either
+--+

If I don't use maxWidth then the second TextView is sometimes too
narrow.

On Oct 16, 10:19 pm, Streets Of Boston flyingdutc...@gmail.com
wrote:
 Wrap another Layout (ViewGroup) around your text-view.

 Set this new layout's width to 50% of the parent's width (using Weight
 (or WeightSum... i can't remember) of 100 in the parent and
 layoutWeight or 50 of your new layout. Then the child of your new
 layout, your text-view, has a layoutWidth of 'wrap_content'. You may
 need an extra new layout-out with layoutWeight of 50 as well, to make
 sure the total is 100.

 +--+
 |                                          |
 |                                          |
 |                                          |
 +---100+
 |+---50--+---50---+|
 ||                   |                    ||
 ||[TextView]         |                    ||
 ||                   |                    ||
 |+---++|
 ++---+++

 On Oct 15, 11:24 pm, westmeadboy westmead...@yahoo.co.uk wrote:



  Thanks but (though maybe I've misunderstood) isn't that for specifying
  the width as a percentage? I want to specify the maxWidth as a
  percentage. The width just needs to wrap the content (but no more than
  the maxWidth).

  On Oct 15, 10:51 pm, RichardC richard.crit...@googlemail.com wrote:

   Took me a while to find it, original discussion 
   link:http://groups.google.com/group/android-developers/browse_thread/threa...

   --
   RichardC

   On Oct 15, 3:19 pm, RichardC richard.crit...@googlemail.com wrote:

One workaround - you could put your controls into a horizontal
LinearLayout (with it's width set to fill_parent) and then set the
weights of each control inside the LinearLayout so that they total to
100.

For example, if you had 3 controls inside the LinearLayout you could
use 10, 60, 30 for their weights.  That should cause the 1st control
to use 10%, the second 60% and the third 30% (total 100%).

Hope this works for you.

--
RichardC

On Oct 15, 12:19 pm, westmeadboy westmead...@yahoo.co.uk wrote:

 Thanks for your help.

 I've looked into this a bit more and it seems that, for what I want to
 do, its enough just to define another layout in the layout-land
 folder.

 Its not perfect, because I'm currently assuming just two possible
 screen widths (320 and 480) and so setting the maxWidth accordingly
 for those two scenarios. This might need a little reworking with the
 new support of multiple screen-sizes in 1.6, but it will do for now...

 On Oct 15, 1:50 pm, String sterling.ud...@googlemail.com wrote:

  On Oct 15, 5:32 am, westmeadboy westmead...@yahoo.co.uk wrote:

   For example, in the layout xml, is it possible to get a handle on 
   the
   screen width and apply some kind of arithmetic to it (e.g.
   maxWidth=(60 * @screenWidth) / 100px)

  AFAIK, no calculation is possible in the XML. I'd recommend doing 
  this
  in your activity's Java code instead, using the TextView.setWidth()
  method.

   Also would this approach mean the maxWidth would be automatically
   recalculated on orientation changes?

  If you do it in Java, you can handle this yourself, as the activity
  gets recreated when the orientation changes.

  String- Hide quoted text -

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



[android-developers] Custom translucent theme

2009-10-16 Thread Olivier Guilyardi

Hi,

I have 2 activities and need the second one to be translucent when
started by and over the first one.

When I set my activity theme to @android:style/Theme.Translucent, it
works.

I however want to customize alpha. So, following the example in
ApiDemos - app - TranslucentActivity, I write:

in styles.xml:

style name=Theme parent=android:Theme
style name=Theme.Translucent parent=android:style/
Theme.Translucent
item name=android:windowBackground@drawable/
translucent_background/item
item name=android:windowNoTitletrue/item
item name=android:colorForeground#fff/item
/style

and in colors.xml:

drawable name=translucent_background#8000/drawable

and set my activity theme to @style/Theme.Translucent

But it doesn't work any more, the second activity is black and opaque.

I also tried with (notice the @) :
style name=Theme.Translucent parent=@android:style/
Theme.Translucent

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



[android-developers] Custom View donot Draw in ListView

2009-10-16 Thread purvi

Hello,

I have a query, When I try to use a customview in the listview, the
custom view donot display. All other views are displayed except the
custom view.
When I try to display the view like a normal layout (not in a list),
it displays fine.

Can anyone please help me to draw the customview in the list?

the main.xml file - layout that contains the custom view
?xml version=1.0 encoding=utf-8?
LinearLayout

TextView
android:layout_width=fill_parent
android:layout_height=wrap_content
android:text=@string/hello
/
CheckBox android:id=@+id/check2
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=checkbox_2 /
 app.customise.tab.CustomBackground
android:id=@android:id/list
android:layout_width=wrap_content
android:layout_height=wrap_content/

/LinearLayout

the list.xml file - the list view file
LinearLayout
   FrameLayout
   ListView android:id=@android:id/android:list
   android:layout_width=fill_parent
   android:layout_height=fill_parent/

   /FrameLayout
   /LinearLayout

the CustomBackground.java - class that extends the View class and
draws a rounded rectangle

public class CustomBackground extends View{

public CustomBackground(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
mRect = new Rect(40, 0, 310, 90);

mDrawable = new GradientDrawable
(GradientDrawable.Orientation.TOP_BOTTOM,
 new int[] { 0xFFA5C3E9,
 0xFF548DD4 });
mDrawable.setShape(GradientDrawable.RECTANGLE);
mDrawable.setGradientRadius((float)(Math.sqrt(2) * 60));
}

private RectmRect;
private GradientDrawable mDrawable;
public CustomBackground(Context context) {
super(context);
// TODO Auto-generated constructor stub

mRect = new Rect(40, 0, 310, 90);

mDrawable = new GradientDrawable
(GradientDrawable.Orientation.TOP_BOTTOM,
 new int[] { 0xFFA5C3E9,
 0xFF548DD4 });
mDrawable.setShape(GradientDrawable.RECTANGLE);
mDrawable.setGradientRadius((float)(Math.sqrt(2) * 60));
}

void setCornerRadii(GradientDrawable drawable, float r0,
float r1, float r2, float r3) {
drawable.setCornerRadii(new float[] { r0, r0, 
r1, r1, r2, r2, r3,
r3 });
}

@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
//super.onDraw(canvas);

System.out.println(ON DRAW CALLED);

 mDrawable.setBounds(mRect);

 float r = 10;
 canvas.translate(10, 10);
 mDrawable.setGradientType(GradientDrawable.LINEAR_GRADIENT);
 setCornerRadii(mDrawable, r, r, r, r);
 mDrawable.draw(canvas);

invalidate();
}


the DummyActivity.class extends ListActivity

public class DummyActivity extends ListActivity {
   @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/**
 * Display layout of main.xml with custom view.
 * Works fine. Displays one checkbox, two radio buttons and
one rounded rectangle
 * Class extends Activity
 */
   // setContentView(R.layout.main);
/**
 * The above display in list.
 * Displays one checkbox, two radio buttons. Rounded rectangle
not displayed
 */
setContentView(R.layout.list);
mAdapter ma = new mAdapter(this);
for(int i=0;i5;i++)
{
ma.add(i);
}
this.setListAdapter(ma);

}

public class mAdapter extends BaseAdapter {

private Context ctx;

ListIntegercount = new ArrayListInteger();
public mAdapter(Context c)
{
ctx=c;
}
public void add(int i)
{
count.add(i);
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return count.size();
}

@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return count.get(position);
}

@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return 0;
}

@Override
public View getView(int 

[android-developers] CheckedTextView.isChecked

2009-10-16 Thread stanlick

This is a two part question:

1) Is there a preferred listener for this control?  I notice in order
to get this work, I had to listen for
AdapterView.OnItemSelectedListener and AdapterView.OnItemClickListener

2) Within my onItemClick method, the value of control.isChecked() is
opposite the GUI.  IOW, when I check the box, it returns false.  When
I uncheck, it returns true.

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



[android-developers] Re: ListView/Adapter Crash in 1.6 only: illegalStateException. 1.6 bug?

2009-10-16 Thread Sergey Vasilinets

Alexey,
ListView chashes in case of:
 if (mItemCount != mAdapter.getCount()) {
throw new IllegalStateException(The content of the
adapter has changed but 
+ ListView did not receive a notification.
Make sure the content of 
+ your adapter is not modified from a
background thread, but only 
+ from the UI thread.);
}
(it is a quote from sources ListView.java) and only in this case.
Thus,  if number of elements wasn't changed, everything is ok.
On 15 окт, 16:47, Alexey goalstu...@gmail.com wrote:
 Romain, one more question. Is this rule applicable for adding/removing
 elements from adapter (in other words - changing number of elements in
 ListView) or also when changing content of elements?

 On 15 окт, 16:31, Alexey goalstu...@gmail.com wrote:

  Romain, your answers are clear, but confusing. As I understood
  modifying adapter should be done in workerthreadand only
  notifyDataSetChanged in UIthread.
  Now as I see the concept is different, but what if we need to add
  several hundred items into adapter, won't UIthreadbe in freeze for
  this time?
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Change button color on Focus and on click

2009-10-16 Thread Farproc

There was a post about that in this group, but I can't find it now!!
Very wired

You can search for how to make a view touchable visiually.
If u find it, you will see how to set different backgrounds in
different states(pressed, long pressed, focused, etc). Furthermore, if
these drawables you set are pics you are actually set the shape!

On Oct 16, 6:39 pm, Shoby shoby.su...@wipro.com wrote:
 Hi Farproc,

 Could you please provide a sample code or a link to a sample code for
 the same?

 Thanks,
 Shoby

 On Oct 16, 3:04 pm, Farproc farp...@gmail.com wrote:



  Set button's background to a StateListDrawable object or xml resource.

  Here is a sample to use StateListDrawable resource. It's very easy you
  event do not need to write the listeners!!!

  On 10月16日, 下午5时43分, Shoby shoby.su...@wipro.com wrote:

   Hi i am developing an application that has a button whose color should
   change green color on focusing on the button and the color of button
   should change to red on clicking the button. I am using
   setBackgroundResource() in the onClick and onLongClick listeners.
   Though it changes the button color, it also changes the button shape
   by making it look like a rectangle. How can this be solved?  i have
   used the below code to do the same:

   final Button b = (Button)findViewById(R.id.Button01);
   b.setOnLongClickListener(new View.OnLongClickListener(){

   public boolean onLongClick(View v) {
   b.setBackgroundResource(R.color.green);
   return false;
   }
   });

  b.setOnClickListener(new View.OnClickListener() {
   public void onClick(View view) {
   b.setBackgroundResource(R.color.red);
   }

   });

   How can i achieve the functionality with out changing the shape of the
   button
   Can someone tell me how this functionality can be achieved?
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] ViewFlipper with clickable items

2009-10-16 Thread Marc Reichelt

Hi!

I am using the ViewFlipper to switch between different views by
implementing a swing (mouse down, move and release). This works great
with non-clickable items, e.g. a TextView.

But if the views are clickable items (such as buttons), the onTouch()
method of the ViewFlipper is not called. :-(
Does anyone know why this is so and how I can implement this pseudo
gesture?

I know that I could do this easily by using the 1.6 SDK and the new
gesture support, but my application is limited to 1.5.


Thanks in advance  regards

Marc Reichelt   ||   http://www.marcreichelt.de/


PS: I developed a simple example so that you can see what I mean.



- Content of TestFlipper.java -
package com.example.test;

import android.app.Activity;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.widget.ViewFlipper;

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

final ViewFlipper flipper = (ViewFlipper) findViewById
(R.id.flipper);
flipper.setOnTouchListener(new OnTouchListener() {

private float oldX;

@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
// save start X location
oldX = event.getX();
return true;

case MotionEvent.ACTION_UP:
// get old X location where the user 
started the move
float currentX = event.getX();

// do not consume event if it is not 
clear enough
if (Math.abs(currentX - oldX)  25.0f)
return false;

// show previous view
if (oldX  currentX) {
flipper.showPrevious();
return true;
}

// show next view
if (oldX  currentX) {
flipper.showNext();
return true;
}
}

// do not consume this event by default
return false;
}
});

}
}
- End -



- Content of main.xml -
?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


ViewFlipper android:layout_height=fill_parent
android:layout_width=fill_parent android:id=@+id/flipper
Button android:id=@+id/b1 android:layout_height=fill_parent
android:layout_width=fill_parent android:text=1
android:textSize=100px /
Button android:id=@+id/b2 android:layout_height=fill_parent
android:layout_width=fill_parent android:text=2
android:textSize=100px /
Button android:id=@+id/b3 android:layout_height=fill_parent
android:layout_width=fill_parent android:text=3
android:textSize=100px /
/ViewFlipper

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



[android-developers] Re: Market screen shots

2009-10-16 Thread Streets Of Boston

The market compresses the uploaded images heavily.
Just check the size of the images in your Market-Publish site of your
app. They are quite small and tons of JPEG artifacts show up. Even if
you uploaded PNGs, the images will become JPEGs, heavily compressed
ones.


On Oct 16, 11:48 am, westmeadboy westmead...@yahoo.co.uk wrote:
 On Oct 14, 10:49 pm, Maps.Huge.Info (Maps API Guru)

 cor...@gmail.com wrote:
  Strangely, the market asks for 320x480 screen shots then reduces them
  in size by a few pixels, and sort of smudging them in the process. It
  seems like it would have been smarter to ask the developer to deliver
  the properly sized image so that this pixilation wouldn't be
  necessary.

 I haven't noticed that difference in dimensions but my screenshots
 were undergoing some kind of dithering (smudging?) after uploading.
 Then I realised that I had uploaded them as 8-bit. So I resubmitted
 them as 24-bit and the quality is now as it should be.

 So for some reason, whatever software they use to convert 8-bit to 24-
 bit doesn't give very nice results.
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: R.drawable

2009-10-16 Thread Farproc

It's impossible but you can load an image using BitmapFactury at
runtime.

On Oct 16, 8:49 pm, nisha.devit nisha.de...@gmail.com wrote:
 Hi,

 How we can store image files(*.png) to the folder R.drawable at runtime?

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



[android-developers] Re: Market screen shots

2009-10-16 Thread westmeadboy

Yeah, that's true in most cases.

My images actually started out at about 12KB (8-bit PNG) which looked
great before uploading them. The conversion magic on the server
actually made them larger (downloads as 21KB) but with all the ugly
dithering.

Re-uploading them as 24-bit PNG (25KB) gave much better results
(downloads as 25KB).

On Oct 17, 12:00 am, Streets Of Boston flyingdutc...@gmail.com
wrote:
 The market compresses the uploaded images heavily.
 Just check the size of the images in your Market-Publish site of your
 app. They are quite small and tons of JPEG artifacts show up. Even if
 you uploaded PNGs, the images will become JPEGs, heavily compressed
 ones.

 On Oct 16, 11:48 am, westmeadboy westmead...@yahoo.co.uk wrote:



  On Oct 14, 10:49 pm, Maps.Huge.Info (Maps API Guru)

  cor...@gmail.com wrote:
   Strangely, the market asks for 320x480 screen shots then reduces them
   in size by a few pixels, and sort of smudging them in the process. It
   seems like it would have been smarter to ask the developer to deliver
   the properly sized image so that this pixilation wouldn't be
   necessary.

  I haven't noticed that difference in dimensions but my screenshots
  were undergoing some kind of dithering (smudging?) after uploading.
  Then I realised that I had uploaded them as 8-bit. So I resubmitted
  them as 24-bit and the quality is now as it should be.

  So for some reason, whatever software they use to convert 8-bit to 24-
  bit doesn't give very nice results.
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Animation between 2 activities?

2009-10-16 Thread Marc Reichelt

Hi Mark,

thanks for your help!
By the way: I now found out why my views took so long to load. An odd
combination of an Adapter and layouting led to many useless getView()
calls. Now even 10 views are fast enough for the view flipper.
Anyway: I think I will use your information to make the ViewFlipper
fast even if devices are slow. :-)


Regards

Marc Reichelt   ||   http://www.marcreichelt.de/


On 16 Okt., 13:59, Mark Murphy mmur...@commonsware.com wrote:
 Marc Reichelt wrote:
  I program on an application where different views are arranged
  horizontally, each view of screen size. The user should be able to
  switch between these views using his finger. I first used the
  ViewFlipper, which was great for simple layouts, but which is *way*
  too slow if the layouts of the views are more complex, because all
  Views are drawn.

 Step #1: Put only the first screen's worth of content into the
 ViewFlipper in your layout upon creation of your activity.

 Step #2: On the first swipe/tap/gesture/whatever to a never-before-seen
 page, inflate the content, add it to the ViewFlipper, and make it the
 displayed child.

 Step #3: On the second and subsequent moves to the page, just make it
 the displayed child.

  A much better method would be to place one layout per activity and
  switch between these activities using the slide in / slide out
  animations.
  Is something in this direction possible with Android right now? Any
  recommendations or best practices?

 Users control the animations between activities (Settings  Sound 
 display  Animation), not developers. You are welcome to use a
 swipe/tap/gesture/whatever to elect to start or finish an activity, but
 the user will control whether or not there are animations between them.

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

 _Beginning Android_ from Apress Now Available!
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ListView/Adapter Crash in 1.6 only: illegalStateException. 1.6 bug?

2009-10-16 Thread Romain Guy

 (it is a quote from sources ListView.java) and only in this case.
 Thus,  if number of elements wasn't changed, everything is ok.

If you modify the adapter without changing the number of items it can
also be bad. It's just that ListView does not detect this case.

 On 15 окт, 16:47, Alexey goalstu...@gmail.com wrote:
 Romain, one more question. Is this rule applicable for adding/removing
 elements from adapter (in other words - changing number of elements in
 ListView) or also when changing content of elements?

 On 15 окт, 16:31, Alexey goalstu...@gmail.com wrote:

  Romain, your answers are clear, but confusing. As I understood
  modifying adapter should be done in workerthreadand only
  notifyDataSetChanged in UIthread.
  Now as I see the concept is different, but what if we need to add
  several hundred items into adapter, won't UIthreadbe in freeze for
  this time?
 




-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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



[android-developers] Re: How to redirect the Logs into an file.

2009-10-16 Thread jotobjects

for example to write the log onto the device  -

adb logcat -f /data/log.log


On Oct 16, 2:43 am, peeyush varshney varshney.peey...@gmail.com
wrote:
 Hi,
           I want to redirect the Logs into an file. How should i proceed
 ?

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



[android-developers] Location based problem in emulator

2009-10-16 Thread Wayne Wenthin
Why would this blow up in the emulator if I have already pushed a location
to it in DDMS?  It works fine on the handset.  Am I missing something really
simple?
Location loc = lm.getLastKnownLocation(lm.getProviders(true).get(0));


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

http://www.fuligin.com

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



[android-developers] Streetview intent question

2009-10-16 Thread ian

I'm unable to get Streetview running from an intent. For example, I'm
using the following simple code which does not work:


package ian.com.street;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;


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

double lat =  44.640545;
double lon =-63.575897;

Intent streetIntent = new Intent(Intent.ACTION_VIEW, Uri.parse
  (google.streetview:cbll= + lat +
  , + lon + cbp=1,180,,0,1.0));
try {
startActivity(streetIntent);

} catch (Exception e) {}

}
}


My manifest ends :

uses-library android:name=com.google.android.maps/
/application
uses-permission android:name=android.permission.INTERNET/
uses-permission
android:name=android.permission.ACCESS_FINE_LOCATION/
uses-sdk android:minSdkVersion=3 /
/manifest


Which seems OK.

Now I'm using release 1.5r3 and calling the 9.1 ADT. The lat/long are
right on a camera icon location in front of my house. Does anyone have
any suggestions on what the problem could be?
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] yalf - yet another logcat frontend

2009-10-16 Thread Pedro Banderas
hi,

in order to dynamically filter logcat messages i created simple
graphical frontend (~150 code lines).

it supports filtering messages by tags (left Tags panel) as well as
by matching message bodies against some regexp.

requires pyqt4

any comments as always welcome

thanks
pskink

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



qtlogcat.tar.gz
Description: GNU Zip compressed data


[android-developers] Re: Streetview intent question

2009-10-16 Thread ian

Oh my gosh, it started to work just fine. Anyway the following code
serves as a simple example for anyone just starting to use Streetview/
My house looks great on the emulator screen!



On Oct 16, 2:14 pm, ian stilbit...@gmail.com wrote:
 I'm unable to get Streetview running from an intent. For example, I'm
 using the following simple code which does not work:

 package ian.com.street;

 import android.app.Activity;
 import android.content.Intent;
 import android.net.Uri;
 import android.os.Bundle;

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

                 double lat =  44.640545;
                 double lon =-63.575897;

                 Intent streetIntent = new Intent(Intent.ACTION_VIEW, Uri.parse
                           (google.streetview:cbll= + lat +
                                           , + lon + cbp=1,180,,0,1.0));
                 try {
                 startActivity(streetIntent);

         } catch (Exception e) {}

                 }

 }

 My manifest ends :

                 uses-library android:name=com.google.android.maps/
     /application
         uses-permission android:name=android.permission.INTERNET/
         uses-permission
 android:name=android.permission.ACCESS_FINE_LOCATION/
         uses-sdk android:minSdkVersion=3 /
 /manifest

 Which seems OK.

 Now I'm using release 1.5r3 and calling the 9.1 ADT. The lat/long are
 right on a camera icon location in front of my house. Does anyone have
 any suggestions on what the problem could be?
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Should we still force our apps to API level 2?

2009-10-16 Thread Greivin Lopez

Thank you Mark. It sounds very interesting!, specially the JavaPP link.
--~--~-~--~~~---~--~~
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Test for Android SDK version? Switch code for 1.5 cupcake or 1.6 donut

2009-10-16 Thread A. Elk

Curiosity: what variation? is it related to hardware, or to API
differences?

On Oct 15, 5:11 pm, Brady brady.kro...@gmail.com wrote:
 Hi,

 is it possible at runtime to determine whether the platform is running
 cupcake or donut? Due to some variation in my app between the two
 versions I'd like to run different code based on the SDK version.

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



[android-developers] Re: trouble with programmatically adding mock location data

2009-10-16 Thread Wayne Wenthin
Frederik,Did you ever find a way around this?   I am experiencing the same
problem.

Wayne

On Mon, Sep 28, 2009 at 6:53 AM, Frederik Pfisterer pfiste...@gmail.comwrote:


 Seems i'm talking with myself :-)
 Seems like it's a bug though, filed:
 http://code.google.com/p/android/issues/detail?id=4036

 On 28 Sep., 12:38, Frederik Pfisterer pfiste...@gmail.com wrote:
  Here is the code using a mock location provider. Basically my question
  is, why is the mock provider not returning the previously set mock
  location correctly. See last comment in code:
 
  private GeoPoint getUserLocation() {
 
  LocationManager locationManager =
 (LocationManager)getSystemService
  (Context.LOCATION_SERVICE);
 
  if (!PRODUCTION_ENVIRONMENT){
 
  //Get some mock location data in the game
 
 locationManager.addTestProvider(MOCK_PROVIDER_NAME, true, false,
  true, false, false, false, false, Criteria.POWER_LOW,
  Criteria.ACCURACY_COARSE);
  Location location = new
 Location(MOCK_PROVIDER_NAME);
  location.setLatitude(32.64480);
  location.setLongitude(-16.90967);
  location.setTime(new Date().getTime());
 
 locationManager.setTestProviderLocation(MOCK_PROVIDER_NAME,
  location);
 
 locationManager.setTestProviderEnabled(MOCK_PROVIDER_NAME, true);
 
  }
 
  //i just want an approximate location so no high
 expectations here
  Criteria criteria = new Criteria();
  criteria.setAccuracy(Criteria.ACCURACY_COARSE);
  criteria.setPowerRequirement(Criteria.NO_REQUIREMENT);
 
  //this correctly retrieves the mock location provider
  String provider =
 locationManager.getBestProvider(criteria, true);
  if (provider != null) {
  //this is where the mock provider returns null ... why?
  Location location =
 locationManager.getLastKnownLocation(provider);
  return new
 GeoPoint((int)(location.getLatitude()*E6_LATLONG), (int)
  (location.getLongitude()*E6_LATLONG));
  }else return null;
  }
 
  Might this be a bug in the API?
 
  On 27 Sep., 16:43, Frederik Pfisterer pfiste...@gmail.com wrote:
 
   I am working on an application that requires an approximate position
   of the user, so basically i am fine with any relatively recent
   location data i can get. However I can't seem to get things right
   using mock location data and would therefore appreciate your help.
   The method i'm having tries to set mock location data for the gps
   provider and tries to later retrievie it BUT:
  locationManager.setTestProviderEnabled(gps, true); seems to fail
   because i do not get any active location provider from the location
   manager.
   When I tried using a mock location provider with addTestProvider and
   give it my mock location, the LocationManager returns me this mock
   provider with getProviders(true) but then getLastKnownLocation returns
   null instead of the provided mock location.
 
   Here is my code (see comments as well):
 
   private GeoPoint getUserLocation() {
 
   LocationManager locationManager =
 (LocationManager)getSystemService
   (Context.LOCATION_SERVICE);
 
   if (!PRODUCTION_ENVIRONMENT){
   //Get some mock location data in the game
   Location location = new Location(gps);
   location.setLatitude(32.64480);
   location.setLongitude(-16.90967);
   location.setTime(new Date().getTime());
   locationManager.setTestProviderLocation(gps,
 location);
   locationManager.setTestProviderEnabled(gps,
 true);
 
   //retrieve the list of active providers for
 debugging purposes, the
   activated mock gps provider is not returned here
   ListString locationProviders =
 locationManager.getProviders
   (true);
  
 locationManager.setTestProviderEnabled(network, true);
 
   }
 
   //i just want an approximate location so no high
 expectations here
   Criteria criteria = new Criteria();
   criteria.setAccuracy(Criteria.ACCURACY_COARSE);
   criteria.setPowerRequirement(Criteria.NO_REQUIREMENT);
 
   //this correctly retrieves a mock location provider but
 not the mock
   enabled gps
   String provider =
 locationManager.getBestProvider(criteria,true);
   if (provider != null) {
   //this is where the mock provider returns null
   Location location =
 locationManager.getLastKnownLocation(provider);
   return new
 

[android-developers] Strange behavior when loading images from SDCard

2009-10-16 Thread Mihai Fonoage

Hi,

I have an activity that loads and displays images from the SDCard. I
create a new AVD, specify the desired image of the sd card (which has
all my pictures already loaded), specify that AVD for deployment, and
start the application. I noticed a strange behavior. At first, the
images are not loaded; the getView method is never called, although
the constructor of my adapter is called. If I close the application,
and open the Gallery app that comes pre-installed, I see that the sd
card folder has the correct number of images, and it 'displays' the
first four. If I start my application again, those four images are
displayed, and only those. If I go back to the Gallery application,
open the sd card folder so that it loads all images, and restart my
application, all images are successfully displayed. Any reason why
this happens? I am using version 1.6, and (part of) my code is below:

[code]
// Set up an array of the Thumbnail Image ID column we want
String[] projection = {MediaStore.Images.Thumbnails._ID};

// Create the cursor pointing to the SDCard
cursor = managedQuery
( MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI,
projection,
null,
null,
MediaStore.Images.Thumbnails.IMAGE_ID);

// Get the column index of the Thumbnails ID
columnIndex = cursor.getColumnIndexOrThrow
(MediaStore.Images.Thumbnails._ID);
sdcardImages = (GridView) findViewById(R.id.sdcard);

//new LoadImagesFromSDCard().execute();

imageAdapter = new ImageAdapter(getApplicationContext());
sdcardImages.setAdapter(imageAdapter);
[/code]

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



[android-developers] Problem to show unicode strings in TextView

2009-10-16 Thread qmwestview

Hi there,

My data (stored as UTF-8 in the SQL db), when arrive at the phone as
json strings, appear to be decimal Unicode, such as
#32422;#20811;#23567;

When I use setText(...) to show them in TextView, they are shown in
their original form, rather than the characters they represent. If I
use their equivalent form of UTF-8, i.e. \u7ea6\u514b\u5C0f, they
then are shown correctly as 约克小。

My questions are:

1. How to receive the data in UTF-8 rather than decimal unicode? (I
tried InputStreamReader(inputStream, UTF-8) but seems not working)

or

2. How to send the data in UTF-8 for Android rather than decimal
unicode (the same decimal unicode work fine for browser)?

or

3. Is there any function which can turn decimal unicode string into
UTF-8 string?

4. Any other advice please?

Many thanks in advance,

qmwestview





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



[android-developers] Extendind Contacts application

2009-10-16 Thread A B

Hi,

Do you know if there is a way to extend native contacts applications.
I mean if there is any plugin framework that would allow you to add
tour own stuff into the contacts e.g. new tabs or menu commands. I
remember there was such thing in Symbian (via ECOM plugins). I briefly
checked the Contacts source code but could not find any trace of such
feature.


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



[android-developers] Problem with gridview refresh

2009-10-16 Thread GroupeM2ICPS

Hello,

I made a simple game called taquin in french, here you can see an
example of this game (it's not mine) : 
http://rigolmath.free.fr/taquin/taquin.htm#retour

In my game the numbers are replaced by picture's fragments (object
Bitmap), when I do movements by myself (by clicking on a picture
fragment) the refresh of the gridview works. But when the movements
are automatics (I made an heuristic function to solve the game) the
refresh doesn't work at each movement...

To refresh the gridview I call the method notifyDataSetChanged() on
the object of my class ImageAdapter (extends BaseAdapter) which has
the gridview as attribute. I put a Thread.sleep(500) after each
notifyDataSetChanged(), the sleep works beacause it delays the
game solving but the view is not refreshed.

Do you have an idea to fix this problem ?



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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread renjun wang

On Thu, 2009-10-15 at 22:41 -0500, Kenneth Adam Miller wrote:
 Who wants to be in Google wave?
 I have 16 invitations 

does it have linux version?


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



[android-developers] Does Android support to using resource for activity attribute in AndroidManefest.xml

2009-10-16 Thread shi li
I have the following case.
I have two string xml files under the dir of res/values and
res/values-small. The strings in the two files are used to describe the
different activity attribute. But i found that when i run my apk on
QVGA emulator, the system always get the string value from res/values. Here
is my example

activity android:name=TestActivity
android:label=@TestLabel
android:taskAffinity=test
android:launchMode=@string/launchMode
android:clearTaskOnLaunch=@string/clearTask
android:enabled=@string/testEnabled

and then there are the following values in res/values/config.xml
string name=launchMode0/string
string name=clearTaskfalse/string
string name=testEnabledfalse/string

and there are the following values in res/values-small/config.xml
string name=launchMode2/string
string name=clearTasktrue/string
string name=testEnabledtrue/string

when i run my apk on QVGA emulator, i found that the system always get the
values from res/values/config.xml. Thus i want to know if Android support to
use resource to describe the activity attribute, is there anyone can give me
some info or clues? thanks

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



[android-developers] Does Android support to using resource for activity attribute in AndroidManefest.xml

2009-10-16 Thread YANG

I have the following case.
I have two string xml files under the dir of res/values and res/values-
small. The strings in the two files are used to describe the different
activity attribute. But i found that when i run my apk on QVGA
emulator, the system always get the string value from res/values. Here
is my example

activity android:name=TestActivity
android:label=@TestLabel
android:taskAffinity=test
android:launchMode=@string/launchMode
android:clearTaskOnLaunch=@string/clearTask
android:enabled=@string/testEnabled


and then there are the following values in res/values/config.xml
string name=launchMode0/string
string name=clearTaskfalse/string
string name=testEnabledfalse/string

and there are the following values in res/values-small/config.xml
string name=launchMode2/string
string name=clearTasktrue/string
string name=testEnabledtrue/string

when i run my apk on QVGA emulator, i found that the system always get
the values from res/values/config.xml. Thus i want to know if Android
support to use resource to describe the activity attribute, is there
anyone can give me some info or clues? thanks

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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread da zh
dear guru,i'd like to have one. it will be very nice of u if you give me one
.thanks ahead~[?]

2009/10/16 Guru gurudut...@gmail.com

 I want it.Thanks very much!

 On Fri, Oct 16, 2009 at 9:11 AM, Kenneth Adam Miller 
 kennethadammil...@gmail.com wrote:

 Who wants to be in Google wave?
 I have 16 invitations





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

inline: 349.gif

[android-developers] Locationmanager is running after removed listner

2009-10-16 Thread Lars Carlsson

Hi
I have a service with a location manger and a lister that stores
location in the DB. When the client runs stopService the service will
remove the listener but for some reason i still get 5 -10 locations
update to my listener why do i get this.


public void onDestroy() {
Log.w(GpsRecService , Shutdown service);
m_locationMgr.removeUpdates(listener);
   }

10-16 16:42:38.043: WARN/GpsRecService(7407): Shutdown service --
here the listner is removed

10-16 16:42:38.073: INFO/LocationUpdater(7407): add location Location
[mProvider=gps,mTime=1255704141000,mLatitude=57.72109508514404,mLongitude=12.01827585697174,mHasAltitude=true,mAltitude=117.0,mHasSpeed=true,mSpeed=0.0,mHasBearing=true,mBearing=0.0,mHasAccuracy=true,mAccuracy=24.0,mExtras=Bundle
[mParcelledData.dataSize=52]]
10-16 16:42:38.090: new location found store to DB
 10-16 16:42:39.833: INFO/LocationUpdater(7407): add location Location
[mProvider=gps,mTime=1255704142000,mLatitude=57.72109508514404,mLongitude=12.01827585697174,mHasAltitude=true,mAltitude=117.0,mHasSpeed=true,mSpeed=0.0,mHasBearing=true,mBearing=0.0,mHasAccuracy=true,mAccuracy=24.0,mExtras=Bundle
[mParcelledData.dataSize=52]]
10-16 16:42:39.990: new location found store to DB


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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread budziq

Well. Who wouldn't want one ;)? I guess I'd like one too ;)

On Oct 16, 4:02 pm, Carl Whalley carl.whal...@googlemail.com wrote:
 I'd love an invite too ... anyone ... thanks!

 On Oct 16, 2:26 pm, Gavin Aiken gavin.ai...@imperial.ac.uk wrote:

  Takes at least 24 hours in my experience :) have fun waving!
  On Fri, Oct 16, 2009 at 2:09 PM, Kenneth Adam Miller 

  kennethadammil...@gmail.com wrote:
    Have any of you gotten an email yet?
   I swear I've sent them out...
   perhaps they're just nominations for a possible invite to google wave and
   not you know actual concrete invitations
   I don't know, but I'm guessing that you guys would still want it.
   Hahah

   :)
   I'm in class right now, but I'll review all you guys

   On Fri, Oct 16, 2009 at 7:40 AM, GSC greg.ch...@gmail.com wrote:

   If anyone else has an available invitiation, please send me one.

   Thanks

   On Oct 16, 7:31 am, ColletJb collet...@gmail.com wrote:
I think there are no invitation left from Kenneth Adam Miller.

But if anyone invited by him has invitation and can invite me, It
would be great ;)

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



[android-developers] how to create our own BorderLayout

2009-10-16 Thread murali

Hi,
   I want to create our own  BorderLayout like this
BorderLayout
  left
  /left
  right
 /right
 top
  /top
  bottom
  /bottom
/BorderLayout


i know there is no layout in android like this , so I want to create
like this.

I have seen a  borderLayout http://www.anddev.org/viewtopic.php?p=5087
here .but if we want to create a BorderLayout inside the
BorderLayout,with this example  comlexity is more.(inner
BorderLayout).so if u have any solutions tell me.


Thanks and Regards
D.murali,
Android Developer

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



[android-developers] analog clock

2009-10-16 Thread jasmeet

i am trying to develop a world clock application in android. i want to
use the analog clock for showing the time in different cities/
countries but don't know how to set the analog clock to a particular
time. can somebody please help me with this?

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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread da zh
my account is sexro...@gmail.com
2009/10/16 da zh sexro...@gmail.com

 dear guru,i'd like to have one. it will be very nice of u if you give me
 one .thanks ahead~[?]

 2009/10/16 Guru gurudut...@gmail.com

 I want it.Thanks very much!

 On Fri, Oct 16, 2009 at 9:11 AM, Kenneth Adam Miller 
 kennethadammil...@gmail.com wrote:

 Who wants to be in Google wave?
 I have 16 invitations





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

inline: 349.gif

[android-developers] Re: Google wave invitations...?

2009-10-16 Thread da zh
hi,dear guru have u see my mail?

2009/10/16 Kenneth Adam Miller kennethadammil...@gmail.com

 Who wants to be in Google wave?
 I have 16 invitations

 


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



[android-developers] Android put rectangles on camerasurface

2009-10-16 Thread devil

Hello,
I have a camera preview on my device and now I like to put some
shapes  (e.g. rectangles) on specific places on my screen, with still
the camera view turned on. How can I do this? First I was thinking
about two layers, and the second one (the one with the shapes) will be
transperent, but I somehow read that this is not possible. Then I saw
the possibility to draw rectangles, but I can't put them on my
FrameLayout (which I use for the camera preview).
Can anybody give me some advice please?

Thanks a lot in advance.
Regards

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



[android-developers] Re: Google wave invitations...?

2009-10-16 Thread nikhil

Can I get one too?

On Oct 16, 10:02 pm, Carl Whalley carl.whal...@googlemail.com wrote:
 I'd love an invite too ... anyone ... thanks!

 On Oct 16, 2:26 pm, Gavin Aiken gavin.ai...@imperial.ac.uk wrote:



  Takes at least 24 hours in my experience :) have fun waving!
  On Fri, Oct 16, 2009 at 2:09 PM, Kenneth Adam Miller 

  kennethadammil...@gmail.com wrote:
    Have any of you gotten an email yet?
   I swear I've sent them out...
   perhaps they're just nominations for a possible invite to google wave and
   not you know actual concrete invitations
   I don't know, but I'm guessing that you guys would still want it.
   Hahah

   :)
   I'm in class right now, but I'll review all you guys

   On Fri, Oct 16, 2009 at 7:40 AM, GSC greg.ch...@gmail.com wrote:

   If anyone else has an available invitiation, please send me one.

   Thanks

   On Oct 16, 7:31 am, ColletJb collet...@gmail.com wrote:
I think there are no invitation left from Kenneth Adam Miller.

But if anyone invited by him has invitation and can invite me, It
would be great ;)

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



[android-developers] Help USB debug mode

2009-10-16 Thread Enrico

Hi guys,
I need an infotmation about usb debug mode. During a test on my device
(samsung galaxy) something went wrong, so I need to access with adb
from the recovery mode (I use a custom reecovery of Drakaz), but the
debug mode is not enabled in my device and I can't access to the
system due to a start up problem...
There is a way to enable usb debug mode from terminal or phisically?
(I can only work with fastboot at the moment...)

Thank you in advance

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



[android-developers] Re: ListActivity.onListItemClick(...) not being invoked

2009-10-16 Thread nikhil

I encountered the same problem as well. Whenever I put a checkbox on a
list item or an expandable list item, the onListItemClick() stops
working.

I just want to know how was the Gmail app list view created. Romain
Guy mentioned in the video that it was created using a custom view but
how did the author manage to make the onListItemClick() work?

I had to write an onClickListener for my custom view in order to make
up for onListItemClick not working and I am not too happy with it.
Please help me out with this.

On Sep 18, 1:01 pm, Bryan bestr...@gmail.com wrote:
 Scoured the docs and forums, couldn't find an answer or reason why
 this is happening:

 I have a class that extends ListActivity and a View coming from XML
 for each row that looks like this:

 LinearLayout ...
   TextView ... /
   TextView ... /

   CheckBox ... /
 /LinearLayout

 When I click on one of the items in the list, the onListItemClick() i
 have in my activity is not invoked. Turns out, if I comment out the
 CheckBox node in my layout xml, it works. I feel like there is a
 simple explanation that I don't know about.. maybe because CheckBox is
 an actual interactive widget it's overriding some click action or
 something?

 Help appreciated.

 -bryan.

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



[android-developers] Implementing 'push technology' into Android apps

2009-10-16 Thread rubeN_vl

Hi,

What are the different ways to implement push technology into your
Android app?
The client Android app is supposed to receive content (XML Data)
pushed by the server.
I've looked around and found out it was possible to achieve it with
usage off the SOAP protocol.
But are there some better ways top implement push?
The main concern in this project is the phones battery life, all off
it has to happpen over WiFi, pushed content has to be viewable on the
device immediately.

Thoughts and/or sample code is welcome!

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



[android-developers] Android Theme Widget wanted (For mAPPn's Home Alternative Application - aHome)

2009-10-16 Thread Brian

Hi there,

My name is Brian and I am the Operation Manager of mAPPn, a mobile
application and software provider based in Southern California. I am
posting the message here looking to potentially partnerships with
Android designers and developers.

In short, we have had great success on the Android platform with very
successful applications. Our most prominent, titled aHome, gained
tremendous popularity amongst users and even caught the attention of T-
Mobile USA, who then proceeded to form a partnership with our company
for their successful G1 and MyTouch mobile devices. Together with T-
Mobile, we have created FreshFace, a home-shell customization
application that allows users to customize their background, icons,
and widgets. All of our aHome themes are very popular in Android
market. Check out the latest theme, Yan yan theme by
http://www.cyrket.com/package/com.mappn.ahome.theme.yanyan. You also
can browse the ahome themes in Market via your android phone.

Developing ourselves as the leading android content provider, we are
looking to partner with designers and developers who can create unique
and creative themes, widgets for our aHome product. We will provide
the development guide. So if you are interested and would like more
information on potential opportunities in designing themes for our
platform, please feel free to contact me at bri...@mappn.com. In the
meantime, please visit our website at www.mappn.com  to learn more
about who we are.

Thanks and I look forward to hearing from you.

Regards,
Brian

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



  1   2   >