[android-developers] Re: file system change notification

2009-01-06 Thread pradeep

hi all,

the below program which i got form net. i am able to create the file
a.txt but the onEvent fuction is not being called as the Log.e
(); is not getting logged.

plz help me out.


*start of
the program***
package com.home.files;

import java.io.File;
import java.io.IOException;

import android.app.Activity;
import android.os.Bundle;
import android.os.FileObserver;
import android.util.Log;

public class filesystem extends Activity
{
public static final String TAG="filesystem";
public FileObserver observer;
@Override
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
setContentView(R.layout.main);
observer=new FileObserver("\\sdcard\\tmp"){
@Override
public void onEvent(int event, String path)
{
Log.e(TAG,"onevent");
if(event == FileObserver.CREATE){
Log.e(TAG, "File created [" + path + 
"]");
}
else if(event == FileObserver.DELETE){
Log.e(TAG, "File deleted [" + path + 
"]");
}
}
};
observer.startWatching();
File f=new File("\\sdcard\\tmp\\a.txt");

try {
f.createNewFile();
observer.stopWatching();
Log.e(TAG,"file created");
}
catch (IOException e) { }


}
}

**End of the
program**

On Jan 6, 12:56 pm, "Dianne Hackborn"  wrote:
> Use android.os.FileObserver.
>
> On Mon, Jan 5, 2009 at 5:19 AM, pradeep  wrote:
>
> > how to get notifications if i make any change in file system like i
> > add a file or delete a file.
>
> --
> 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.  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: Sliding text

2009-01-06 Thread Xiongzh

android.widget.Scroller is a better choice to make the text sliding
I've just tried a scrolling TextView. It worked well with only small
defects.
Source codes are in my blog:
http://bear-polka.blogspot.com/2009/01/scrolltextview-scrolling-textview-for.html


On Nov 13 2008, 3:48 am, Mark Murphy  wrote:
> ogawa wrote:
> > So I asked this over in the beginner forum and no one seemed to have
> > an answer for me in jp.
> > Does anyone know how to have a Ticker massege?
>
> > I wanna get effect that is sliding text massage from the right to
> > leftlike a ticker or xmlmarquee.
>
> Use a TranslateAnimation.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
>
> Android Training on the Ranch! -- Mar 16-20, 
> 2009http://www.bignerdranch.com/schedule.shtml
--~--~-~--~~~---~--~~
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: where can I find the source code for G1 phone's contact application

2009-01-06 Thread cindy

In "contact" application, the round number will be focused by scroll
track ball. For me it looks like imageButton, but it doesn't have
rectangle around it. it also response to user's click very fast.

Does any one know how it is implemented?

On Jan 6, 10:54 pm, cindy  wrote:
> G1 phone has a default application called "contact". Where can I find
> the source code for that?
>
> Thanks!
>
> Cindy
--~--~-~--~~~---~--~~
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] where can I find the source code for G1 phone's contact application

2009-01-06 Thread cindy

G1 phone has a default application called "contact". Where can I find
the source code for that?

Thanks!

Cindy
--~--~-~--~~~---~--~~
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: the text font size in pixel != the actual pixels each character occupies?

2009-01-06 Thread Xiongzh

I've shared my ScrollTextView at
http://bear-polka.blogspot.com/2009/01/scrolltextview-scrolling-textview-for.html

Comments are welcomed

On Jan 6, 8:36 pm, Xiongzh  wrote:
> The TextPaint worked well to measure the text length in pixel.
> I've implemented my ScrollTextView successfully.
> Here's my codes to calculate the scrolling length.
> Just for your information.
>
> private void calculateScrollingLen() {
> TextPaint tp = getPaint();
> Rect rect = new Rect();
> String strTxt = getText().toString();
> tp.getTextBounds(strTxt, 0, strTxt.length(), rect);
> mScrollingLen = rect.width() + getWidth();
>rect = null;
> }
>
> Thank you!
> And your website looks sharp!
>
> On 1月6日, 下午3时11分, "心蓝"  wrote:
>
> > U can use TextPaint class ,and the method in this class is measureText, then
> > get one char width!
> > Any question u can post topic inhttp://androidos.cc/bbs,
> > 2009/1/6 Xiongzh 
>
> > > Hi all,
>
> > > I'll like to know how to calculate the actual pixels a text occupies
> > > in the screen from its font size.
>
> > > Say, my font size of the text in TextView is 20.5px.
> > > It doesn't mean that every character of the text occupies 20.5px in
> > > the screen, does it?
>
> > > I'm inheriting android.widget.TextView to implement a TextView which
> > > text can be scrolled automatically. Just as the behavior of the HTML
> > > .
>
> > > I need to know the actual pixels the text occupied to determine how
> > > far I shall scroll the text.
> > > However the getTextSize() * getText().length() is much longer than the
> > > actual length of the text, so I can't make the text re-displayed on
> > > time.
>
> > > Thank you in advance for helping me.
>
> > > BR
> > > xion...@beijing, China
>
> > > dirtybea...@hotmail.com
>
> > --
> > Welcome to my site about GPhone:http://51gphone.cn
> > I am a GFans!!欢迎你来到我的GPhone网站!!http://51gphone.cn
>
>
--~--~-~--~~~---~--~~
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 observer pattern in Andorid/ or other method to improve UI response

2009-01-06 Thread cindy

Hi All,

It is a common question for UI.

 If user needs to send a request to server to get information, it
always have delay time. In regular java code, we can first generate
default UI, display it. Then send request to server in a thread. After
response is back,  update the UI.

If the application is to retrieve emails, how can I implement the
similar functionality in android?
Where can I find sample code?

Thanks!

Cindy
--~--~-~--~~~---~--~~
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: SQLite3 sql command to show tables in a database

2009-01-06 Thread michael m

Perfect!! Thanks Marcus!

On Dec 31 2008, 12:59 am, visionera gmbh 
wrote:
> hi michael,
>
> try this
>
> SELECT name FROM sqlite_master WHERE type = "table"
> bye
> marcus
>
> 
> Von: michael m 
> An: Android Developers 
> Gesendet: Dienstag, den 30. Dezember 2008, 01:01:06 Uhr
> Betreff: [android-developers] SQLite3 sql command to show tables in a database
>
> Does anyone know if there is a SQL command for SQLite3 to show the
> tables in a given database for my Android application or a
> corresponding class that will deliver a list?  I need to find out this
> information programatically and not through adb.  I was assuming to
> find something in SQLiteDatabase, but couldn't find anything that
> delivers the list of tables.
>
> thanks
> - michael
--~--~-~--~~~---~--~~
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: File permissions for world read/write

2009-01-06 Thread michael m

Aren't the methods in the Context class specific to the files within
the application private file store?  I've been trying to find a way to
export data out of the applications space to the sdcard, the solution
above by ggcespia is the only I've found that works.  The methods I
tried in the Context class where openFileOutput which again, saved the
file within the directory data/data/com.myapp/?files?, not exactly
sure about the last directory path, but regardless, it was not to the
sdcard.  Is there another method in the Context class that I'm missing
that will specifically access the SD Card?

On Jan 5, 12:48 am, Jean-Baptiste Queru  wrote:
> Note that you shouldn't hard-code the path to theSDcard. There's an
> API in the Context class (if I remember correctly) that let's you
> query it.
>
> JBQ
>
> On 1/4/09, ggcespia  wrote:
>
>
>
>
>
> > problem solved.  package B had a typo in the file name.  works fine
> > now.
>
> > On Jan 3, 9:02 pm, ggcespia  wrote:
> >> I'm trying to create file at /sdcard/foobar.tmp from one package that
> >> needs to be readable by another package.  This works fine on the
> >> emulator. However, on the G1, if I create the file in package A, then
> >> try to read it in package B, the request fails - even tho both
> >> packages are signed by the same certificate.  I create the file from
> >> Package A with:
>
> >>                 File myFile = new File("/sdcard/foobar.tmp");
> >>                 myFile.createNewFile();
>
> >>                 FileOutputStream fOut =  new FileOutputStream(myFile);
> >>                 String sMofi = "some text";
> >>                 fOut.write(sMofi.getBytes());
> >>                 fOut.flush();
> >>                 fOut.close();
>
> >> To see if the file exists from Package B, I use:
> >>                File myFile = new File("/sdcard/foobar.tmp");
> >>                 if (myFile.isFile())
> >>                 {
> >>                         bTempFile = true;
> >>                 }
>
> >> myFile.isFile() - returns false - I can see the file using ddms with
> >> permissions: rw-rw-
>
> >> Why does isFile fail?  I cannot use Context.openFileOutput() because
> >> that creates a file relative to package A - and B doesn't know where
> >> package A is...
>
> >> Is there a way to create a file at /sdcard/foobar.tmp and have any
> >> package be able to read or write it?
>
> --
> Jean-Baptiste M. "JBQ" Queru
> Android Engineer, Google.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



Re: Fw: [android-developers] Re: Android and bluetooth

2009-01-06 Thread Qwavel

Hi Dianne,

Thanks for your response.  I'd like to address some of your points.

> users should not worry about the apps they install doing unexpected harmful 
> things

I believe that limiting the functionality of the phone/API enough to
achieve complete safety for any application would be very difficult.
If it is even possible, then I think it would result in a neutered
platform.  So why not require digital signatures or user approval for
risky application behaviors instead of removing the functionality in
question?

> the security side is just as critical but a lot more subtle ...
> just saying that platform X does it so it is okay to do it on Android as well 
> is not enough.

I don't deny the importance and subtly of the security issue.  That is
why I thought it was important to note what the rest of the industry
has done.  Companies like Nokia share the concerns of Google about
developing a healthy application ecosystem but they have gone much
further then I am suggesting and made this bluetooth functionality
wide open - I think this observation is very relevant.  There is a
huge amount of empirical data for you to draw upon now: hundreds of
millions of phones, from all brands except RIM and Apple, that allow
applications the functionality in question.

Tom.

On Jan 6, 10:26 pm, "Dianne Hackborn"  wrote:
> I think you are being overly dismissive of the security repercussions.  One
> of our goals with Android is to create an open and thriving third party
> application market.  Two cornerstones of doing this is that it should be
> dead easy for a user to find and install an application, and users should
> not worry about the apps they install doing unexpected harmful things.  The
> former is a fairly clear goal, but the security side is just as critical but
> a lot more subtle -- each little piece you take out of the security picture
> is a growing, long-term detriment to the user's trust.
>
> From the very start, our approach with Android security has been as
> conservative as possible: if there is an application feature that seems
> dangerous, we'll try to either take the time needed to think about and
> address of its repercussions, or wait on making it available.  The same
> approach needs to be taken here, everything thought through before making it
> available.  This sounds like it requires enough thought that it probably
> doesn't make sense to have in a 1.0 API (though Nick would know better than
> I).
>
> At any rate, just saying that platform X does it so it is okay to do it on
> Android as well is not enough.  PalmOS lets apps patch the core OS to insert
> their tendrils into everything it does; should that also be allowed on
> Android?  I wouldn't think so.  That isn't to say a feature shouldn't be
> there, but it should be done with thought and consideration to all of the
> repercussions it has.
>
>
>
> On Sun, Dec 21, 2008 at 10:01 PM, Qwavel  wrote:
>
> > Nick,
>
> > Thanks for participating in this open conversation about the bluetooth
> > API - this is the first time that I'm aware of that outside developers
> > have had the opportunity to express themselves at this stage in the
> > development of a phone OS/API.
>
> > As I'm sure you are aware, Bluetooth data connection between apps are
> > supported by JSR82.  To the best of my knowledge, the only platform on
> > which pairing is required for these connections is the Blackberry.  As
> > far as I can tell, this was done for the pretense of security since
> > the platform was originally only targeted at the enterprise market.
> > On the Blackberry dev forums I regularly see confusion and surprise
> > about this restriction.
>
> > The only other platform (beside the Blackberry) which really limits
> > bluetooth is the iPhone, but this is expected of Apple.
>
> > I am being dismissive about the security advantages of the blackberry
> > approach for these reasons:
>
> > - The majority of phones available now (in Europe but not in the US)
> > allow full access to JSR82, without requiring pairing, and without
> > even requiring that the midlet be signed.
>
> > - More importantly, I've not encountered any regret about this, or any
> > sense that it is a mistake.  Instead, easy access to JSR82 is
> > spreading: now, even LG and Samsung are starting to provide this.
>
> > - Security concerns like this should not be addressed by limiting the
> > functionality of the system, when they can be addressed at the
> > application security level.  I can't comment on the difficulty of
> > implementing this, but certainly it would be better to produce an OS
> > that is not limited in the way that the BB and iPhone are.
>
> > If you really believe that bluetooth communication without pairing is
> > a security hole - and I believe that Nokia and SE have shown that it
> > isn't - then I think it would be better handled by the application
> > level security mechanisms.
>
> > Thanks,
> > Tom.
>
> > On Dec 3, 12:22 pm, Nick Pelly  wrote:
> > > We are likely t

Re: Fw: [android-developers] Re: Android and bluetooth

2009-01-06 Thread Qwavel

Nick,

I'm sorry to hear this, but I understand the need to add some sort of
bluetooth API to Android as quickly as possible.

I look forward to v1.1.

Thanks,
Tom.

On Jan 6, 11:07 pm, Nick Pelly  wrote:
> On Tue, Jan 6, 2009 at 7:10 PM, Qwavel  wrote:
>
> > Is there any update on this?
>
> > Specifically, have decisions been made about whether to limit
> > bluetooth comm to paired devices - as discussed below?
>
> We are unlikely to have this in the first Bluetooth API release. I don't
> think developers would be very excited about us holding up a first release
> while we debate and then implement this.
>
> That doesn't mean we can not add it later. Android moves pretty quick.
>
> > Thanks,
> > Tom.
>
> > On Dec 22 2008, 1:01 am, Qwavel  wrote:
> > > Nick,
>
> > > Thanks for participating in this open conversation about thebluetooth
> > > API - this is the first time that I'm aware of that outside developers
> > > have had the opportunity to express themselves at this stage in the
> > > development of a phone OS/API.
>
> > > As I'm sure you are aware,Bluetoothdata connection between apps are
> > > supported by JSR82.  To the best of my knowledge, the only platform on
> > > which pairing is required for these connections is the Blackberry.  As
> > > far as I can tell, this was done for the pretense of security since
> > > the platform was originally only targeted at the enterprise market.
> > > On the Blackberry dev forums I regularly see confusion and surprise
> > > about this restriction.
>
> > > The only other platform (beside the Blackberry) which really
> > limitsbluetoothis the iPhone, but this is expected of Apple.
>
> > > I am being dismissive about the security advantages of the blackberry
> > > approach for these reasons:
>
> > > - The majority of phones available now (in Europe but not in the US)
> > > allow full access to JSR82, without requiring pairing, and without
> > > even requiring that the midlet be signed.
>
> > > - More importantly, I've not encountered any regret about this, or any
> > > sense that it is a mistake.  Instead, easy access to JSR82 is
> > > spreading: now, even LG and Samsung are starting to provide this.
>
> > > - Security concerns like this should not be addressed by limiting the
> > > functionality of the system, when they can be addressed at the
> > > application security level.  I can't comment on the difficulty of
> > > implementing this, but certainly it would be better to produce an OS
> > > that is not limited in the way that the BB and iPhone are.
>
> > > If you really believe thatbluetoothcommunication without pairing is
> > > a security hole - and I believe that Nokia and SE have shown that it
> > > isn't - then I think it would be better handled by the application
> > > level security mechanisms.
>
> > > Thanks,
> > > Tom.
>
> > > On Dec 3, 12:22 pm, Nick Pelly  wrote:
>
> > > > We are likely to preventBluetoothdata connections (RFCOMM) from apps
> > > > unless the two phones have been paired. It's really hard to make
> > > > security work any other way.
>
> > > > Nick
> > > > Android Systems Engineer
>
> > > > On Wed, Dec 3, 2008 at 1:37 AM, whitemice 
> > wrote:
>
> > > > > Hi Nick
> > > > > While we are on the subject, I am looking for Android *Ad-hoc*
> > > > >Bluetoothsupport.
>
> > > > > Example: Alice and Bob both have my client running on their phones,
> > > > > and walk withinBluetoothrange of each other in a social setting.  I
> > > > > want the application to:
> > > > > (a) Be able to detect the otherBluetoothphone in the room
> > > > > (b) Detect that the same application is running on the other phone
> > > > > (c) Create a data connection between the two phones without asking
> > for
> > > > > the user's permission (permission is granted beforehand).
>
> > > > > Is this considered a security problem, or will this kind of thing be
> > > > > allowed in the new API?
>
> > > > > Some more info on what I am doing….
> > > > >http://blog.zedray.com/snowball/
>
> > > > > Regards
> > > > > Mark
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Fw: [android-developers] Re: Android and bluetooth

2009-01-06 Thread Qwavel



On Jan 6, 10:26 pm, "Dianne Hackborn"  wrote:
> I think you are being overly dismissive of the security repercussions.  One
> of our goals with Android is to create an open and thriving third party
> application market.  Two cornerstones of doing this is that it should be
> dead easy for a user to find and install an application, and users should
> not worry about the apps they install doing unexpected harmful things.  The
> former is a fairly clear goal, but the security side is just as critical but
> a lot more subtle -- each little piece you take out of the security picture
> is a growing, long-term detriment to the user's trust.
>
> From the very start, our approach with Android security has been as
> conservative as possible: if there is an application feature that seems
> dangerous, we'll try to either take the time needed to think about and
> address of its repercussions, or wait on making it available.  The same
> approach needs to be taken here, everything thought through before making it
> available.  This sounds like it requires enough thought that it probably
> doesn't make sense to have in a 1.0 API (though Nick would know better than
> I).
>
> At any rate, just saying that platform X does it so it is okay to do it on
> Android as well is not enough.  PalmOS lets apps patch the core OS to insert
> their tendrils into everything it does; should that also be allowed on
> Android?  I wouldn't think so.  That isn't to say a feature shouldn't be
> there, but it should be done with thought and consideration to all of the
> repercussions it has.
>
>
>
> On Sun, Dec 21, 2008 at 10:01 PM, Qwavel  wrote:
>
> > Nick,
>
> > Thanks for participating in this open conversation about the bluetooth
> > API - this is the first time that I'm aware of that outside developers
> > have had the opportunity to express themselves at this stage in the
> > development of a phone OS/API.
>
> > As I'm sure you are aware, Bluetooth data connection between apps are
> > supported by JSR82.  To the best of my knowledge, the only platform on
> > which pairing is required for these connections is the Blackberry.  As
> > far as I can tell, this was done for the pretense of security since
> > the platform was originally only targeted at the enterprise market.
> > On the Blackberry dev forums I regularly see confusion and surprise
> > about this restriction.
>
> > The only other platform (beside the Blackberry) which really limits
> > bluetooth is the iPhone, but this is expected of Apple.
>
> > I am being dismissive about the security advantages of the blackberry
> > approach for these reasons:
>
> > - The majority of phones available now (in Europe but not in the US)
> > allow full access to JSR82, without requiring pairing, and without
> > even requiring that the midlet be signed.
>
> > - More importantly, I've not encountered any regret about this, or any
> > sense that it is a mistake.  Instead, easy access to JSR82 is
> > spreading: now, even LG and Samsung are starting to provide this.
>
> > - Security concerns like this should not be addressed by limiting the
> > functionality of the system, when they can be addressed at the
> > application security level.  I can't comment on the difficulty of
> > implementing this, but certainly it would be better to produce an OS
> > that is not limited in the way that the BB and iPhone are.
>
> > If you really believe that bluetooth communication without pairing is
> > a security hole - and I believe that Nokia and SE have shown that it
> > isn't - then I think it would be better handled by the application
> > level security mechanisms.
>
> > Thanks,
> > Tom.
>
> > On Dec 3, 12:22 pm, Nick Pelly  wrote:
> > > We are likely to prevent Bluetooth data connections (RFCOMM) from apps
> > > unless the two phones have been paired. It's really hard to make
> > > security work any other way.
>
> > > Nick
> > > Android Systems Engineer
>
> > > On Wed, Dec 3, 2008 at 1:37 AM, whitemice 
> > wrote:
>
> > > > Hi Nick
> > > > While we are on the subject, I am looking for Android *Ad-hoc*
> > > >Bluetoothsupport.
>
> > > > Example: Alice and Bob both have my client running on their phones,
> > > > and walk withinBluetoothrange of each other in a social setting.  I
> > > > want the application to:
> > > > (a) Be able to detect the otherBluetoothphone in the room
> > > > (b) Detect that the same application is running on the other phone
> > > > (c) Create a data connection between the two phones without asking for
> > > > the user's permission (permission is granted beforehand).
>
> > > > Is this considered a security problem, or will this kind of thing be
> > > > allowed in the new API?
>
> > > > Some more info on what I am doing….
> > > >http://blog.zedray.com/snowball/
>
> > > > Regards
> > > > Mark
>
> --
> 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.  All such questions s

Re: Fw: [android-developers] Re: Android and bluetooth

2009-01-06 Thread Nick Pelly
On Tue, Jan 6, 2009 at 7:10 PM, Qwavel  wrote:

>
> Is there any update on this?
>
> Specifically, have decisions been made about whether to limit
> bluetooth comm to paired devices - as discussed below?
>

We are unlikely to have this in the first Bluetooth API release. I don't
think developers would be very excited about us holding up a first release
while we debate and then implement this.

That doesn't mean we can not add it later. Android moves pretty quick.


> Thanks,
> Tom.
>
> On Dec 22 2008, 1:01 am, Qwavel  wrote:
> > Nick,
> >
> > Thanks for participating in this open conversation about thebluetooth
> > API - this is the first time that I'm aware of that outside developers
> > have had the opportunity to express themselves at this stage in the
> > development of a phone OS/API.
> >
> > As I'm sure you are aware,Bluetoothdata connection between apps are
> > supported by JSR82.  To the best of my knowledge, the only platform on
> > which pairing is required for these connections is the Blackberry.  As
> > far as I can tell, this was done for the pretense of security since
> > the platform was originally only targeted at the enterprise market.
> > On the Blackberry dev forums I regularly see confusion and surprise
> > about this restriction.
> >
> > The only other platform (beside the Blackberry) which really
> limitsbluetoothis the iPhone, but this is expected of Apple.
> >
> > I am being dismissive about the security advantages of the blackberry
> > approach for these reasons:
> >
> > - The majority of phones available now (in Europe but not in the US)
> > allow full access to JSR82, without requiring pairing, and without
> > even requiring that the midlet be signed.
> >
> > - More importantly, I've not encountered any regret about this, or any
> > sense that it is a mistake.  Instead, easy access to JSR82 is
> > spreading: now, even LG and Samsung are starting to provide this.
> >
> > - Security concerns like this should not be addressed by limiting the
> > functionality of the system, when they can be addressed at the
> > application security level.  I can't comment on the difficulty of
> > implementing this, but certainly it would be better to produce an OS
> > that is not limited in the way that the BB and iPhone are.
> >
> > If you really believe thatbluetoothcommunication without pairing is
> > a security hole - and I believe that Nokia and SE have shown that it
> > isn't - then I think it would be better handled by the application
> > level security mechanisms.
> >
> > Thanks,
> > Tom.
> >
> > On Dec 3, 12:22 pm, Nick Pelly  wrote:
> >
> > > We are likely to preventBluetoothdata connections (RFCOMM) from apps
> > > unless the two phones have been paired. It's really hard to make
> > > security work any other way.
> >
> > > Nick
> > > Android Systems Engineer
> >
> > > On Wed, Dec 3, 2008 at 1:37 AM, whitemice 
> wrote:
> >
> > > > Hi Nick
> > > > While we are on the subject, I am looking for Android *Ad-hoc*
> > > >Bluetoothsupport.
> >
> > > > Example: Alice and Bob both have my client running on their phones,
> > > > and walk withinBluetoothrange of each other in a social setting.  I
> > > > want the application to:
> > > > (a) Be able to detect the otherBluetoothphone in the room
> > > > (b) Detect that the same application is running on the other phone
> > > > (c) Create a data connection between the two phones without asking
> for
> > > > the user's permission (permission is granted beforehand).
> >
> > > > Is this considered a security problem, or will this kind of thing be
> > > > allowed in the new API?
> >
> > > > Some more info on what I am doing….
> > > >http://blog.zedray.com/snowball/
> >
> > > > Regards
> > > > Mark
> >
>

--~--~-~--~~~---~--~~
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 change view for activities??

2009-01-06 Thread Wesley Sagittarius

hi all,

I wanna to change view... but when I try to setContentView() when
wanna to change to second view... it has this error...

01-07 03:58:58.568: WARN/System.err(309): Caused by:
java.lang.IllegalStateException: The specified child already has a
parent. You must call removeView() on the child's parent first.

I try to search for removeView() at Activity or ActivityGroup class...
I can't find any of this method...


Anyone have any idea on it???


Wesley,
--~--~-~--~~~---~--~~
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: Get Email log

2009-01-06 Thread ena

just like as logs are maintained for incoming and outgoing call ..im
loking for the same  type of logging for email...,
which will maintained a log for each outgoing and received emails...

in any case if u don't know how it is done then plz tel what is the
ContentProvider to get this information??

On Jan 7, 6:59 am, "Andrew Stadler"  wrote:
> Can you please describe what you're looking for, in a bit more detail,
> and perhaps what you're hoping to do with it?
>
> On Sat, Dec 27, 2008 at 1:33 AM, ena  wrote:
>
>  > Hi All,
> > How to get Email log???
> > Please help me out...
> > Thanks 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: How could I know a Service is already started?

2009-01-06 Thread Dianne Hackborn
The LocalServiceBinding API demo should be a good example, you'll just want
to bind without the BIND_AUTO_CREATE flag so the service doesn't get created
as a result of your own binding.

On Tue, Jan 6, 2009 at 7:32 PM, Moto  wrote:

>
> I'm also interested on your solution but could you explain a little
> more? new Binder?
>
> Thanks,
> Moto!
> >
>


-- 
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.  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 could I know a Service is already started?

2009-01-06 Thread Moto

I'm also interested on your solution but could you explain a little
more? new Binder?

Thanks,
Moto!
--~--~-~--~~~---~--~~
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 could I know a Service is already started?

2009-01-06 Thread Dianne Hackborn
The return value just indicates that there is infact a service that can be
started, so true means all is good.  What you care about for knowing whether
the service is actually started are the callbacks to your connections.  (Be
sure your services publishes an IBinder for the Intent you are binding to,
it can just be "new Binder()".)

On Tue, Jan 6, 2009 at 6:09 PM, yukinoba  wrote:

>
> Hi,
>
> I have tried this again with the RemoteServiceBinding example in the
> ApiDemos example packages.
>
> I turned the flag argument to Context.BIND_AUTO_CREATE,
> Context.BIND_DEBUG_UNBIND, or 0, and found out the return value of
> bindService is always true. More than this, when I left the
> RemoteServiceBinding activity, the system shows me an error message
> about the ServiceConnection object which is passed into the
> bindService.
>
> I have no idea to these cases, could you give a hand to clarify what's
> the difference between Context.BIND_AUTO_CREATE,
> Context.BIND_DEBUG_UNBIND, and flag 0? And what kind of behavior will
> the bindService method have?
>
> Best regards,
> Nicholas
>
> On 1月6日, 下午5時42分, "Dianne Hackborn"  wrote:
> > To monitor the state of a service, I suggest binding to it without the
> flag
> > to create it.  Then you will not cause it to start, but be told when it
> is
> > created or destroyed via the appropriate callbacks.
> >
> >
> >
> > On Tue, Jan 6, 2009 at 1:24 AM, yukinoba  wrote:
> >
> > > to dear Dianne,
> >
> > > I need to implement a remote background service and a service
> > > controller activity. I want to present an effect which the controller
> > > activity could know whether or not this service is already started,
> > > and enable / disable the menu button which is used to start / bind /
> > > unbind / stop the service.
> >
> > > However, the controller activity may be paused, or destoryed. I have
> > > tried to write the status in a global variable, and with the activity
> > > destoryed, the variable value lost. I also tried to write into a
> > > SharedPreference, however, this will be persistent even the emulator
> > > shuts down. In the later case, the preference status will mislead the
> > > controller activity when the system is up next time.
> >
> > > So, I need a way to know whether a specified background service is
> > > launched or not even if the controller activity is destroyed and back
> > > then. :-)
> >
> > > Best regards,
> > > Nicholas
> >
> > > On 1月6日, 下午3時40分, "Dianne Hackborn"  wrote:
> > > > I would strongly recommend against that, it can be quite inefficient.
> > >  This
> > > > API is really intended for applications to display a list of running
> > > > services.
> >
> > > > If your service is running in the same process as the code wanting to
> > > check
> > > > its state, you can just set a global variable while it is running.
> >
> > > > Why do you need to do this?
> >
> > > > On Mon, Jan 5, 2009 at 10:34 PM, yukinoba 
> wrote:
> >
> > > > > Hi all,
> >
> > > > > I have already found out how to get this done. Please refer to the
> > > > > following code:
> >
> > > > >/**
> > > > > * Indicates whether the specified service is already started.
> > > > > This
> > > > > * method queries the activity manager for launched services
> that
> > > > > can
> > > > > * respond to an binding with an specific service name.
> > > > > * If no existed service is found, this method returns null.
> > > > > *
> > > > > * @param context The context of the activity
> > > > > * @param className The service full name to check for
> > > > > availability.
> > > > > *
> > > > > * @return ComponentName if the service is already existed, NULL
> > > > > otherwise.
> > > > > */
> > > > >public static ComponentName isServiceExisted(Context context,
> > > > > String className)
> > > > >{
> > > > >ActivityManager activityManager =
> > > > >(ActivityManager)
> > > > > context.getSystemService(ACTIVITY_SERVICE);
> >
> > > > >List serviceList
> > > > >= activityManager.getRunningServices(Integer.MAX_VALUE);
> >
> > > > >if(!(serviceList.size() > 0))
> > > > >{
> > > > >return null;
> > > > >}
> >
> > > > >for(int i = 0; i < serviceList.size(); i++)
> > > > >{
> > > > >RunningServiceInfo serviceInfo = serviceList.get(i);
> > > > >ComponentName serviceName = serviceInfo.service;
> >
> > > > >if(serviceName.getClassName().equals(className))
> > > > >{
> > > > >return serviceName;
> > > > >}
> > > > >}
> >
> > > > >return null;
> > > > >}
> >
> > > > > Best regards,
> > > > > Nicholas
> >
> > > > > On 1月6日, 上午10時58分, yukinoba  wrote:
> > > > > > Ummm... does anyone know? have any ideas?
> >
> > > > > > On 1月5日, 下午12時05分, yukinoba  wrote:
> >
> > > > > > > To dear all Android developers,
> >
> > > > > > > Is there a way to ch

Re: Fw: [android-developers] Re: Android and bluetooth

2009-01-06 Thread Dianne Hackborn
I think you are being overly dismissive of the security repercussions.  One
of our goals with Android is to create an open and thriving third party
application market.  Two cornerstones of doing this is that it should be
dead easy for a user to find and install an application, and users should
not worry about the apps they install doing unexpected harmful things.  The
former is a fairly clear goal, but the security side is just as critical but
a lot more subtle -- each little piece you take out of the security picture
is a growing, long-term detriment to the user's trust.

>From the very start, our approach with Android security has been as
conservative as possible: if there is an application feature that seems
dangerous, we'll try to either take the time needed to think about and
address of its repercussions, or wait on making it available.  The same
approach needs to be taken here, everything thought through before making it
available.  This sounds like it requires enough thought that it probably
doesn't make sense to have in a 1.0 API (though Nick would know better than
I).

At any rate, just saying that platform X does it so it is okay to do it on
Android as well is not enough.  PalmOS lets apps patch the core OS to insert
their tendrils into everything it does; should that also be allowed on
Android?  I wouldn't think so.  That isn't to say a feature shouldn't be
there, but it should be done with thought and consideration to all of the
repercussions it has.

On Sun, Dec 21, 2008 at 10:01 PM, Qwavel  wrote:

>
> Nick,
>
> Thanks for participating in this open conversation about the bluetooth
> API - this is the first time that I'm aware of that outside developers
> have had the opportunity to express themselves at this stage in the
> development of a phone OS/API.
>
> As I'm sure you are aware, Bluetooth data connection between apps are
> supported by JSR82.  To the best of my knowledge, the only platform on
> which pairing is required for these connections is the Blackberry.  As
> far as I can tell, this was done for the pretense of security since
> the platform was originally only targeted at the enterprise market.
> On the Blackberry dev forums I regularly see confusion and surprise
> about this restriction.
>
> The only other platform (beside the Blackberry) which really limits
> bluetooth is the iPhone, but this is expected of Apple.
>
> I am being dismissive about the security advantages of the blackberry
> approach for these reasons:
>
> - The majority of phones available now (in Europe but not in the US)
> allow full access to JSR82, without requiring pairing, and without
> even requiring that the midlet be signed.
>
> - More importantly, I've not encountered any regret about this, or any
> sense that it is a mistake.  Instead, easy access to JSR82 is
> spreading: now, even LG and Samsung are starting to provide this.
>
> - Security concerns like this should not be addressed by limiting the
> functionality of the system, when they can be addressed at the
> application security level.  I can't comment on the difficulty of
> implementing this, but certainly it would be better to produce an OS
> that is not limited in the way that the BB and iPhone are.
>
> If you really believe that bluetooth communication without pairing is
> a security hole - and I believe that Nokia and SE have shown that it
> isn't - then I think it would be better handled by the application
> level security mechanisms.
>
> Thanks,
> Tom.
>
> On Dec 3, 12:22 pm, Nick Pelly  wrote:
> > We are likely to prevent Bluetooth data connections (RFCOMM) from apps
> > unless the two phones have been paired. It's really hard to make
> > security work any other way.
> >
> > Nick
> > Android Systems Engineer
> >
> > On Wed, Dec 3, 2008 at 1:37 AM, whitemice 
> wrote:
> >
> > > Hi Nick
> > > While we are on the subject, I am looking for Android *Ad-hoc*
> > >Bluetoothsupport.
> >
> > > Example: Alice and Bob both have my client running on their phones,
> > > and walk withinBluetoothrange of each other in a social setting.  I
> > > want the application to:
> > > (a) Be able to detect the otherBluetoothphone in the room
> > > (b) Detect that the same application is running on the other phone
> > > (c) Create a data connection between the two phones without asking for
> > > the user's permission (permission is granted beforehand).
> >
> > > Is this considered a security problem, or will this kind of thing be
> > > allowed in the new API?
> >
> > > Some more info on what I am doing….
> > >http://blog.zedray.com/snowball/
> >
> > > Regards
> > > Mark
> >
>


-- 
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.  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

Re: Fw: [android-developers] Re: Android and bluetooth

2009-01-06 Thread Qwavel

Is there any update on this?

Specifically, have decisions been made about whether to limit
bluetooth comm to paired devices - as discussed below?

Thanks,
Tom.

On Dec 22 2008, 1:01 am, Qwavel  wrote:
> Nick,
>
> Thanks for participating in this open conversation about thebluetooth
> API - this is the first time that I'm aware of that outside developers
> have had the opportunity to express themselves at this stage in the
> development of a phone OS/API.
>
> As I'm sure you are aware,Bluetoothdata connection between apps are
> supported by JSR82.  To the best of my knowledge, the only platform on
> which pairing is required for these connections is the Blackberry.  As
> far as I can tell, this was done for the pretense of security since
> the platform was originally only targeted at the enterprise market.
> On the Blackberry dev forums I regularly see confusion and surprise
> about this restriction.
>
> The only other platform (beside the Blackberry) which really 
> limitsbluetoothis the iPhone, but this is expected of Apple.
>
> I am being dismissive about the security advantages of the blackberry
> approach for these reasons:
>
> - The majority of phones available now (in Europe but not in the US)
> allow full access to JSR82, without requiring pairing, and without
> even requiring that the midlet be signed.
>
> - More importantly, I've not encountered any regret about this, or any
> sense that it is a mistake.  Instead, easy access to JSR82 is
> spreading: now, even LG and Samsung are starting to provide this.
>
> - Security concerns like this should not be addressed by limiting the
> functionality of the system, when they can be addressed at the
> application security level.  I can't comment on the difficulty of
> implementing this, but certainly it would be better to produce an OS
> that is not limited in the way that the BB and iPhone are.
>
> If you really believe thatbluetoothcommunication without pairing is
> a security hole - and I believe that Nokia and SE have shown that it
> isn't - then I think it would be better handled by the application
> level security mechanisms.
>
> Thanks,
> Tom.
>
> On Dec 3, 12:22 pm, Nick Pelly  wrote:
>
> > We are likely to preventBluetoothdata connections (RFCOMM) from apps
> > unless the two phones have been paired. It's really hard to make
> > security work any other way.
>
> > Nick
> > Android Systems Engineer
>
> > On Wed, Dec 3, 2008 at 1:37 AM, whitemice  wrote:
>
> > > Hi Nick
> > > While we are on the subject, I am looking for Android *Ad-hoc*
> > >Bluetoothsupport.
>
> > > Example: Alice and Bob both have my client running on their phones,
> > > and walk withinBluetoothrange of each other in a social setting.  I
> > > want the application to:
> > > (a) Be able to detect the otherBluetoothphone in the room
> > > (b) Detect that the same application is running on the other phone
> > > (c) Create a data connection between the two phones without asking for
> > > the user's permission (permission is granted beforehand).
>
> > > Is this considered a security problem, or will this kind of thing be
> > > allowed in the new API?
>
> > > Some more info on what I am doing….
> > >http://blog.zedray.com/snowball/
>
> > > Regards
> > > Mark
--~--~-~--~~~---~--~~
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: Avoiding onItemSelected calls during initialization

2009-01-06 Thread daekpony

I understand that the onItemSelected callback is run on the first
layout, but it doesn't quite make sense to me why.  I'd like the
spinner to act as a simple drop down selection list that allows the
user to select a single item.  The only selection completed hook I
found is the onItemSelected callback.  However, if that gets called on
the spinner's layout, then I would have to differentiate in my
callback handler between onItemSelected calls due to layouts and
onItemSelected calls due to user actions.  And I can't see of any way
to actually differentiate between the two.  Probably I'm just unclear
on the usage pattern.  But how would I go about implementing a simple
drop down selector (just like an HTML one) that will record the option
that the user selects?

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: How to create a bitmap with desired text?

2009-01-06 Thread Ernest

Thanks for your reply.I tried the new method arg0.drawBitmap(bitmap,
this.getBounds().left, this.getBounds().top, textPaint);  but it not
works well ,my code is

  public class BitmapText extends BitmapDrawable {
private String name;
private Bitmap bitmap;

public  BitmapText(Context ctx,String strName,int bitmapId) {

// TODO Auto-generated constructor stub
super(BitmapFactory.decodeResource(ctx.getResources(), 
bitmapId));
bitmap =BitmapFactory.decodeResource(ctx.getResources(), 
bitmapId);
name = strName;
this.setBounds(0, 0, bitmap.getWidth(), bitmap.getHeight());
}

@Override
public void draw(Canvas arg0) {
// TODO Auto-generated method stub
Paint textPaint = new Paint();
arg0.drawBitmap(bitmap, this.getBounds().left, 
this.getBounds().top,
textPaint);
textPaint.setTextSize(12);
textPaint.setTypeface(Typeface.DEFAULT);
textPaint.setAntiAlias(true);
textPaint.setStyle(Style.FILL);
arg0.drawText(name,10,10, textPaint);


}
}

call this class like  BitmapText st = new BitmapText (view.getContext
(),"hello",R.drawable.android);  Bitmap newBitmap = st.getBitmap();
The words "hello" is not painted in the new bitmap.Are there any
mistakes?Thank you very much.

Best 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: when user click back, which function is called

2009-01-06 Thread Andrew Stadler

Cindy (or April)-

> Will finish() be called every time?

As I wrote before, unless you override the key handlers, pressing the
back button *will* call finish().

> so current activity will be
> totally destroyed (onDestroy() will be called)?

Please refer to the documentation I sent you the link to.  Most, if
not all of your questions are answered in it.  For example, in the
Activity Lifecycle section, it says that onDestroy() is called
"because the activity is finishing (someone called finish() on it)."

--Andy

--~--~-~--~~~---~--~~
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 could I know a Service is already started?

2009-01-06 Thread yukinoba

Hi,

I have tried this again with the RemoteServiceBinding example in the
ApiDemos example packages.

I turned the flag argument to Context.BIND_AUTO_CREATE,
Context.BIND_DEBUG_UNBIND, or 0, and found out the return value of
bindService is always true. More than this, when I left the
RemoteServiceBinding activity, the system shows me an error message
about the ServiceConnection object which is passed into the
bindService.

I have no idea to these cases, could you give a hand to clarify what's
the difference between Context.BIND_AUTO_CREATE,
Context.BIND_DEBUG_UNBIND, and flag 0? And what kind of behavior will
the bindService method have?

Best regards,
Nicholas

On 1月6日, 下午5時42分, "Dianne Hackborn"  wrote:
> To monitor the state of a service, I suggest binding to it without the flag
> to create it.  Then you will not cause it to start, but be told when it is
> created or destroyed via the appropriate callbacks.
>
>
>
> On Tue, Jan 6, 2009 at 1:24 AM, yukinoba  wrote:
>
> > to dear Dianne,
>
> > I need to implement a remote background service and a service
> > controller activity. I want to present an effect which the controller
> > activity could know whether or not this service is already started,
> > and enable / disable the menu button which is used to start / bind /
> > unbind / stop the service.
>
> > However, the controller activity may be paused, or destoryed. I have
> > tried to write the status in a global variable, and with the activity
> > destoryed, the variable value lost. I also tried to write into a
> > SharedPreference, however, this will be persistent even the emulator
> > shuts down. In the later case, the preference status will mislead the
> > controller activity when the system is up next time.
>
> > So, I need a way to know whether a specified background service is
> > launched or not even if the controller activity is destroyed and back
> > then. :-)
>
> > Best regards,
> > Nicholas
>
> > On 1月6日, 下午3時40分, "Dianne Hackborn"  wrote:
> > > I would strongly recommend against that, it can be quite inefficient.
> >  This
> > > API is really intended for applications to display a list of running
> > > services.
>
> > > If your service is running in the same process as the code wanting to
> > check
> > > its state, you can just set a global variable while it is running.
>
> > > Why do you need to do this?
>
> > > On Mon, Jan 5, 2009 at 10:34 PM, yukinoba  wrote:
>
> > > > Hi all,
>
> > > > I have already found out how to get this done. Please refer to the
> > > > following code:
>
> > > >/**
> > > > * Indicates whether the specified service is already started.
> > > > This
> > > > * method queries the activity manager for launched services that
> > > > can
> > > > * respond to an binding with an specific service name.
> > > > * If no existed service is found, this method returns null.
> > > > *
> > > > * @param context The context of the activity
> > > > * @param className The service full name to check for
> > > > availability.
> > > > *
> > > > * @return ComponentName if the service is already existed, NULL
> > > > otherwise.
> > > > */
> > > >public static ComponentName isServiceExisted(Context context,
> > > > String className)
> > > >{
> > > >ActivityManager activityManager =
> > > >(ActivityManager)
> > > > context.getSystemService(ACTIVITY_SERVICE);
>
> > > >List serviceList
> > > >= activityManager.getRunningServices(Integer.MAX_VALUE);
>
> > > >if(!(serviceList.size() > 0))
> > > >{
> > > >return null;
> > > >}
>
> > > >for(int i = 0; i < serviceList.size(); i++)
> > > >{
> > > >RunningServiceInfo serviceInfo = serviceList.get(i);
> > > >ComponentName serviceName = serviceInfo.service;
>
> > > >if(serviceName.getClassName().equals(className))
> > > >{
> > > >return serviceName;
> > > >}
> > > >}
>
> > > >return null;
> > > >}
>
> > > > Best regards,
> > > > Nicholas
>
> > > > On 1月6日, 上午10時58分, yukinoba  wrote:
> > > > > Ummm... does anyone know? have any ideas?
>
> > > > > On 1月5日, 下午12時05分, yukinoba  wrote:
>
> > > > > > To dear all Android developers,
>
> > > > > > Is there a way to check whether a service is already started or
> > not?
> > > > > > This issue has been discussed ealier (and much earlier) in April,
> > in
> > > > > > the last year, on this forum.
>
> >http://groups.google.com/group/android-developers/browse_thread/threa.
> > > > ..
>
> > > > > > However, I wonder that does there have a new solution to this issue
> > > > > > rather than using a SharedPreferences to store the service status.
> > Is
> > > > > > this functionality to check service is started or not has been
> > added
> > > > > > to SDK1.0_r2 or Cupcake branch?
>
> > > > > > Thanks for any help or solutions! :-)
>
> > > > > > Best regar

[android-developers] Re: Get Email log

2009-01-06 Thread Andrew Stadler

Can you please describe what you're looking for, in a bit more detail,
and perhaps what you're hoping to do with it?


On Sat, Dec 27, 2008 at 1:33 AM, ena  wrote:
>
>
> Hi All,
> How to get Email log???
> Please help me out...
> Thanks 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: Repeating AnimationSet

2009-01-06 Thread Romain Guy

It's much better to use View.post(Runnable) instead of creating a new
Handler here :)

On Tue, Jan 6, 2009 at 5:07 PM, Emmanuel  wrote:
>
> That's exactly what I've been doing after my post here, and it works
> OK :
>
> class LocalAnimationListener implements AnimationListener
>{
>public void onAnimationEnd(Animation animation)
>{
>Handler curHandler = new Handler();
>curHandler.postDelayed( mLaunchSecondAnimation, 1);
>//LaunchOutAnimation(  );
>}
>public void onAnimationRepeat(Animation animation)
>{
>}
>public void onAnimationStart(Animation animation)
>{
>}
>};
> private Runnable mLaunchSecondAnimation = new Runnable()
>{
>public void run()
>{
>LaunchOutAnimation(  );
>}
>};
>
> Thanks for the (good) proposition anyway !!
>
> Emmanuel
> http://androidblogger.blogspot.com/
>
> Ps: Now I have to consult the doc, because I don't know View.post and
> Activity.runOnUiThread()
> :)
>
>
> On Jan 7, 2:00 am, Romain Guy  wrote:
>> You should try to post it (see View.post() or Handler.post() or
>> Activity.runOnUiThread().)
>>
>>
>>
>> On Tue, Jan 6, 2009 at 4:57 PM, Emmanuel  wrote:
>>
>> > It's strange.
>> > That exactly what I'm doing, starting a second animation on the
>> > onAnimationEnd of the first animation listener, but it just don't do
>> > anything.
>> > the second animation is not played.
>>
>> > Just to be sure, I call the function that creates the first animation
>> > on the onAnimationEnd ( to create a dirty 'repeat' pattern ), but it
>> > just don't do anything.
>> > Is it possible that something like a clear animation would be called
>> > AFTER the animationEnd callback, and remove the new animation ?
>>
>> > Emmanuel
>> >http://androidblogger.blogspot.com/
>>
>> > On Jan 6, 11:44 pm, Romain Guy  wrote:
>> >> You can achieve it by using two Animations. Start the first one and
>> >> when it ends (using an animation listener to be notified), start the
>> >> second one. It's not as nice and easy but it should work.
>>
>> >> On Tue, Jan 6, 2009 at 2:43 PM, Sundog  wrote:
>>
>> >> > Ahh, thank you. I knew "the answer was out there".
>>
>> >> > So much for my cool animation...
>>
>> >> > On Jan 6, 3:20 pm, Romain Guy  wrote:
>> >> >> It is a known issue.
>>
>> >> >> On Tue, Jan 6, 2009 at 2:17 PM, Sundog  wrote:
>>
>> >> >> > That category is getting a little crowded for my tastes.
>>
>> >> >> > On Jan 6, 3:15 pm, loty  wrote:
>> >> >> >> I've seen this one too and gave up.
>> >> >> >> I guess we'll have to file into "Nobody knows nobody cares" category
>>
>> >> >> >> On Jan 6, 4:06 pm, Sundog  wrote:
>>
>> >> >> >> > We'll settle for a "No, you dummies, you're doing it wrong!"
>>
>> >> >> >> > On Jan 6, 8:19 am, Sundog  wrote:
>>
>> >> >> >> > > I posted about exactly this a couple of days ago with no 
>> >> >> >> > > responses.
>> >> >> >> > > Now with your report I'm beginning to think it's a real bug.
>>
>> >> >> >> > > Anyone at Google care to toss in an opinion?
>>
>> >> >> >> > > On Jan 6, 7:25 am, rsung  wrote:
>>
>> >> >> >> > > > Anyone??? Is this a known bug?
>>
>> >> >> >> > > > On Dec 21 2008, 11:00 pm, PKC  wrote:
>>
>> >> >> >> > > > > I'm trying to make a simple set of animationsrepeat.  Based 
>> >> >> >> > > > > on
>> >> >> >> > > > > documentation, it appears that below should work but the 
>> >> >> >> > > > > animation
>> >> >> >> > > > > runs once and does notrepeat.  Any pointers would be 
>> >> >> >> > > > > appreciated.
>>
>> >> >> >> > > > > Thanks
>>
>> >> >> >> > > > > public void onCreate(Bundle savedInstanceState) {
>> >> >> >> > > > > super.onCreate(savedInstanceState);
>> >> >> >> > > > > setContentView(R.layout.main);
>>
>> >> >> >> > > > > TextView animWindow = 
>> >> >> >> > > > > (TextView)findViewById(R.id.anim_text);
>>
>> >> >> >> > > > >AnimationSetrootSet = newAnimationSet(true);
>> >> >> >> > > > > rootSet.setInterpolator(new 
>> >> >> >> > > > > AccelerateInterpolator());
>>
>> >> >> >> > > > > // Create and add first child, a motion animation.
>> >> >> >> > > > > TranslateAnimation trans1 = new 
>> >> >> >> > > > > TranslateAnimation(0, 30, 0,
>> >> >> >> > > > > 0);
>> >> >> >> > > > > trans1.setStartOffset(0);
>> >> >> >> > > > > trans1.setDuration(800);
>> >> >> >> > > > > trans1.setFillAfter(true);
>> >> >> >> > > > > rootSet.addAnimation(trans1);
>>
>> >> >> >> > > > > // Add a final motion animation to the root set.
>> >> >> >> > > > > TranslateAnimation trans2 = new 
>> >> >> >> > > > > TranslateAnimation(0, 0, 0,
>> >> >> >> > > > > 100);
>> >> >> >> > > > > trans2.setFillAfter(true);
>> >> >> >> > > > > trans2.set

[android-developers] Re: Repeating AnimationSet

2009-01-06 Thread Emmanuel

That's exactly what I've been doing after my post here, and it works
OK :

class LocalAnimationListener implements AnimationListener
{
public void onAnimationEnd(Animation animation)
{
Handler curHandler = new Handler();
curHandler.postDelayed( mLaunchSecondAnimation, 1);
//LaunchOutAnimation(  );
}
public void onAnimationRepeat(Animation animation)
{
}
public void onAnimationStart(Animation animation)
{
}
};
private Runnable mLaunchSecondAnimation = new Runnable()
{
public void run()
{
LaunchOutAnimation(  );
}
};

Thanks for the (good) proposition anyway !!

Emmanuel
http://androidblogger.blogspot.com/

Ps: Now I have to consult the doc, because I don't know View.post and
Activity.runOnUiThread()
:)


On Jan 7, 2:00 am, Romain Guy  wrote:
> You should try to post it (see View.post() or Handler.post() or
> Activity.runOnUiThread().)
>
>
>
> On Tue, Jan 6, 2009 at 4:57 PM, Emmanuel  wrote:
>
> > It's strange.
> > That exactly what I'm doing, starting a second animation on the
> > onAnimationEnd of the first animation listener, but it just don't do
> > anything.
> > the second animation is not played.
>
> > Just to be sure, I call the function that creates the first animation
> > on the onAnimationEnd ( to create a dirty 'repeat' pattern ), but it
> > just don't do anything.
> > Is it possible that something like a clear animation would be called
> > AFTER the animationEnd callback, and remove the new animation ?
>
> > Emmanuel
> >http://androidblogger.blogspot.com/
>
> > On Jan 6, 11:44 pm, Romain Guy  wrote:
> >> You can achieve it by using two Animations. Start the first one and
> >> when it ends (using an animation listener to be notified), start the
> >> second one. It's not as nice and easy but it should work.
>
> >> On Tue, Jan 6, 2009 at 2:43 PM, Sundog  wrote:
>
> >> > Ahh, thank you. I knew "the answer was out there".
>
> >> > So much for my cool animation...
>
> >> > On Jan 6, 3:20 pm, Romain Guy  wrote:
> >> >> It is a known issue.
>
> >> >> On Tue, Jan 6, 2009 at 2:17 PM, Sundog  wrote:
>
> >> >> > That category is getting a little crowded for my tastes.
>
> >> >> > On Jan 6, 3:15 pm, loty  wrote:
> >> >> >> I've seen this one too and gave up.
> >> >> >> I guess we'll have to file into "Nobody knows nobody cares" category
>
> >> >> >> On Jan 6, 4:06 pm, Sundog  wrote:
>
> >> >> >> > We'll settle for a "No, you dummies, you're doing it wrong!"
>
> >> >> >> > On Jan 6, 8:19 am, Sundog  wrote:
>
> >> >> >> > > I posted about exactly this a couple of days ago with no 
> >> >> >> > > responses.
> >> >> >> > > Now with your report I'm beginning to think it's a real bug.
>
> >> >> >> > > Anyone at Google care to toss in an opinion?
>
> >> >> >> > > On Jan 6, 7:25 am, rsung  wrote:
>
> >> >> >> > > > Anyone??? Is this a known bug?
>
> >> >> >> > > > On Dec 21 2008, 11:00 pm, PKC  wrote:
>
> >> >> >> > > > > I'm trying to make a simple set of animationsrepeat.  Based 
> >> >> >> > > > > on
> >> >> >> > > > > documentation, it appears that below should work but the 
> >> >> >> > > > > animation
> >> >> >> > > > > runs once and does notrepeat.  Any pointers would be 
> >> >> >> > > > > appreciated.
>
> >> >> >> > > > > Thanks
>
> >> >> >> > > > >     public void onCreate(Bundle savedInstanceState) {
> >> >> >> > > > >         super.onCreate(savedInstanceState);
> >> >> >> > > > >         setContentView(R.layout.main);
>
> >> >> >> > > > >         TextView animWindow = 
> >> >> >> > > > > (TextView)findViewById(R.id.anim_text);
>
> >> >> >> > > > >        AnimationSetrootSet = newAnimationSet(true);
> >> >> >> > > > >         rootSet.setInterpolator(new 
> >> >> >> > > > > AccelerateInterpolator());
>
> >> >> >> > > > >         // Create and add first child, a motion animation.
> >> >> >> > > > >         TranslateAnimation trans1 = new 
> >> >> >> > > > > TranslateAnimation(0, 30, 0,
> >> >> >> > > > > 0);
> >> >> >> > > > >         trans1.setStartOffset(0);
> >> >> >> > > > >         trans1.setDuration(800);
> >> >> >> > > > >         trans1.setFillAfter(true);
> >> >> >> > > > >         rootSet.addAnimation(trans1);
>
> >> >> >> > > > >         // Add a final motion animation to the root set.
> >> >> >> > > > >         TranslateAnimation trans2 = new 
> >> >> >> > > > > TranslateAnimation(0, 0, 0,
> >> >> >> > > > > 100);
> >> >> >> > > > >         trans2.setFillAfter(true);
> >> >> >> > > > >         trans2.setDuration(800);
> >> >> >> > > > >         trans2.setStartOffset(800);
> >> >> >> > > > >         rootSet.addAnimation(trans2);
>
> >> >> >> > > > >         rootSet.setRepeatCount(Animation.INFINITE);
> >> >> >> > > > >         rootSet.setRepeatMode(Animation.RESTART);
>
> >> >> >> >

[android-developers] Re: Repeating AnimationSet

2009-01-06 Thread Romain Guy

You should try to post it (see View.post() or Handler.post() or
Activity.runOnUiThread().)

On Tue, Jan 6, 2009 at 4:57 PM, Emmanuel  wrote:
>
> It's strange.
> That exactly what I'm doing, starting a second animation on the
> onAnimationEnd of the first animation listener, but it just don't do
> anything.
> the second animation is not played.
>
> Just to be sure, I call the function that creates the first animation
> on the onAnimationEnd ( to create a dirty 'repeat' pattern ), but it
> just don't do anything.
> Is it possible that something like a clear animation would be called
> AFTER the animationEnd callback, and remove the new animation ?
>
> Emmanuel
> http://androidblogger.blogspot.com/
>
> On Jan 6, 11:44 pm, Romain Guy  wrote:
>> You can achieve it by using two Animations. Start the first one and
>> when it ends (using an animation listener to be notified), start the
>> second one. It's not as nice and easy but it should work.
>>
>>
>>
>> On Tue, Jan 6, 2009 at 2:43 PM, Sundog  wrote:
>>
>> > Ahh, thank you. I knew "the answer was out there".
>>
>> > So much for my cool animation...
>>
>> > On Jan 6, 3:20 pm, Romain Guy  wrote:
>> >> It is a known issue.
>>
>> >> On Tue, Jan 6, 2009 at 2:17 PM, Sundog  wrote:
>>
>> >> > That category is getting a little crowded for my tastes.
>>
>> >> > On Jan 6, 3:15 pm, loty  wrote:
>> >> >> I've seen this one too and gave up.
>> >> >> I guess we'll have to file into "Nobody knows nobody cares" category
>>
>> >> >> On Jan 6, 4:06 pm, Sundog  wrote:
>>
>> >> >> > We'll settle for a "No, you dummies, you're doing it wrong!"
>>
>> >> >> > On Jan 6, 8:19 am, Sundog  wrote:
>>
>> >> >> > > I posted about exactly this a couple of days ago with no responses.
>> >> >> > > Now with your report I'm beginning to think it's a real bug.
>>
>> >> >> > > Anyone at Google care to toss in an opinion?
>>
>> >> >> > > On Jan 6, 7:25 am, rsung  wrote:
>>
>> >> >> > > > Anyone??? Is this a known bug?
>>
>> >> >> > > > On Dec 21 2008, 11:00 pm, PKC  wrote:
>>
>> >> >> > > > > I'm trying to make a simple set of animationsrepeat.  Based on
>> >> >> > > > > documentation, it appears that below should work but the 
>> >> >> > > > > animation
>> >> >> > > > > runs once and does notrepeat.  Any pointers would be 
>> >> >> > > > > appreciated.
>>
>> >> >> > > > > Thanks
>>
>> >> >> > > > > public void onCreate(Bundle savedInstanceState) {
>> >> >> > > > > super.onCreate(savedInstanceState);
>> >> >> > > > > setContentView(R.layout.main);
>>
>> >> >> > > > > TextView animWindow = 
>> >> >> > > > > (TextView)findViewById(R.id.anim_text);
>>
>> >> >> > > > >AnimationSetrootSet = newAnimationSet(true);
>> >> >> > > > > rootSet.setInterpolator(new AccelerateInterpolator());
>>
>> >> >> > > > > // Create and add first child, a motion animation.
>> >> >> > > > > TranslateAnimation trans1 = new TranslateAnimation(0, 
>> >> >> > > > > 30, 0,
>> >> >> > > > > 0);
>> >> >> > > > > trans1.setStartOffset(0);
>> >> >> > > > > trans1.setDuration(800);
>> >> >> > > > > trans1.setFillAfter(true);
>> >> >> > > > > rootSet.addAnimation(trans1);
>>
>> >> >> > > > > // Add a final motion animation to the root set.
>> >> >> > > > > TranslateAnimation trans2 = new TranslateAnimation(0, 
>> >> >> > > > > 0, 0,
>> >> >> > > > > 100);
>> >> >> > > > > trans2.setFillAfter(true);
>> >> >> > > > > trans2.setDuration(800);
>> >> >> > > > > trans2.setStartOffset(800);
>> >> >> > > > > rootSet.addAnimation(trans2);
>>
>> >> >> > > > > rootSet.setRepeatCount(Animation.INFINITE);
>> >> >> > > > > rootSet.setRepeatMode(Animation.RESTART);
>>
>> >> >> > > > > // Start the animation.
>> >> >> > > > > animWindow.startAnimation(rootSet);
>> >> >> > > > > }- Hide quoted text -
>>
>> >> >> > > > - Show quoted text -- Hide quoted text -
>>
>> >> >> > > - Show quoted text -- Hide quoted text -
>>
>> >> >> - Show quoted text -
>>
>> >> --
>> >> 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- Hide quoted 
>> >> text -
>>
>> >> - Show quoted text -
>>
>> --
>> 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
> >
>



-- 
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

--~--~-~--~~

[android-developers] Re: Repeating AnimationSet

2009-01-06 Thread Emmanuel

It's strange.
That exactly what I'm doing, starting a second animation on the
onAnimationEnd of the first animation listener, but it just don't do
anything.
the second animation is not played.

Just to be sure, I call the function that creates the first animation
on the onAnimationEnd ( to create a dirty 'repeat' pattern ), but it
just don't do anything.
Is it possible that something like a clear animation would be called
AFTER the animationEnd callback, and remove the new animation ?

Emmanuel
http://androidblogger.blogspot.com/

On Jan 6, 11:44 pm, Romain Guy  wrote:
> You can achieve it by using two Animations. Start the first one and
> when it ends (using an animation listener to be notified), start the
> second one. It's not as nice and easy but it should work.
>
>
>
> On Tue, Jan 6, 2009 at 2:43 PM, Sundog  wrote:
>
> > Ahh, thank you. I knew "the answer was out there".
>
> > So much for my cool animation...
>
> > On Jan 6, 3:20 pm, Romain Guy  wrote:
> >> It is a known issue.
>
> >> On Tue, Jan 6, 2009 at 2:17 PM, Sundog  wrote:
>
> >> > That category is getting a little crowded for my tastes.
>
> >> > On Jan 6, 3:15 pm, loty  wrote:
> >> >> I've seen this one too and gave up.
> >> >> I guess we'll have to file into "Nobody knows nobody cares" category
>
> >> >> On Jan 6, 4:06 pm, Sundog  wrote:
>
> >> >> > We'll settle for a "No, you dummies, you're doing it wrong!"
>
> >> >> > On Jan 6, 8:19 am, Sundog  wrote:
>
> >> >> > > I posted about exactly this a couple of days ago with no responses.
> >> >> > > Now with your report I'm beginning to think it's a real bug.
>
> >> >> > > Anyone at Google care to toss in an opinion?
>
> >> >> > > On Jan 6, 7:25 am, rsung  wrote:
>
> >> >> > > > Anyone??? Is this a known bug?
>
> >> >> > > > On Dec 21 2008, 11:00 pm, PKC  wrote:
>
> >> >> > > > > I'm trying to make a simple set of animationsrepeat.  Based on
> >> >> > > > > documentation, it appears that below should work but the 
> >> >> > > > > animation
> >> >> > > > > runs once and does notrepeat.  Any pointers would be 
> >> >> > > > > appreciated.
>
> >> >> > > > > Thanks
>
> >> >> > > > >     public void onCreate(Bundle savedInstanceState) {
> >> >> > > > >         super.onCreate(savedInstanceState);
> >> >> > > > >         setContentView(R.layout.main);
>
> >> >> > > > >         TextView animWindow = 
> >> >> > > > > (TextView)findViewById(R.id.anim_text);
>
> >> >> > > > >        AnimationSetrootSet = newAnimationSet(true);
> >> >> > > > >         rootSet.setInterpolator(new AccelerateInterpolator());
>
> >> >> > > > >         // Create and add first child, a motion animation.
> >> >> > > > >         TranslateAnimation trans1 = new TranslateAnimation(0, 
> >> >> > > > > 30, 0,
> >> >> > > > > 0);
> >> >> > > > >         trans1.setStartOffset(0);
> >> >> > > > >         trans1.setDuration(800);
> >> >> > > > >         trans1.setFillAfter(true);
> >> >> > > > >         rootSet.addAnimation(trans1);
>
> >> >> > > > >         // Add a final motion animation to the root set.
> >> >> > > > >         TranslateAnimation trans2 = new TranslateAnimation(0, 
> >> >> > > > > 0, 0,
> >> >> > > > > 100);
> >> >> > > > >         trans2.setFillAfter(true);
> >> >> > > > >         trans2.setDuration(800);
> >> >> > > > >         trans2.setStartOffset(800);
> >> >> > > > >         rootSet.addAnimation(trans2);
>
> >> >> > > > >         rootSet.setRepeatCount(Animation.INFINITE);
> >> >> > > > >         rootSet.setRepeatMode(Animation.RESTART);
>
> >> >> > > > >         // Start the animation.
> >> >> > > > >         animWindow.startAnimation(rootSet);
> >> >> > > > >     }- Hide quoted text -
>
> >> >> > > > - Show quoted text -- Hide quoted text -
>
> >> >> > > - Show quoted text -- Hide quoted text -
>
> >> >> - Show quoted text -
>
> >> --
> >> 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- Hide quoted 
> >> text -
>
> >> - Show quoted text -
>
> --
> 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] Get reference to "parent" window from TabHost Activity

2009-01-06 Thread mscwd01

I have an Activity which has a TabHost, lets call this the "parent"
Activity. Within the TabHost are two tabs whose content, are
themselves, Activities, lets call them "child" Activities.

The child activites perform several functions which can take a while
to complete so I wish to add an indeterminate progress bar in the
window title bar. However, how do I get a reference to the "parent"
Activity window - from inside a child Activity of the TabHost?

If I use the following code in the "parent" activity, an indeterminate
progress bar displays, however if used within a "child" Activity it is
not displayed...

requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setProgressBarIndeterminateVisibility(true);

So is there a method similar to getParentWindow() which will allow me
to get a reference to the parent window from inside a child activity
of the TabHost??

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: What is the best practice for finding friends that have android phones?

2009-01-06 Thread Mark Murphy

Robert Green wrote:
> I totally understand what you're saying.  There is a chicken or egg
> problem, though.  Say user 1 wants to play user 2 but user 2 isn't
> registered yet.  What is a convenient way to set up the game so that
> user 2 is in "pending" status but user 1 didn't have to explicitly
> enter user 2's email address?  After that, how does the system know
> user 2 is linked to that game when user 2 registers?

Using email addresses as unique identifiers sucks, IMHO.

However, there is a *huge* difference between User 1 telling your app
"User 2 will be signing up soon, use her email address" and your app
slurping down hundreds of email addresses in the off chance that
someday, maybe, one or more of them will become users of your app.

To look at this another way: when a desktop program slurps down hundreds
of email addresses and sends it to a third party Web service, we call it
"malware". Why is this somehow different?

> I don't think it cuts into privacy because at this point people are
> used to using their email address as their identifier on almost every
> web site out there. 

Let's go back to User 1 and User 2. User 1 signs up for your service and
hands over User 1's email address. That's fine, because User 1 is the
one agreeing to sign up. Sometime in the future, User 2 signs up for
your service and hands over User 2's email address. That's all fine too,
because User 2 is the one agreeing to sign up.

What you're proposing is that User 1 also gives you User 2's email
address. User 2 didn't exactly get a vote in this decision. Perhaps User
2 wants to use a different address (e.g., a unique one for your app, to
minimize possible spam). Perhaps User 2 won't sign up for your app after
realizing she has to provide you with her email address just to play
some game. Perhaps User 2 isn't quite the friend that User 1 thinks she is.

Of course, what you're *really* proposing is for User 1 to give you the
email addresses of User 2, User 3, User 4, ..., User N ("have each user
register for the online service by providing all of their contact email
addresses").

You really should talk to qualified legal counsel about your concept, as
I suspect there are several US states' attorney generals (attornies
general?) who might disagree with your position. Particularly if your
game may involve minors.

> My goal is to make it as easy as possible to create games with users
> that aren't registered yet but will be registering in the future.

That's a noble goal. Just don't assume you can rummage around somebody's
contact list in achieving that goal.

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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android 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-gson:246]: using Google GSON in an Android application

2009-01-06 Thread Luciano Resende

Are there any specific features unique to GSON that you need ?
Maybe you could use the native JSON support from Android platform.

On Tue, Jan 6, 2009 at 4:00 PM, Sean Sullivan  wrote:
>
> Is anybody using Google's GSON library in an Android application?
>
> I can't get GSON to work properly on Android's Dalvik VM.   The Dalvik
> runtime is throwing java.lang.TypeNotPresentException.
>
> Here is the stack trace:
>
> E/jpoco.android.ContactsActivity(  251): Type jpoco.client.Contact not present
> E/jpoco.android.ContactsActivity(  251):
> java.lang.TypeNotPresentException: Type jpoco.client.Contact not
> present
> E/jpoco.android.ContactsActivity(  251):at
> org.apache.harmony.luni.lang.reflect.ImplForType.getRawType(ImplForType.java:63)
> E/jpoco.android.ContactsActivity(  251):at
> org.apache.harmony.luni.lang.reflect.ImplForType.getResolvedType(ImplForType.java:72)
> E/jpoco.android.ContactsActivity(  251):at
> org.apache.harmony.luni.lang.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:68)
> E/jpoco.android.ContactsActivity(  251):at
> org.apache.harmony.luni.lang.reflect.ImplForType.getActualTypeArguments(ImplForType.java:40)
> E/jpoco.android.ContactsActivity(  251):at
> com.google.gson.TypeInfoFactory.getActualType(TypeInfoFactory.java:65)
> E/jpoco.android.ContactsActivity(  251):at
> com.google.gson.TypeInfoFactory.getTypeInfoForField(TypeInfoFactory.java:54)
> E/jpoco.android.ContactsActivity(  251):at
> com.google.gson.ObjectNavigator.navigateClassFields(ObjectNavigator.java:136)
> E/jpoco.android.ContactsActivity(  251):at
> com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:122)
> E/jpoco.android.ContactsActivity(  251):at
> com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:73)
> E/jpoco.android.ContactsActivity(  251):at
> com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:49)
> E/jpoco.android.ContactsActivity(  251):at
> com.google.gson.Gson.fromJson(Gson.java:381)
> E/jpoco.android.ContactsActivity(  251):at
> com.google.gson.Gson.fromJson(Gson.java:329)
> E/jpoco.android.ContactsActivity(  251):at
> com.google.gson.Gson.fromJson(Gson.java:305)
> E/jpoco.android.ContactsActivity(  251):at
> jpoco.io.Deserializer.deserialize(Deserializer.java:63)
> E/jpoco.android.ContactsActivity(  251):at
> jpoco.client.Client.fromString(Client.java:152)
>
> >
>



-- 
Luciano Resende
Apache Tuscany, Apache PhotArk
http://people.apache.org/~lresende
http://lresende.blogspot.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] using Google GSON in an Android application

2009-01-06 Thread Sean Sullivan

Is anybody using Google's GSON library in an Android application?

I can't get GSON to work properly on Android's Dalvik VM.   The Dalvik
runtime is throwing java.lang.TypeNotPresentException.

Here is the stack trace:

E/jpoco.android.ContactsActivity(  251): Type jpoco.client.Contact not present
E/jpoco.android.ContactsActivity(  251):
java.lang.TypeNotPresentException: Type jpoco.client.Contact not
present
E/jpoco.android.ContactsActivity(  251):at
org.apache.harmony.luni.lang.reflect.ImplForType.getRawType(ImplForType.java:63)
E/jpoco.android.ContactsActivity(  251):at
org.apache.harmony.luni.lang.reflect.ImplForType.getResolvedType(ImplForType.java:72)
E/jpoco.android.ContactsActivity(  251):at
org.apache.harmony.luni.lang.reflect.ListOfTypes.getResolvedTypes(ListOfTypes.java:68)
E/jpoco.android.ContactsActivity(  251):at
org.apache.harmony.luni.lang.reflect.ImplForType.getActualTypeArguments(ImplForType.java:40)
E/jpoco.android.ContactsActivity(  251):at
com.google.gson.TypeInfoFactory.getActualType(TypeInfoFactory.java:65)
E/jpoco.android.ContactsActivity(  251):at
com.google.gson.TypeInfoFactory.getTypeInfoForField(TypeInfoFactory.java:54)
E/jpoco.android.ContactsActivity(  251):at
com.google.gson.ObjectNavigator.navigateClassFields(ObjectNavigator.java:136)
E/jpoco.android.ContactsActivity(  251):at
com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:122)
E/jpoco.android.ContactsActivity(  251):at
com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:73)
E/jpoco.android.ContactsActivity(  251):at
com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:49)
E/jpoco.android.ContactsActivity(  251):at
com.google.gson.Gson.fromJson(Gson.java:381)
E/jpoco.android.ContactsActivity(  251):at
com.google.gson.Gson.fromJson(Gson.java:329)
E/jpoco.android.ContactsActivity(  251):at
com.google.gson.Gson.fromJson(Gson.java:305)
E/jpoco.android.ContactsActivity(  251):at
jpoco.io.Deserializer.deserialize(Deserializer.java:63)
E/jpoco.android.ContactsActivity(  251):at
jpoco.client.Client.fromString(Client.java:152)

--~--~-~--~~~---~--~~
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: What is the best practice for finding friends that have android phones?

2009-01-06 Thread Robert Green

I totally understand what you're saying.  There is a chicken or egg
problem, though.  Say user 1 wants to play user 2 but user 2 isn't
registered yet.  What is a convenient way to set up the game so that
user 2 is in "pending" status but user 1 didn't have to explicitly
enter user 2's email address?  After that, how does the system know
user 2 is linked to that game when user 2 registers?

I don't think it cuts into privacy because at this point people are
used to using their email address as their identifier on almost every
web site out there.  I am concerned about the "read contacts"
permission because you're definitely right about that.

My goal is to make it as easy as possible to create games with users
that aren't registered yet but will be registering in the future.
Thoughts?

On Jan 6, 5:16 pm, Mark Murphy  wrote:
> Robert Green wrote:
> > What would be the ideal solution is if somehow the user's contacts had
> > a flag that indicated if the contact has registered an android phone
> > to a given email address.  Does that exist?
>
> Not that I'm aware of.
>
> > I'm assuming that nothing like that exists so my solution is to have
> > each user register for the online service by providing all of their
> > contact email addresses.  
>
> This strikes me as quite the privacy violation.
>
> Not to mention the READ_CONTACTS permission will cut into your sales.
> "WTF? Why does this game need to read my contacts?" will be a common
> reaction.
>
> > This way, when another user tries to add the
> > to a game, they can be found by any of their emails.  
>
> You are assuming all contacts have email addresses that the other party
> knows and has entered into their phones.
>
> > Solutions?
>
> Have people create accounts on your Web site (or an Android app
> front-end to your site/Web service). Since your app is only for Android
> devices, only people with Android devices will bother creating accounts.
> Friends provide friends with their account name via out-of-band channels
> (email, SMS, Twitter DM, voice call, sticky note on monitor, postal
> letter, fax, carrier pigeon, etc.) for the purposes of knitting together
> groups for future games.
>
> If your solution needs sex appeal, use OpenID/OAuth for user accounts
> and Web service authentication.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.9 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android 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] hey Google men! Autocomplete problem. thanks

2009-01-06 Thread jphdsn

hi
,
How to use AutoCompleteTextWiew  with a cursor ?

I tried for instance for the cursor addr

contact.addTextChangedListener(this);
contact.setAdapter(new SimpleCursorAdapter
(this,R.layout.selectmail_item,addr,
new String[]
{Contacts.ContactMethods.NAME},new int[]
{R.id.name}));

but all my contacts names are played. A

Autocomplete works with ArrayList? when I trie it doesn't work.

Is this a bug? Or something that I don't understand?

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: Repeating AnimationSet

2009-01-06 Thread Sundog

I see. I will try that tonight and report on results. Thanks for the
suggestion.

On Jan 6, 3:44 pm, Romain Guy  wrote:
> You can achieve it by using two Animations. Start the first one and
> when it ends (using an animation listener to be notified), start the
> second one. It's not as nice and easy but it should work.
>
>
>
>
>
> On Tue, Jan 6, 2009 at 2:43 PM, Sundog  wrote:
>
> > Ahh, thank you. I knew "the answer was out there".
>
> > So much for my cool animation...
>
> > On Jan 6, 3:20 pm, Romain Guy  wrote:
> >> It is a known issue.
>
> >> On Tue, Jan 6, 2009 at 2:17 PM, Sundog  wrote:
>
> >> > That category is getting a little crowded for my tastes.
>
> >> > On Jan 6, 3:15 pm, loty  wrote:
> >> >> I've seen this one too and gave up.
> >> >> I guess we'll have to file into "Nobody knows nobody cares" category
>
> >> >> On Jan 6, 4:06 pm, Sundog  wrote:
>
> >> >> > We'll settle for a "No, you dummies, you're doing it wrong!"
>
> >> >> > On Jan 6, 8:19 am, Sundog  wrote:
>
> >> >> > > I posted about exactly this a couple of days ago with no responses.
> >> >> > > Now with your report I'm beginning to think it's a real bug.
>
> >> >> > > Anyone at Google care to toss in an opinion?
>
> >> >> > > On Jan 6, 7:25 am, rsung  wrote:
>
> >> >> > > > Anyone??? Is this a known bug?
>
> >> >> > > > On Dec 21 2008, 11:00 pm, PKC  wrote:
>
> >> >> > > > > I'm trying to make a simple set of animationsrepeat.  Based on
> >> >> > > > > documentation, it appears that below should work but the 
> >> >> > > > > animation
> >> >> > > > > runs once and does notrepeat.  Any pointers would be 
> >> >> > > > > appreciated.
>
> >> >> > > > > Thanks
>
> >> >> > > > >     public void onCreate(Bundle savedInstanceState) {
> >> >> > > > >         super.onCreate(savedInstanceState);
> >> >> > > > >         setContentView(R.layout.main);
>
> >> >> > > > >         TextView animWindow = 
> >> >> > > > > (TextView)findViewById(R.id.anim_text);
>
> >> >> > > > >        AnimationSetrootSet = newAnimationSet(true);
> >> >> > > > >         rootSet.setInterpolator(new AccelerateInterpolator());
>
> >> >> > > > >         // Create and add first child, a motion animation.
> >> >> > > > >         TranslateAnimation trans1 = new TranslateAnimation(0, 
> >> >> > > > > 30, 0,
> >> >> > > > > 0);
> >> >> > > > >         trans1.setStartOffset(0);
> >> >> > > > >         trans1.setDuration(800);
> >> >> > > > >         trans1.setFillAfter(true);
> >> >> > > > >         rootSet.addAnimation(trans1);
>
> >> >> > > > >         // Add a final motion animation to the root set.
> >> >> > > > >         TranslateAnimation trans2 = new TranslateAnimation(0, 
> >> >> > > > > 0, 0,
> >> >> > > > > 100);
> >> >> > > > >         trans2.setFillAfter(true);
> >> >> > > > >         trans2.setDuration(800);
> >> >> > > > >         trans2.setStartOffset(800);
> >> >> > > > >         rootSet.addAnimation(trans2);
>
> >> >> > > > >         rootSet.setRepeatCount(Animation.INFINITE);
> >> >> > > > >         rootSet.setRepeatMode(Animation.RESTART);
>
> >> >> > > > >         // Start the animation.
> >> >> > > > >         animWindow.startAnimation(rootSet);
> >> >> > > > >     }- Hide quoted text -
>
> >> >> > > > - Show quoted text -- Hide quoted text -
>
> >> >> > > - Show quoted text -- Hide quoted text -
>
> >> >> - Show quoted text -
>
> >> --
> >> 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- Hide quoted 
> >> text -
>
> >> - Show quoted text -
>
> --
> 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- 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: Really need to subclass MapView in MapActivity

2009-01-06 Thread Mark Murphy

Tim Bray wrote:
> I have a MapActivity, and an Overlay on its MapView on which I draw some
> graphics (picture
> at http://www.tbray.org/ongoing/When/200x/2009/01/01/FeedMapper).  I
> handle touch events on the map and display popups.  I am having all
> sorts of problems because MapActivity makes its own MapView so I can't
> get in and subclass its onTouchEvent methods.  So I'm having to
> intervene in the Activity's dispatchTouchEvent, which has incorect x/y
> co-ords for the MapView and creates all sorts of problems when I display
> a popup over the map and try to make sure its buttons get the touches as
> opposed the what might be on the map underneath them.
> 
> Is there any way to inject my own overridden MapView or otherwise get at
> the existing one's onTouchEvent()?  Without this, it's really hard to do
> interactive map-based graphic apps starting with MapActivity.  -T

Unfortunately, MapView/MapActivity are not open source. Otherwise, I'd
recommend looking at the source and perhaps cloning/subclassing
MapActivity to give you the hooks you need.

IMHO, these sorts of events should be handled by listeners rather than
callbacks requiring subclasses, but that's just me.

plusminus has created a workalike to MapView using Open Street Map over
at http://osmdroid.googlecode.com/ -- possibly you will have better luck
using it.

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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android 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] Create contextmenu just like the one on the homescreen

2009-01-06 Thread akurni

Hi,

I can create context menu on my app, but it's a single level only.
The question is how to create categorized menu on my context menu just
like on the home screen's context menu?

Example:

Application (level 1)
 |-Application name (level 2)
 |-
Shortcut
Widget

I tried to use submenu, but it pops up another dialog box instead of
expanding the category.

Can anybody give me a hint?

Thanks

Andrew
--~--~-~--~~~---~--~~
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: When will the Media classes be able to connect to telephone 'conversation' audio channels ?

2009-01-06 Thread Dianne Hackborn
I'd never claim that all of the software on android can be replaced by third
party developers.  Most system application components can be re-used and
replaced by third party apps, but that is a very different statement.

Also, just being able to replace the phone app (which is not really any app,
but more a core system process) means nothing about being able to do
IVR-like features -- all the phone app does is talk with the radio module
(running on a different processor) using very high-level commands.

If you want to add new features to the platform, you can get the source code
and look/work on it, and talk about that work on android-platform.  Though
again, I doubt you would get very far adding IVR features even directly
modifying the platform code.

On Sun, Jan 4, 2009 at 5:30 PM, StevenS  wrote:

>
> Thanks for the replies David !
>
> I totally understand that the hardware manufacturer needs to implement
> the appropriate links - like a couple of extra traces of copper - what
> I don't understand is WHY they wouldn't !  Or WHY it wouldn't be seen
> as a basic requirement for the product.
>
> I also question WHY there's concern about a lack of CPU power - I've
> been doing IVR development since early 1997, where an Intel 386 CPU
> was supporting multiple simulatenous phone calls.  Well, actually, in
> hindsight, the CPU was supported by a telephony board ...  so maybe
> this concern is valid ...
>
> In any event, what happened to the statement that ALL software on the
> Android platform could be replaced - including the phone
> (interface) ?  It's my interpretation that if the phone app can handle
> incoming & outgoing calls, then it should be possible to extend it to
> include IVR-like features.
>
> Is there a more-appropriate forum to discuss this 'issue' /
> requirement / feature request ?
>
> Thanks,
> Steven.
>
>
> On Jan 3, 8:36 am, Dave Sparks  wrote:
> > It may be a compelling feature, but it's outside the control of the
> > apps processor. It is up to the hardware manufacturer to implement
> > this, not Android.
> >
> > My understanding is that there are strict latency requirements on GSM
> > audio that makes it difficult to loop call audio through the apps
> > processor.
> >
> > On Jan 2, 4:06 pm, "mashpl...@gmail.com"  wrote:
> >
> >
> >
> > > This is a mistake.  There are many reasons why exposing in-call audio
> > > to the apps process is a good idea.  Please reconsider your position
> > > on this.
> >
> > > Kind Regards,
> >
> > > Vince
> >
> > > On Jan 3, 1:27 am, Dave Sparks  wrote:
> >
> > > > There are no plans for exposing in-call audio to the apps processor.
> > > > In-call audio is controlled by the radio and typically not accessible
> > > > to the apps processor.
> >
> > > > On Dec 26 2008, 10:00 pm,StevenS wrote:
> >
> > > > > If I'm reading the API documentation correctly, neither the
> > > > > MediaRecorder.AudioSource nor the  MediaPlayer.AudioSource can
> connect
> > > > > to the telephone conversation audio channels - eg. the TELEPHONE
> > > > > CONVERSATION microphone & speaker 'lines'.
> >
> > > > > Both of these would be required to support advanced call handling
> > > > > applications ON THE DEVICE.
> >
> > > > > Are there any plans to support this type of functionality ?
> >
> > > > > When might it be available ?
> >
> > > > > Thanks,
> > > > > Steven.- Hide quoted text -
> >
> > - Show quoted text -
> >
>


-- 
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.  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] Really need to subclass MapView in MapActivity

2009-01-06 Thread Tim Bray
I have a MapActivity, and an Overlay on its MapView on which I draw some
graphics (picture at
http://www.tbray.org/ongoing/When/200x/2009/01/01/FeedMapper).  I handle
touch events on the map and display popups.  I am having all sorts of
problems because MapActivity makes its own MapView so I can't get in and
subclass its onTouchEvent methods.  So I'm having to intervene in the
Activity's dispatchTouchEvent, which has incorect x/y co-ords for the
MapView and creates all sorts of problems when I display a popup over the
map and try to make sure its buttons get the touches as opposed the what
might be on the map underneath them.

Is there any way to inject my own overridden MapView or otherwise get at the
existing one's onTouchEvent()?  Without this, it's really hard to do
interactive map-based graphic apps starting with MapActivity.  -T

--~--~-~--~~~---~--~~
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: What is the best practice for finding friends that have android phones?

2009-01-06 Thread Mark Murphy

Robert Green wrote:
> What would be the ideal solution is if somehow the user's contacts had
> a flag that indicated if the contact has registered an android phone
> to a given email address.  Does that exist?

Not that I'm aware of.

> I'm assuming that nothing like that exists so my solution is to have
> each user register for the online service by providing all of their
> contact email addresses.  

This strikes me as quite the privacy violation.

Not to mention the READ_CONTACTS permission will cut into your sales.
"WTF? Why does this game need to read my contacts?" will be a common
reaction.

> This way, when another user tries to add the
> to a game, they can be found by any of their emails.  

You are assuming all contacts have email addresses that the other party
knows and has entered into their phones.

> Solutions?

Have people create accounts on your Web site (or an Android app
front-end to your site/Web service). Since your app is only for Android
devices, only people with Android devices will bother creating accounts.
Friends provide friends with their account name via out-of-band channels
(email, SMS, Twitter DM, voice call, sticky note on monitor, postal
letter, fax, carrier pigeon, etc.) for the purposes of knitting together
groups for future games.

If your solution needs sex appeal, use OpenID/OAuth for user accounts
and Web service authentication.

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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android 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 on/off Intents Can't Be Declared in AndroidManifest?

2009-01-06 Thread Dianne Hackborn
Wonderful. :)

On Tue, Jan 6, 2009 at 3:12 PM, ArtJin  wrote:

>
> Oh, I did not understand the question, apologies. Good point!
> I fixed that, so everything is handled by a single process that
> receives both on and off broadcasts.
> Thanks.
>
>
> On Jan 6, 6:01 pm, ArtJin  wrote:
> > I just changed my service class to run the thread loop with handler,
> > instead of creating a scheduled alarm.
> > This way my app is able to react on screen changes, since SCREEN_ON/
> > OFF broadcasts are available only when actively registered.
> > Lots of learning today :-)
> > Thanks a bunch for your help.
> >
> > On Jan 6, 5:23 pm, ArtJin  wrote:
> >
> > > Got it thanks.
> >
> > > To answer your question let me describe what I am trying to do.
> > > I have an AlarmManager that runs a service, which connects to web
> > > server and gets some data.
> > > Everything works fine, but battery drains quickly since AlarmManager
> > > stops running only when CPU stops.
> > > So I wanted to reschedule the AlarmManager according to screen's on/
> > > off situation, since I do not really need it running when user is not
> > > looking at the screen.
> > > I guess I need to re-think the design approach.
> > > What would you recommend?
> > > Thanks again for quick response! :-)
> >
> > > On Jan 6, 5:02 pm, "Dianne Hackborn"  wrote:
> >
> > > > These are currently only delivered to receivers actively registered
> with
> > > > registerReceiver().
> >
> > > > On a side note...  why are you running your receivers in a separate
> > > > process??
> >
> > > > On Tue, Jan 6, 2009 at 1:57 PM, ArtJin  wrote:
> >
> > > > > Hello everybody.
> > > > > Carter, did you find out what was the problem?
> > > > > I am having exact same issue.
> > > > > the receivers are installed with no problems, however they do not
> > > > > receive SCREEN_ON orSCREEN_OFFbroadcasts for some reason, unless I
> > > > > do everything programatically.
> > > > > Here is the receiver snippet from my manifest:
> > > > >  > > > > android:process=":remote">
> > > > >  
> > > > >   
> > > > >  
> > > > > 
> > > > >  > > > > android:process=":remote">
> > > > >  
> > > > > android:name="android.intent.action.SCREEN_OFF">
> > > > >  
> > > > > 
> >
> > > > > Ideas are appreciated!
> > > > > Thanks :-)
> >
> > > > > On Dec 4 2008, 1:22 pm, Carter  wrote:
> > > > > > I'm trying to detect when the phone's screen turns on and off
> with the
> > > > > > SCREEN_ON andSCREEN_OFFIntents.  A BroadcastReceiver declared in
> the
> > > > > > AndroidManifest doesn't work with these screen on/off Intents,
> but
> > > > > > instantiating a BroadcastReceiver programatically at runtime does
> > > > > > work.
> >
> > > > > > As far as troubleshooting goes: my AndroidManifest
> BroadcastReceiver
> > > > > > is properly receiving other Intents, such as for phone boot.
>  There is
> > > > > > no helpful information in LogCat.  And this isn't a permissions
> issue,
> > > > > > since it works when declared programatically.
> >
> > > > > > There are no explanations in the JavaDocs (e.g. its not like the
> > > > > > battery changed Intent which cannot be declared in the Manifest),
> > > > > > although when searching through the Android source I discovered
> that
> > > > > > none of the Android OS services declare interest this particular
> > > > > > Intent in XML either.
> >
> > > > > > So any ideas why I can't declare SCREEN_ON andSCREEN_OFFin the
> > > > > > AndroidManifest?
> >
> > > > --
> > > > 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.  All such questions should be posted on
> public
> > > > forums, where I and others can see and answer them.
> >
>


-- 
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.  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: Screen on/off Intents Can't Be Declared in AndroidManifest?

2009-01-06 Thread ArtJin

Oh, I did not understand the question, apologies. Good point!
I fixed that, so everything is handled by a single process that
receives both on and off broadcasts.
Thanks.


On Jan 6, 6:01 pm, ArtJin  wrote:
> I just changed my service class to run the thread loop with handler,
> instead of creating a scheduled alarm.
> This way my app is able to react on screen changes, since SCREEN_ON/
> OFF broadcasts are available only when actively registered.
> Lots of learning today :-)
> Thanks a bunch for your help.
>
> On Jan 6, 5:23 pm, ArtJin  wrote:
>
> > Got it thanks.
>
> > To answer your question let me describe what I am trying to do.
> > I have an AlarmManager that runs a service, which connects to web
> > server and gets some data.
> > Everything works fine, but battery drains quickly since AlarmManager
> > stops running only when CPU stops.
> > So I wanted to reschedule the AlarmManager according to screen's on/
> > off situation, since I do not really need it running when user is not
> > looking at the screen.
> > I guess I need to re-think the design approach.
> > What would you recommend?
> > Thanks again for quick response! :-)
>
> > On Jan 6, 5:02 pm, "Dianne Hackborn"  wrote:
>
> > > These are currently only delivered to receivers actively registered with
> > > registerReceiver().
>
> > > On a side note...  why are you running your receivers in a separate
> > > process??
>
> > > On Tue, Jan 6, 2009 at 1:57 PM, ArtJin  wrote:
>
> > > > Hello everybody.
> > > > Carter, did you find out what was the problem?
> > > > I am having exact same issue.
> > > > the receivers are installed with no problems, however they do not
> > > > receive SCREEN_ON orSCREEN_OFFbroadcasts for some reason, unless I
> > > > do everything programatically.
> > > > Here is the receiver snippet from my manifest:
> > > >  > > > android:process=":remote">
> > > >  
> > > >   
> > > >  
> > > > 
> > > >  > > > android:process=":remote">
> > > >  
> > > >
> > > >  
> > > > 
>
> > > > Ideas are appreciated!
> > > > Thanks :-)
>
> > > > On Dec 4 2008, 1:22 pm, Carter  wrote:
> > > > > I'm trying to detect when the phone's screen turns on and off with the
> > > > > SCREEN_ON andSCREEN_OFFIntents.  A BroadcastReceiver declared in the
> > > > > AndroidManifest doesn't work with these screen on/off Intents, but
> > > > > instantiating a BroadcastReceiver programatically at runtime does
> > > > > work.
>
> > > > > As far as troubleshooting goes: my AndroidManifest BroadcastReceiver
> > > > > is properly receiving other Intents, such as for phone boot.  There is
> > > > > no helpful information in LogCat.  And this isn't a permissions issue,
> > > > > since it works when declared programatically.
>
> > > > > There are no explanations in the JavaDocs (e.g. its not like the
> > > > > battery changed Intent which cannot be declared in the Manifest),
> > > > > although when searching through the Android source I discovered that
> > > > > none of the Android OS services declare interest this particular
> > > > > Intent in XML either.
>
> > > > > So any ideas why I can't declare SCREEN_ON andSCREEN_OFFin the
> > > > > AndroidManifest?
>
> > > --
> > > 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.  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 start the standard MusicBrowserActivity?

2009-01-06 Thread geoff . stromberg

Thanks Alex,

Your second suggestion is much like what I ended up doing. This
launches the built in MediaPlaybackActivity and begins playing the
desired track. However, I'm now trying to figure out to keep that
track playing when you back out of the MediaPlaybackActivity. My
problem is that when you back out of the MediaPlaybackActivity, the
track stops. Compare this to launching a track using the built in
MusicBrowser, where the track will continue playing when you back out
of the MediaPlaybackActivity.

Perhaps there's an intent extra required? I tried fiddling with the
boolean "oneshot" intent extra, but that didn't help.

Here is some example code showing how I am querying for and playing
the first track found using the built in MediaPlaybackActivity:

import android.provider.MediaStore.Audio.Media;
// a bunch of other imports...

// query all tracks on sdcard
Cursor cursor = getContentResolver().query(
Media.EXTERNAL_CONTENT_URI, null, null, null, null);
if(cursor == null)
return;
// begin iterating query cursor
if(!cursor.moveToFirst())
return;
// get the id and mime type of the first track in query results
int mediaId = cursor.getInt(
cursor.getColumnIndex(Media._ID));
String mediaMimeType = cursor.getString(
cursor.getColumnIndex(Media.MIME_TYPE));
// form the full URI for the first track
Uri mediaUri = ContentUris.withAppendedId(
Media.EXTERNAL_CONTENT_URI, mediaId);
// form the intent and start the MediaPlaybackActivity
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(mediaUri, mediaMimeType);
startActivity(intent);



On Jan 3, 2:10 am, AlexG  wrote:
> Ok
>
> I found out how to do so:
>
> Intent intent = new Intent();
>                         intent.setAction(android.content.Intent.ACTION_VIEW);
>                         File file = new File();
>                         intent.setDataAndType(Uri.fromFile(file), "audio/*");
>                         startActivity(intent);
>
> On Dec 23 2008, 1:16 am,geoff.stromb...@gmail.com wrote:
>
> > Hello,
>
> > From within my application, I'd like to start the standard
> > MusicBrowserActivity (found in Music.apk) which is built into Android.
> > I want to start it programmatically, just as if the user had picked
> > "Music" from the application launcher.
>
> > The class for this Activity is:
> > com.android.music.MusicBrowserActivity
>
> > However, I can't create an Intent explicitly referencing this class
> > because I can't import the package com.android.music (at least not
> > with the default ADT eclipse setup).
>
> > Any ideas on how I can programmatically start MusicBrowserActivity?
>
> > Thanks for any pointers!
--~--~-~--~~~---~--~~
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 do an animated pie chart?

2009-01-06 Thread melody

Thank you.  That's very helpful.



Dianne Hackborn wrote:
> You shouldn't need to use a worker thread.  If you want to run up to the
> screen refresh rate, just do invalidate() in onDraw().  Otherwise, you can
> use Handler in the main thread to post delayed messages to achieve whatever
> update rate you want.
>
> On Mon, Jan 5, 2009 at 4:04 PM, melody  wrote:
>
> >
> > I wasn't able to do this with the standard animation classes, but I
> > did manage to do it.
> >
> > First I used the use of the ArcShape class to generate the slice of
> > the pie.  In order to acheive the animation, I set up a worker thread
> > to repeatedly change the sweepAngle and call invalidate() on the
> > containing view at an arbitrary refresh rate (50ms seems to look
> > smooth).  It seems to work fine, but again, if anyone knows of a
> > better way to do this, I'm all ears.
> >
> >
> >
> > melody wrote:
> > > Hi,
> > >
> > > I tried asking this in the beginners forum but didn't get any
> > > responses so I thought I'd try here.
> > >
> > > I was wondering if someone could give me some guidance on how to do an
> > > animated pie chart. My initial idea is to have a circle background
> > > image as my pie, and then create a "slice" of the pie and animate the
> > > scale and rotation of the slice.  However I'm not really sure how to
> > > do that.
> > >
> > > Or if there is a completely different but better way to do this, that
> > > would be great to know too.
> > >
> > > Thanks.
> > >
> >
>
>
> --
> 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.  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: Please Google: clean racist comment on Android Market

2009-01-06 Thread mathiastck

The comments feature is useful, I've found them to be very helpful for
the Apple App store.  Giving users the ability to rank comments as
helpful or unhelpful could help improve their quality.

This thread probably belongs on Android discuss though.

On Jan 6, 1:54 pm, Sundog  wrote:
> IMHO it is well past time for Google to admit that the comments are an
> idea that was not well thought out, and disable the feature entirely.
> The comments feature, unlike the ratings, has no value whatsoever,
> especially unmoderated.
>
> On Jan 6, 2:13 pm, arnouf  wrote:
>
> > Hello,
>
> > I posted yesterday a new app (DiceDroid on Android Market) and I don't
> > why a racist discussion is running through the comments feature.
>
> > Please Google, could you delete this racist comments!!
>
> > You can contact me at arnaud.farine AROBAS expertiseandroid.com
>
> > Thanks a lot for your support
>
> > Arnaud
--~--~-~--~~~---~--~~
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 on/off Intents Can't Be Declared in AndroidManifest?

2009-01-06 Thread ArtJin

I just changed my service class to run the thread loop with handler,
instead of creating a scheduled alarm.
This way my app is able to react on screen changes, since SCREEN_ON/
OFF broadcasts are available only when actively registered.
Lots of learning today :-)
Thanks a bunch for your help.

On Jan 6, 5:23 pm, ArtJin  wrote:
> Got it thanks.
>
> To answer your question let me describe what I am trying to do.
> I have an AlarmManager that runs a service, which connects to web
> server and gets some data.
> Everything works fine, but battery drains quickly since AlarmManager
> stops running only when CPU stops.
> So I wanted to reschedule the AlarmManager according to screen's on/
> off situation, since I do not really need it running when user is not
> looking at the screen.
> I guess I need to re-think the design approach.
> What would you recommend?
> Thanks again for quick response! :-)
>
> On Jan 6, 5:02 pm, "Dianne Hackborn"  wrote:
>
> > These are currently only delivered to receivers actively registered with
> > registerReceiver().
>
> > On a side note...  why are you running your receivers in a separate
> > process??
>
> > On Tue, Jan 6, 2009 at 1:57 PM, ArtJin  wrote:
>
> > > Hello everybody.
> > > Carter, did you find out what was the problem?
> > > I am having exact same issue.
> > > the receivers are installed with no problems, however they do not
> > > receive SCREEN_ON orSCREEN_OFFbroadcasts for some reason, unless I
> > > do everything programatically.
> > > Here is the receiver snippet from my manifest:
> > >  > > android:process=":remote">
> > >  
> > >   
> > >  
> > > 
> > >  > > android:process=":remote">
> > >  
> > >
> > >  
> > > 
>
> > > Ideas are appreciated!
> > > Thanks :-)
>
> > > On Dec 4 2008, 1:22 pm, Carter  wrote:
> > > > I'm trying to detect when the phone's screen turns on and off with the
> > > > SCREEN_ON andSCREEN_OFFIntents.  A BroadcastReceiver declared in the
> > > > AndroidManifest doesn't work with these screen on/off Intents, but
> > > > instantiating a BroadcastReceiver programatically at runtime does
> > > > work.
>
> > > > As far as troubleshooting goes: my AndroidManifest BroadcastReceiver
> > > > is properly receiving other Intents, such as for phone boot.  There is
> > > > no helpful information in LogCat.  And this isn't a permissions issue,
> > > > since it works when declared programatically.
>
> > > > There are no explanations in the JavaDocs (e.g. its not like the
> > > > battery changed Intent which cannot be declared in the Manifest),
> > > > although when searching through the Android source I discovered that
> > > > none of the Android OS services declare interest this particular
> > > > Intent in XML either.
>
> > > > So any ideas why I can't declare SCREEN_ON andSCREEN_OFFin the
> > > > AndroidManifest?
>
> > --
> > 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.  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: When will the Media classes be able to connect to telephone 'conversation' audio channels ?

2009-01-06 Thread Dave Sparks

android-discuss is probably a better forum for this discussion.

I would like to correct a misconception: Android is an application
processor stack. It does not include a radio stack, nor is it likely
to include one in the near future. The radio firmware is typically
proprietary to the chip vendor and closely tied to the hardware
architecture of the chip.

On Jan 4, 5:30 pm, StevenS  wrote:
> Thanks for the replies David !
>
> I totally understand that the hardware manufacturer needs to implement
> the appropriate links - like a couple of extra traces of copper - what
> I don't understand is WHY they wouldn't !  Or WHY it wouldn't be seen
> as a basic requirement for the product.
>
> I also question WHY there's concern about a lack of CPU power - I've
> been doing IVR development since early 1997, where an Intel 386 CPU
> was supporting multiple simulatenous phone calls.  Well, actually, in
> hindsight, the CPU was supported by a telephony board ...  so maybe
> this concern is valid ...
>
> In any event, what happened to the statement that ALL software on the
> Android platform could be replaced - including the phone
> (interface) ?  It's my interpretation that if the phone app can handle
> incoming & outgoing calls, then it should be possible to extend it to
> include IVR-like features.
>
> Is there a more-appropriate forum to discuss this 'issue' /
> requirement / feature request ?
>
> Thanks,
> Steven.
>
> On Jan 3, 8:36 am, Dave Sparks  wrote:
>
> > It may be a compelling feature, but it's outside the control of the
> > apps processor. It is up to the hardware manufacturer to implement
> > this, not Android.
>
> > My understanding is that there are strict latency requirements on GSM
> > audio that makes it difficult to loop call audio through the apps
> > processor.
>
> > On Jan 2, 4:06 pm, "mashpl...@gmail.com"  wrote:
>
> > > This is a mistake.  There are many reasons why exposing in-call audio
> > > to the apps process is a good idea.  Please reconsider your position
> > > on this.
>
> > > Kind Regards,
>
> > > Vince
>
> > > On Jan 3, 1:27 am, Dave Sparks  wrote:
>
> > > > There are no plans for exposing in-call audio to the apps processor.
> > > > In-call audio is controlled by the radio and typically not accessible
> > > > to the apps processor.
>
> > > > On Dec 26 2008, 10:00 pm,StevenS wrote:
>
> > > > > If I'm reading the API documentation correctly, neither the
> > > > > MediaRecorder.AudioSource nor the  MediaPlayer.AudioSource can connect
> > > > > to the telephone conversation audio channels - eg. the TELEPHONE
> > > > > CONVERSATION microphone & speaker 'lines'.
>
> > > > > Both of these would be required to support advanced call handling
> > > > > applications ON THE DEVICE.
>
> > > > > Are there any plans to support this type of functionality ?
>
> > > > > When might it be available ?
>
> > > > > Thanks,
> > > > > Steven.- 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: Screen on/off Intents Can't Be Declared in AndroidManifest?

2009-01-06 Thread Dianne Hackborn
My question was actually about why you are using multiple processes for your
receiver components.  Nothing in what you describe indicates that you need
that.  Keep in mind that each process currently requires about 2MB of
overhead, and slows down your app if it needs to be launched.

On Tue, Jan 6, 2009 at 2:23 PM, ArtJin  wrote:

>
> Got it thanks.
>
> To answer your question let me describe what I am trying to do.
> I have an AlarmManager that runs a service, which connects to web
> server and gets some data.
> Everything works fine, but battery drains quickly since AlarmManager
> stops running only when CPU stops.
> So I wanted to reschedule the AlarmManager according to screen's on/
> off situation, since I do not really need it running when user is not
> looking at the screen.
> I guess I need to re-think the design approach.
> What would you recommend?
> Thanks again for quick response! :-)
>
>
> On Jan 6, 5:02 pm, "Dianne Hackborn"  wrote:
> > These are currently only delivered to receivers actively registered with
> > registerReceiver().
> >
> > On a side note...  why are you running your receivers in a separate
> > process??
> >
> >
> >
> > On Tue, Jan 6, 2009 at 1:57 PM, ArtJin  wrote:
> >
> > > Hello everybody.
> > > Carter, did you find out what was the problem?
> > > I am having exact same issue.
> > > the receivers are installed with no problems, however they do not
> > > receive SCREEN_ON or SCREEN_OFF broadcasts for some reason, unless I
> > > do everything programatically.
> > > Here is the receiver snippet from my manifest:
> > >  > > android:process=":remote">
> > >  
> > >   
> > >  
> > > 
> > >  > > android:process=":remote">
> > >  
> > >
> > >  
> > > 
> >
> > > Ideas are appreciated!
> > > Thanks :-)
> >
> > > On Dec 4 2008, 1:22 pm, Carter  wrote:
> > > > I'm trying to detect when the phone's screen turns on and off with
> the
> > > > SCREEN_ON andSCREEN_OFFIntents.  A BroadcastReceiver declared in the
> > > > AndroidManifest doesn't work with these screen on/off Intents, but
> > > > instantiating a BroadcastReceiver programatically at runtime does
> > > > work.
> >
> > > > As far as troubleshooting goes: my AndroidManifest BroadcastReceiver
> > > > is properly receiving other Intents, such as for phone boot.  There
> is
> > > > no helpful information in LogCat.  And this isn't a permissions
> issue,
> > > > since it works when declared programatically.
> >
> > > > There are no explanations in the JavaDocs (e.g. its not like the
> > > > battery changed Intent which cannot be declared in the Manifest),
> > > > although when searching through the Android source I discovered that
> > > > none of the Android OS services declare interest this particular
> > > > Intent in XML either.
> >
> > > > So any ideas why I can't declare SCREEN_ON andSCREEN_OFFin the
> > > > AndroidManifest?
> >
> > --
> > 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.  All such questions should be posted on public
> > forums, where I and others can see and answer them.
> >
>


-- 
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.  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: should android:id be unique?

2009-01-06 Thread Dianne Hackborn
If the two layouts are used for the same activity but with different
orientations, then you will need to keep the IDs consistent between them.

On Tue, Jan 6, 2009 at 2:51 PM, skink  wrote:

>
> On 6 Sty, 21:17, "Dianne Hackborn"  wrote:
> > It only needs to be unique within a view hierarchy (or sub-view
> hierarchy)
> > in which you are looking for the ID.
> >
> i thought exactly the same way but when i declared the same IDs in
> different layout files i got strange errors when changing screen
> orientation - i think it was TextView.onRestoreInstanceState
> (Parcelable) - class cast exception
>
> pskink
> >
>


-- 
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.  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: should android:id be unique?

2009-01-06 Thread skink

On 6 Sty, 21:17, "Dianne Hackborn"  wrote:
> It only needs to be unique within a view hierarchy (or sub-view hierarchy)
> in which you are looking for the ID.
>
i thought exactly the same way but when i declared the same IDs in
different layout files i got strange errors when changing screen
orientation - i think it was TextView.onRestoreInstanceState
(Parcelable) - class cast exception

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
-~--~~~~--~~--~--~---



[android-developers] Re: imeem and buffering audio with MediaPlayer

2009-01-06 Thread Dave Sparks

I don't think there will be significant changes to the MediaPlayer API
deployed on devices in the next few months.

On Jan 4, 7:08 pm, Dan McGuirk  wrote:
> Thanks for the reply and the suggestion.
>
> I do wonder, though, how long this will remain the suggested
> solution.  Are there plans to update the API to allow more
> flexibility?  I wouldn't really want to put a lot of effort into
> developing and maintaining this kind of scheme just to throw it away
> in a few months if the API is improved.
>
> On Jan 2, 10:32 am, Dave Sparks  wrote:
>
> > I haven't looked at imeem, but one way to get around the issue is
> > using an HTTP proxy on the device. The proxy server could be buffering
> > up the next stream while the current stream is playing.
--~--~-~--~~~---~--~~
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: Repeating AnimationSet

2009-01-06 Thread Romain Guy

You can achieve it by using two Animations. Start the first one and
when it ends (using an animation listener to be notified), start the
second one. It's not as nice and easy but it should work.

On Tue, Jan 6, 2009 at 2:43 PM, Sundog  wrote:
>
> Ahh, thank you. I knew "the answer was out there".
>
> So much for my cool animation...
>
> On Jan 6, 3:20 pm, Romain Guy  wrote:
>> It is a known issue.
>>
>>
>>
>>
>>
>> On Tue, Jan 6, 2009 at 2:17 PM, Sundog  wrote:
>>
>> > That category is getting a little crowded for my tastes.
>>
>> > On Jan 6, 3:15 pm, loty  wrote:
>> >> I've seen this one too and gave up.
>> >> I guess we'll have to file into "Nobody knows nobody cares" category
>>
>> >> On Jan 6, 4:06 pm, Sundog  wrote:
>>
>> >> > We'll settle for a "No, you dummies, you're doing it wrong!"
>>
>> >> > On Jan 6, 8:19 am, Sundog  wrote:
>>
>> >> > > I posted about exactly this a couple of days ago with no responses.
>> >> > > Now with your report I'm beginning to think it's a real bug.
>>
>> >> > > Anyone at Google care to toss in an opinion?
>>
>> >> > > On Jan 6, 7:25 am, rsung  wrote:
>>
>> >> > > > Anyone??? Is this a known bug?
>>
>> >> > > > On Dec 21 2008, 11:00 pm, PKC  wrote:
>>
>> >> > > > > I'm trying to make a simple set of animationsrepeat.  Based on
>> >> > > > > documentation, it appears that below should work but the animation
>> >> > > > > runs once and does notrepeat.  Any pointers would be appreciated.
>>
>> >> > > > > Thanks
>>
>> >> > > > > public void onCreate(Bundle savedInstanceState) {
>> >> > > > > super.onCreate(savedInstanceState);
>> >> > > > > setContentView(R.layout.main);
>>
>> >> > > > > TextView animWindow = 
>> >> > > > > (TextView)findViewById(R.id.anim_text);
>>
>> >> > > > >AnimationSetrootSet = newAnimationSet(true);
>> >> > > > > rootSet.setInterpolator(new AccelerateInterpolator());
>>
>> >> > > > > // Create and add first child, a motion animation.
>> >> > > > > TranslateAnimation trans1 = new TranslateAnimation(0, 30, 
>> >> > > > > 0,
>> >> > > > > 0);
>> >> > > > > trans1.setStartOffset(0);
>> >> > > > > trans1.setDuration(800);
>> >> > > > > trans1.setFillAfter(true);
>> >> > > > > rootSet.addAnimation(trans1);
>>
>> >> > > > > // Add a final motion animation to the root set.
>> >> > > > > TranslateAnimation trans2 = new TranslateAnimation(0, 0, 
>> >> > > > > 0,
>> >> > > > > 100);
>> >> > > > > trans2.setFillAfter(true);
>> >> > > > > trans2.setDuration(800);
>> >> > > > > trans2.setStartOffset(800);
>> >> > > > > rootSet.addAnimation(trans2);
>>
>> >> > > > > rootSet.setRepeatCount(Animation.INFINITE);
>> >> > > > > rootSet.setRepeatMode(Animation.RESTART);
>>
>> >> > > > > // Start the animation.
>> >> > > > > animWindow.startAnimation(rootSet);
>> >> > > > > }- Hide quoted text -
>>
>> >> > > > - Show quoted text -- Hide quoted text -
>>
>> >> > > - Show quoted text -- Hide quoted text -
>>
>> >> - Show quoted text -
>>
>> --
>> 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- Hide quoted text -
>>
>> - Show quoted text -
> >
>



-- 
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: Repeating AnimationSet

2009-01-06 Thread Sundog

Ahh, thank you. I knew "the answer was out there".

So much for my cool animation...

On Jan 6, 3:20 pm, Romain Guy  wrote:
> It is a known issue.
>
>
>
>
>
> On Tue, Jan 6, 2009 at 2:17 PM, Sundog  wrote:
>
> > That category is getting a little crowded for my tastes.
>
> > On Jan 6, 3:15 pm, loty  wrote:
> >> I've seen this one too and gave up.
> >> I guess we'll have to file into "Nobody knows nobody cares" category
>
> >> On Jan 6, 4:06 pm, Sundog  wrote:
>
> >> > We'll settle for a "No, you dummies, you're doing it wrong!"
>
> >> > On Jan 6, 8:19 am, Sundog  wrote:
>
> >> > > I posted about exactly this a couple of days ago with no responses.
> >> > > Now with your report I'm beginning to think it's a real bug.
>
> >> > > Anyone at Google care to toss in an opinion?
>
> >> > > On Jan 6, 7:25 am, rsung  wrote:
>
> >> > > > Anyone??? Is this a known bug?
>
> >> > > > On Dec 21 2008, 11:00 pm, PKC  wrote:
>
> >> > > > > I'm trying to make a simple set of animationsrepeat.  Based on
> >> > > > > documentation, it appears that below should work but the animation
> >> > > > > runs once and does notrepeat.  Any pointers would be appreciated.
>
> >> > > > > Thanks
>
> >> > > > >     public void onCreate(Bundle savedInstanceState) {
> >> > > > >         super.onCreate(savedInstanceState);
> >> > > > >         setContentView(R.layout.main);
>
> >> > > > >         TextView animWindow = 
> >> > > > > (TextView)findViewById(R.id.anim_text);
>
> >> > > > >        AnimationSetrootSet = newAnimationSet(true);
> >> > > > >         rootSet.setInterpolator(new AccelerateInterpolator());
>
> >> > > > >         // Create and add first child, a motion animation.
> >> > > > >         TranslateAnimation trans1 = new TranslateAnimation(0, 30, 
> >> > > > > 0,
> >> > > > > 0);
> >> > > > >         trans1.setStartOffset(0);
> >> > > > >         trans1.setDuration(800);
> >> > > > >         trans1.setFillAfter(true);
> >> > > > >         rootSet.addAnimation(trans1);
>
> >> > > > >         // Add a final motion animation to the root set.
> >> > > > >         TranslateAnimation trans2 = new TranslateAnimation(0, 0, 0,
> >> > > > > 100);
> >> > > > >         trans2.setFillAfter(true);
> >> > > > >         trans2.setDuration(800);
> >> > > > >         trans2.setStartOffset(800);
> >> > > > >         rootSet.addAnimation(trans2);
>
> >> > > > >         rootSet.setRepeatCount(Animation.INFINITE);
> >> > > > >         rootSet.setRepeatMode(Animation.RESTART);
>
> >> > > > >         // Start the animation.
> >> > > > >         animWindow.startAnimation(rootSet);
> >> > > > >     }- Hide quoted text -
>
> >> > > > - Show quoted text -- Hide quoted text -
>
> >> > > - Show quoted text -- Hide quoted text -
>
> >> - Show quoted text -
>
> --
> 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- 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: Screen on/off Intents Can't Be Declared in AndroidManifest?

2009-01-06 Thread ArtJin

Got it thanks.

To answer your question let me describe what I am trying to do.
I have an AlarmManager that runs a service, which connects to web
server and gets some data.
Everything works fine, but battery drains quickly since AlarmManager
stops running only when CPU stops.
So I wanted to reschedule the AlarmManager according to screen's on/
off situation, since I do not really need it running when user is not
looking at the screen.
I guess I need to re-think the design approach.
What would you recommend?
Thanks again for quick response! :-)


On Jan 6, 5:02 pm, "Dianne Hackborn"  wrote:
> These are currently only delivered to receivers actively registered with
> registerReceiver().
>
> On a side note...  why are you running your receivers in a separate
> process??
>
>
>
> On Tue, Jan 6, 2009 at 1:57 PM, ArtJin  wrote:
>
> > Hello everybody.
> > Carter, did you find out what was the problem?
> > I am having exact same issue.
> > the receivers are installed with no problems, however they do not
> > receive SCREEN_ON or SCREEN_OFF broadcasts for some reason, unless I
> > do everything programatically.
> > Here is the receiver snippet from my manifest:
> >  > android:process=":remote">
> >  
> >   
> >  
> > 
> >  > android:process=":remote">
> >  
> >
> >  
> > 
>
> > Ideas are appreciated!
> > Thanks :-)
>
> > On Dec 4 2008, 1:22 pm, Carter  wrote:
> > > I'm trying to detect when the phone's screen turns on and off with the
> > > SCREEN_ON andSCREEN_OFFIntents.  A BroadcastReceiver declared in the
> > > AndroidManifest doesn't work with these screen on/off Intents, but
> > > instantiating a BroadcastReceiver programatically at runtime does
> > > work.
>
> > > As far as troubleshooting goes: my AndroidManifest BroadcastReceiver
> > > is properly receiving other Intents, such as for phone boot.  There is
> > > no helpful information in LogCat.  And this isn't a permissions issue,
> > > since it works when declared programatically.
>
> > > There are no explanations in the JavaDocs (e.g. its not like the
> > > battery changed Intent which cannot be declared in the Manifest),
> > > although when searching through the Android source I discovered that
> > > none of the Android OS services declare interest this particular
> > > Intent in XML either.
>
> > > So any ideas why I can't declare SCREEN_ON andSCREEN_OFFin the
> > > AndroidManifest?
>
> --
> 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.  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: Repeating AnimationSet

2009-01-06 Thread Romain Guy

It is a known issue.

On Tue, Jan 6, 2009 at 2:17 PM, Sundog  wrote:
>
> That category is getting a little crowded for my tastes.
>
> On Jan 6, 3:15 pm, loty  wrote:
>> I've seen this one too and gave up.
>> I guess we'll have to file into "Nobody knows nobody cares" category
>>
>> On Jan 6, 4:06 pm, Sundog  wrote:
>>
>>
>>
>> > We'll settle for a "No, you dummies, you're doing it wrong!"
>>
>> > On Jan 6, 8:19 am, Sundog  wrote:
>>
>> > > I posted about exactly this a couple of days ago with no responses.
>> > > Now with your report I'm beginning to think it's a real bug.
>>
>> > > Anyone at Google care to toss in an opinion?
>>
>> > > On Jan 6, 7:25 am, rsung  wrote:
>>
>> > > > Anyone??? Is this a known bug?
>>
>> > > > On Dec 21 2008, 11:00 pm, PKC  wrote:
>>
>> > > > > I'm trying to make a simple set of animationsrepeat.  Based on
>> > > > > documentation, it appears that below should work but the animation
>> > > > > runs once and does notrepeat.  Any pointers would be appreciated.
>>
>> > > > > Thanks
>>
>> > > > > public void onCreate(Bundle savedInstanceState) {
>> > > > > super.onCreate(savedInstanceState);
>> > > > > setContentView(R.layout.main);
>>
>> > > > > TextView animWindow = (TextView)findViewById(R.id.anim_text);
>>
>> > > > >AnimationSetrootSet = newAnimationSet(true);
>> > > > > rootSet.setInterpolator(new AccelerateInterpolator());
>>
>> > > > > // Create and add first child, a motion animation.
>> > > > > TranslateAnimation trans1 = new TranslateAnimation(0, 30, 0,
>> > > > > 0);
>> > > > > trans1.setStartOffset(0);
>> > > > > trans1.setDuration(800);
>> > > > > trans1.setFillAfter(true);
>> > > > > rootSet.addAnimation(trans1);
>>
>> > > > > // Add a final motion animation to the root set.
>> > > > > TranslateAnimation trans2 = new TranslateAnimation(0, 0, 0,
>> > > > > 100);
>> > > > > trans2.setFillAfter(true);
>> > > > > trans2.setDuration(800);
>> > > > > trans2.setStartOffset(800);
>> > > > > rootSet.addAnimation(trans2);
>>
>> > > > > rootSet.setRepeatCount(Animation.INFINITE);
>> > > > > rootSet.setRepeatMode(Animation.RESTART);
>>
>> > > > > // Start the animation.
>> > > > > animWindow.startAnimation(rootSet);
>> > > > > }- Hide quoted text -
>>
>> > > > - Show quoted text -- Hide quoted text -
>>
>> > > - Show quoted text -- Hide quoted text -
>>
>> - Show quoted text -
> >
>



-- 
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: Memory leak in BitmapFactory/Gallery?

2009-01-06 Thread fadden

On Jan 5, 1:59 pm, EboMike  wrote:
> This problem seems to be particularly prevalent with exceptions - I
> wrote a test app that throws an exception every 10ms and it OOMs very
> quickly (and you can see the memory pile up), but also with files
> (which was what 6418 was about in the first place -- I called close()
> on a BufferedInputStream, and that kind of closed a big leak when
> using the debugger).

Exceptions could be handled better in the VM, though it's a little
awkward to do so.  The code is structured such that the JDWP support
is isolated from the bulk of the VM; only dalvik/vm/Debugger.c talks
to both sides.  As a result, we end up adding the exception to the
"seen objects" list before passing it into the "is this exception
interesting" function, so we hold on to it even if the exception isn't
actually passed up to the debugger.

There's no trivial fix for this, though pre-flighting might do the
trick.  I'd prefer to fix it more generally, treating the debugger
"seen" list as weak references, but that's more work.

Of course, the flip side of this is that apps shouldn't be throwing so
many exceptions that it has a noticeable effect on memory usage.  Not
always avoidable, of course.

I'm not sure what the issue with the BufferedInputStream would be.
They (like graphics) may have memory usage tied to a finalizer, which
means you need to gc-finalize-gc before memory is actually released.
The finalizer thread does run even when the app is being debugged, so
that shouldn't cause a problem in and of itself.  It *is* possible to
OOM when memory is pending finalization, which might explain why you
avoided an OOM with an explicit System.gc() call.  The GC does not
currently wait for the finalizer thread, which at best it could do for
a limited time period (you have to be careful since the finalizer
thread could be waiting on a lock held by the thread doing the GC).

--~--~-~--~~~---~--~~
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: Repeating AnimationSet

2009-01-06 Thread Sundog

That category is getting a little crowded for my tastes.

On Jan 6, 3:15 pm, loty  wrote:
> I've seen this one too and gave up.
> I guess we'll have to file into "Nobody knows nobody cares" category
>
> On Jan 6, 4:06 pm, Sundog  wrote:
>
>
>
> > We'll settle for a "No, you dummies, you're doing it wrong!"
>
> > On Jan 6, 8:19 am, Sundog  wrote:
>
> > > I posted about exactly this a couple of days ago with no responses.
> > > Now with your report I'm beginning to think it's a real bug.
>
> > > Anyone at Google care to toss in an opinion?
>
> > > On Jan 6, 7:25 am, rsung  wrote:
>
> > > > Anyone??? Is this a known bug?
>
> > > > On Dec 21 2008, 11:00 pm, PKC  wrote:
>
> > > > > I'm trying to make a simple set of animationsrepeat.  Based on
> > > > > documentation, it appears that below should work but the animation
> > > > > runs once and does notrepeat.  Any pointers would be appreciated.
>
> > > > > Thanks
>
> > > > >     public void onCreate(Bundle savedInstanceState) {
> > > > >         super.onCreate(savedInstanceState);
> > > > >         setContentView(R.layout.main);
>
> > > > >         TextView animWindow = (TextView)findViewById(R.id.anim_text);
>
> > > > >        AnimationSetrootSet = newAnimationSet(true);
> > > > >         rootSet.setInterpolator(new AccelerateInterpolator());
>
> > > > >         // Create and add first child, a motion animation.
> > > > >         TranslateAnimation trans1 = new TranslateAnimation(0, 30, 0,
> > > > > 0);
> > > > >         trans1.setStartOffset(0);
> > > > >         trans1.setDuration(800);
> > > > >         trans1.setFillAfter(true);
> > > > >         rootSet.addAnimation(trans1);
>
> > > > >         // Add a final motion animation to the root set.
> > > > >         TranslateAnimation trans2 = new TranslateAnimation(0, 0, 0,
> > > > > 100);
> > > > >         trans2.setFillAfter(true);
> > > > >         trans2.setDuration(800);
> > > > >         trans2.setStartOffset(800);
> > > > >         rootSet.addAnimation(trans2);
>
> > > > >         rootSet.setRepeatCount(Animation.INFINITE);
> > > > >         rootSet.setRepeatMode(Animation.RESTART);
>
> > > > >         // Start the animation.
> > > > >         animWindow.startAnimation(rootSet);
> > > > >     }- Hide quoted text -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- 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: should android:id be unique?

2009-01-06 Thread Dianne Hackborn
It only needs to be unique within a view hierarchy (or sub-view hierarchy)
in which you are looking for the ID.

On Tue, Jan 6, 2009 at 2:10 PM, skink  wrote:

>
> hi,
>
> do you know whether android:id for one R class have to be unique (for
> example defined in different layout.*.xml files)?
>
> if yes, why ADT doesn't check this?
>
> regards,
> pskink
> >
>


-- 
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.  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: Repeating AnimationSet

2009-01-06 Thread loty

I've seen this one too and gave up.
I guess we'll have to file into "Nobody knows nobody cares" category

On Jan 6, 4:06 pm, Sundog  wrote:
> We'll settle for a "No, you dummies, you're doing it wrong!"
>
> On Jan 6, 8:19 am, Sundog  wrote:
>
> > I posted about exactly this a couple of days ago with no responses.
> > Now with your report I'm beginning to think it's a real bug.
>
> > Anyone at Google care to toss in an opinion?
>
> > On Jan 6, 7:25 am, rsung  wrote:
>
> > > Anyone??? Is this a known bug?
>
> > > On Dec 21 2008, 11:00 pm, PKC  wrote:
>
> > > > I'm trying to make a simple set of animationsrepeat.  Based on
> > > > documentation, it appears that below should work but the animation
> > > > runs once and does notrepeat.  Any pointers would be appreciated.
>
> > > > Thanks
>
> > > >     public void onCreate(Bundle savedInstanceState) {
> > > >         super.onCreate(savedInstanceState);
> > > >         setContentView(R.layout.main);
>
> > > >         TextView animWindow = (TextView)findViewById(R.id.anim_text);
>
> > > >        AnimationSetrootSet = newAnimationSet(true);
> > > >         rootSet.setInterpolator(new AccelerateInterpolator());
>
> > > >         // Create and add first child, a motion animation.
> > > >         TranslateAnimation trans1 = new TranslateAnimation(0, 30, 0,
> > > > 0);
> > > >         trans1.setStartOffset(0);
> > > >         trans1.setDuration(800);
> > > >         trans1.setFillAfter(true);
> > > >         rootSet.addAnimation(trans1);
>
> > > >         // Add a final motion animation to the root set.
> > > >         TranslateAnimation trans2 = new TranslateAnimation(0, 0, 0,
> > > > 100);
> > > >         trans2.setFillAfter(true);
> > > >         trans2.setDuration(800);
> > > >         trans2.setStartOffset(800);
> > > >         rootSet.addAnimation(trans2);
>
> > > >         rootSet.setRepeatCount(Animation.INFINITE);
> > > >         rootSet.setRepeatMode(Animation.RESTART);
>
> > > >         // Start the animation.
> > > >         animWindow.startAnimation(rootSet);
> > > >     }- Hide quoted text -
>
> > > - Show quoted text -- 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] should android:id be unique?

2009-01-06 Thread skink

hi,

do you know whether android:id for one R class have to be unique (for
example defined in different layout.*.xml files)?

if yes, why ADT doesn't check this?

regards,
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
-~--~~~~--~~--~--~---



[android-developers] Re: Screen on/off Intents Can't Be Declared in AndroidManifest?

2009-01-06 Thread Dianne Hackborn
These are currently only delivered to receivers actively registered with
registerReceiver().

On a side note...  why are you running your receivers in a separate
process??

On Tue, Jan 6, 2009 at 1:57 PM, ArtJin  wrote:

>
> Hello everybody.
> Carter, did you find out what was the problem?
> I am having exact same issue.
> the receivers are installed with no problems, however they do not
> receive SCREEN_ON or SCREEN_OFF broadcasts for some reason, unless I
> do everything programatically.
> Here is the receiver snippet from my manifest:
>  android:process=":remote">
>  
>   
>  
> 
>  android:process=":remote">
>  
>
>  
> 
>
> Ideas are appreciated!
> Thanks :-)
>
>
> On Dec 4 2008, 1:22 pm, Carter  wrote:
> > I'm trying to detect when the phone's screen turns on and off with the
> > SCREEN_ON andSCREEN_OFFIntents.  A BroadcastReceiver declared in the
> > AndroidManifest doesn't work with these screen on/off Intents, but
> > instantiating a BroadcastReceiver programatically at runtime does
> > work.
> >
> > As far as troubleshooting goes: my AndroidManifest BroadcastReceiver
> > is properly receiving other Intents, such as for phone boot.  There is
> > no helpful information in LogCat.  And this isn't a permissions issue,
> > since it works when declared programatically.
> >
> > There are no explanations in the JavaDocs (e.g. its not like the
> > battery changed Intent which cannot be declared in the Manifest),
> > although when searching through the Android source I discovered that
> > none of the Android OS services declare interest this particular
> > Intent in XML either.
> >
> > So any ideas why I can't declare SCREEN_ON andSCREEN_OFFin the
> > AndroidManifest?
> >
>


-- 
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.  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: Screen on/off Intents Can't Be Declared in AndroidManifest?

2009-01-06 Thread ArtJin

Hello everybody.
Carter, did you find out what was the problem?
I am having exact same issue.
the receivers are installed with no problems, however they do not
receive SCREEN_ON or SCREEN_OFF broadcasts for some reason, unless I
do everything programatically.
Here is the receiver snippet from my manifest:

 
   
 


  

  


Ideas are appreciated!
Thanks :-)


On Dec 4 2008, 1:22 pm, Carter  wrote:
> I'm trying to detect when the phone's screen turns on and off with the
> SCREEN_ON andSCREEN_OFFIntents.  A BroadcastReceiver declared in the
> AndroidManifest doesn't work with these screen on/off Intents, but
> instantiating a BroadcastReceiver programatically at runtime does
> work.
>
> As far as troubleshooting goes: my AndroidManifest BroadcastReceiver
> is properly receiving other Intents, such as for phone boot.  There is
> no helpful information in LogCat.  And this isn't a permissions issue,
> since it works when declared programatically.
>
> There are no explanations in the JavaDocs (e.g. its not like the
> battery changed Intent which cannot be declared in the Manifest),
> although when searching through the Android source I discovered that
> none of the Android OS services declare interest this particular
> Intent in XML either.
>
> So any ideas why I can't declare SCREEN_ON andSCREEN_OFFin the
> AndroidManifest?
--~--~-~--~~~---~--~~
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: Please Google: clean racist comment on Android Market

2009-01-06 Thread Sundog

IMHO it is well past time for Google to admit that the comments are an
idea that was not well thought out, and disable the feature entirely.
The comments feature, unlike the ratings, has no value whatsoever,
especially unmoderated.

On Jan 6, 2:13 pm, arnouf  wrote:
> Hello,
>
> I posted yesterday a new app (DiceDroid on Android Market) and I don't
> why a racist discussion is running through the comments feature.
>
> Please Google, could you delete this racist comments!!
>
> You can contact me at arnaud.farine AROBAS expertiseandroid.com
>
> Thanks a lot for your support
>
> Arnaud
--~--~-~--~~~---~--~~
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 can BroadcastReceiver do managedquery?

2009-01-06 Thread Dianne Hackborn
It makes no sense to do a managed query in a BroadcastReceiver, since a
managed query is all about helping you manage the query with an activity's
lifecycle in a BroadcastReceiver is not an activity.  The lifecycle of a
receive is very simple: its function is called, that function does stuff, it
returns, and that is the end of that.  Thus you need to do all of your work
in that function (which for a query can only be to just directly do a
query), and if you need something to continue running outside of it you will
need to do something like start a service.

On Tue, Jan 6, 2009 at 12:54 PM, CJ  wrote:

>
> it seems to do a query, i have to have an activity. but, what i have
> for now is a BroadcastReceiver. how should i redesign my application?
> because i did not intend to start any activity in my
> BroadcastReceiver.
> thanks
>
> >
>


-- 
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.  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] Please Google: clean racist comment on Android Market

2009-01-06 Thread arnouf

Hello,

I posted yesterday a new app (DiceDroid on Android Market) and I don't
why a racist discussion is running through the comments feature.

Please Google, could you delete this racist comments!!

You can contact me at arnaud.farine AROBAS expertiseandroid.com

Thanks a lot for your support

Arnaud
--~--~-~--~~~---~--~~
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: Repeating AnimationSet

2009-01-06 Thread Sundog

We'll settle for a "No, you dummies, you're doing it wrong!"

On Jan 6, 8:19 am, Sundog  wrote:
> I posted about exactly this a couple of days ago with no responses.
> Now with your report I'm beginning to think it's a real bug.
>
> Anyone at Google care to toss in an opinion?
>
> On Jan 6, 7:25 am, rsung  wrote:
>
>
>
> > Anyone??? Is this a known bug?
>
> > On Dec 21 2008, 11:00 pm, PKC  wrote:
>
> > > I'm trying to make a simple set of animationsrepeat.  Based on
> > > documentation, it appears that below should work but the animation
> > > runs once and does notrepeat.  Any pointers would be appreciated.
>
> > > Thanks
>
> > >     public void onCreate(Bundle savedInstanceState) {
> > >         super.onCreate(savedInstanceState);
> > >         setContentView(R.layout.main);
>
> > >         TextView animWindow = (TextView)findViewById(R.id.anim_text);
>
> > >        AnimationSetrootSet = newAnimationSet(true);
> > >         rootSet.setInterpolator(new AccelerateInterpolator());
>
> > >         // Create and add first child, a motion animation.
> > >         TranslateAnimation trans1 = new TranslateAnimation(0, 30, 0,
> > > 0);
> > >         trans1.setStartOffset(0);
> > >         trans1.setDuration(800);
> > >         trans1.setFillAfter(true);
> > >         rootSet.addAnimation(trans1);
>
> > >         // Add a final motion animation to the root set.
> > >         TranslateAnimation trans2 = new TranslateAnimation(0, 0, 0,
> > > 100);
> > >         trans2.setFillAfter(true);
> > >         trans2.setDuration(800);
> > >         trans2.setStartOffset(800);
> > >         rootSet.addAnimation(trans2);
>
> > >         rootSet.setRepeatCount(Animation.INFINITE);
> > >         rootSet.setRepeatMode(Animation.RESTART);
>
> > >         // Start the animation.
> > >         animWindow.startAnimation(rootSet);
> > >     }- Hide quoted text -
>
> > - Show quoted text -- 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] how can BroadcastReceiver do managedquery?

2009-01-06 Thread CJ

it seems to do a query, i have to have an activity. but, what i have
for now is a BroadcastReceiver. how should i redesign my application?
because i did not intend to start any activity in my
BroadcastReceiver.
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] Receive email permission?

2009-01-06 Thread Matt Hall

Hi All,

I'm looking for a permission or something similar to the SMS
equivalent java.lang.String RECEIVE_SMS. I'd like to be able to
process incoming emails in my app and am wondering if there's a way to
do that.

Thanks very much,
Matt
--~--~-~--~~~---~--~~
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: stopSelf() question

2009-01-06 Thread Dianne Hackborn
Look at what your main thread is doing when the ANR happens.  It may not be
directly related to the stopSelf() at all -- you may have some code in a
completely different location that is blocking the main thread, and the
stopSelf() call just happens to cause the system to try to interact with
your app, find it isn't responding, and result in an ANR.

On Tue, Jan 6, 2009 at 11:03 AM, jsm  wrote:

>
> I have two doubts
> - When I call stopself() in the service, it raises an ANR (Force close
> or Wait)
> I am calling this in a seperate thread as shown in my service:
> ...
>quitServer(){
>Thread thrm = new Thread(null, mTask, "MYService");
>thrm.start();
>
>}
>
>Runnable mTask = new Runnable() {
>public void run() {
>disconnectServer();
>stopSelf();
>}
>};
> ...
> I am pretty sure there are no other activity going on while i am
> trying to quit because I can see from the server it has successfully
> quit.
> Any help or suggestion would be appreciated.
>
>
>
>
> >
>


-- 
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.  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: Resizing camera preview dimensions

2009-01-06 Thread blindfold

The G1 ignores whatever preview dimensions you throw at its camera.

http://android.git.kernel.org/?p=platform/hardware/msm7k.git;a=blob_plain;f=libcamera/QualcommCameraHardware.cpp

Regards

On Jan 6, 6:07 pm, Robert  wrote:
> Is anyone aware of how to lower the width and height size that is
> returned by previewCallback for Camera? Right now it returns an image
> with dimensions 480x320 and I would like to reduce that by at least
> half. Any suggestions?
>
> Robert

--~--~-~--~~~---~--~~
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] stopSelf() question

2009-01-06 Thread jsm

I have two doubts
- When I call stopself() in the service, it raises an ANR (Force close
or Wait)
I am calling this in a seperate thread as shown in my service:
...
quitServer(){
Thread thrm = new Thread(null, mTask, "MYService");
thrm.start();

}

Runnable mTask = new Runnable() {
public void run() {
disconnectServer();
stopSelf();
}
};
...
I am pretty sure there are no other activity going on while i am
trying to quit because I can see from the server it has successfully
quit.
Any help or suggestion would be appreciated.




--~--~-~--~~~---~--~~
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] What is the best practice for finding friends that have android phones?

2009-01-06 Thread Robert Green

This can be simple or complex, depending on how you look at it.  I'm
sure this will be an issue for _many_ applications going forward but
I'll start with mine because I haven't seen a good answer to this yet.

I'm in development of a multiplayer component to a game and the way it
needs to work is that a user can create a new game and add their
friends to it.  The problem is that the only client is in android so
really the only people that could play it would have to be running
android.

What would be the ideal solution is if somehow the user's contacts had
a flag that indicated if the contact has registered an android phone
to a given email address.  Does that exist?

I'm assuming that nothing like that exists so my solution is to have
each user register for the online service by providing all of their
contact email addresses.  This way, when another user tries to add the
to a game, they can be found by any of their emails.  It's really not
my favorite way of doing this and I think it's not the best experience
for the user but it's the only way I know to guarantee that when users
add their friend to a game by any of the friend's email addresses, it
will work.

I'm sure people will ask - Why not just use their gmail address?  The
answer is because there are many people like me who use gmail but do
not have that listed as their primary email and so my friends with
android handsets will probably be trying to add me by my non-gmail
email address.  I would have to register both so that people can add
me by wither.

My other issue is authentication.  I'm going to ask the user to
provide a password so that others can not connect as them to the game
service.  What would be really nice is if I could somehow just
authenticate them against google to know that they really are who they
say they are.  I know there is a google auth service of some sort but
is there any way to pass-through the credentials from android to it?
Basically I don't think it's good to have users enter their google
account and password info.  This is where a token-based thing would be
very nice.

My multiplayer game server is a server I am hosting myself.  It's Ruby
on Rails with RJB (Ruby Java Bridge) to run Java libraries.

Solutions?
--~--~-~--~~~---~--~~
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 on MediaStore.Images.Media.EXTERNAL_CONTENT_URI

2009-01-06 Thread mobilek...@googlemail.com

Hi,

I'm trying to make a simple gallery by accessing the image content of
the SD card.

My question is how do you make thumbnails of the images so that the
device doesn't run out of memory by loading the images in their
original sizes? I have noticed the MINI_THUMB_MAGIC column in the
database, however, I'm not sure how to use the IDs it contains. Any
ideas?

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: Set Window Titile

2009-01-06 Thread mscwd01

Al, you little genius - you just solved a very long running problem in
two short sentences!

Thanks very much!

On Jan 6, 5:54 pm, Al  wrote:
> Is there any particular reason for using getWindow()? I've always used
> setTitle and it always worked for me.
>
> On Jan 6, 5:00 pm,mscwd01 wrote:
>
> > Thanks for your reply Dianne,
>
> > I tried it after the setContentView() as you suggested, however it
> > still has no effect.
>
> > I have no "android:label="@string/app_name" in my activity so at
> > present the title just displays the package location of the Activity
> > i.e. com.test.app.MyActivity.
>
> > Is there any obvious reason why I cannot set the window title?
>
> > Thanks
>
> > On Jan 6, 8:09 am, "Dianne Hackborn"  wrote:
>
> > > Try doing it after setContentView().
>
> > > On Mon, Jan 5, 2009 at 6:47 AM,mscwd01 wrote:
>
> > > > How do you set/change the title of the Activities window? I am
> > > > currently using this code but it has absolutley no effect:
>
> > > > @Override
> > > > public void onCreate(Bundle savedInstanceState) {
>
> > > >        super.onCreate(savedInstanceState);
>
> > > >        // Set Window Title
> > > >        getWindow().setTitle("Title of window");
>
> > > >        setContentView(R.layout.main_layout);
>
> > > >       ...
> > > > }
>
> > > > Thanks
>
> > > --
> > > 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.  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: AlarmManager.ELAPSED_REALTIME keeps running even when screen is asleep

2009-01-06 Thread ArtJin

This solves the problem
Thanks a lot!
--~--~-~--~~~---~--~~
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: Can't get keyboard events: "no keyboard for id 0"

2009-01-06 Thread Dianne Hackborn
That is a normal message.

On Tue, Jan 6, 2009 at 7:52 AM, LeegleechN  wrote:

>
> I have a somewhat complex view hierarchy, with the focus inside of a
> popup window. Navigation inside of the popup window works fine using
> the d-pad and enter, the standard navigational controls. Now, I want
> to intercept keypresses happening while the popup window has focus.
> However, I've tried every method I could think of, including
> overriding onKeyDown, adding onKeyListeners, and overriding
> onKeyDispatch. I've done it on the overall popup window content view,
> individual components of the content view, and in the Activity. In all
> cases, they key press seems to be silently eaten, with no obvious
> errors in Logcat. The only hint is that, the first time I press a key,
> the following warning is printed to Logcat:
>
> 01-06 09:38:09.260: WARN/KeyCharacterMap(312): No keyboard for id 0
> 01-06 09:38:09.260: WARN/KeyCharacterMap(312): Using default keymap: /
> system/usr/keychars/qwerty.kcm.bin
>
> It only happens once, and it's the only indication anything is
> happening with respect to key events. Can anyone help me get those key
> events?
>
> Nisarg Kothari
> http://www.stelluxstudios.com/
> >
>


-- 
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.  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: AlarmManager.ELAPSED_REALTIME keeps running even when screen is asleep

2009-01-06 Thread ArtJin

Thank you for clarification Dianne.
I am trying to further optimize the app.
For example, if screen is off then the app does not really need to
connect to the server, but as soon as it turns on it should.
With this logic, I have no problem with AlarmManager working while CPU
is running, as long as I have this condition in the code.
Honestly, I am not sure if this is correct approach...
Related question would be how does my app know if screen is on or
off? :-) I do not see anything in PowerManager that allows this.
Any ideas would be greatly appreciated and thanks again Dianne!

--~--~-~--~~~---~--~~
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: Meaning of numbers on Android Market Listing

2009-01-06 Thread Dianne Hackborn
The market app only keeps track of applications installed through it.

On Tue, Jan 6, 2009 at 8:56 AM, info.sktechnol...@gmail.com <
info.sktechnol...@gmail.com> wrote:

>
> Does this mean that google keeps track of when you uninstall apps?
> Does it also do this for non-market apps?
> What other info is being kept?
>
> On Jan 6, 9:58 am, Sundog  wrote:
> > Never seen any documentation on this, but I thought it was obvious;
> > the number is the number of comments, and an "active" installation is
> > one that hasn't been uninstalled.
> >
> > On Jan 6, 5:39 am, "info.sktechnol...@gmail.com"
> >
> >  wrote:
> > > What is the meaning of the three numbers given for each app in the
> > > developer market listing?
> > > There is a number in paren right before the stars.
> > > There are also numbers for total and active installs.
> > > What makes an install active?
> >
>


-- 
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.  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: AlarmManager.ELAPSED_REALTIME keeps running even when screen is asleep

2009-01-06 Thread Dianne Hackborn
A broadcast is sent when the screen goes on or off:

http://code.google.com/android/reference/android/content/Intent.html#ACTION_SCREEN_OFF

Also the foreground activity only stays resumed while the screen is on.

You should be able to use these to schedule your alarm during the desired
time.

On Tue, Jan 6, 2009 at 9:55 AM, ArtJin  wrote:

>
> Thank you for clarification Dianne.
> I am trying to further optimize the app.
> For example, if screen is off then the app does not really need to
> connect to the server, but as soon as it turns on it should.
> With this logic, I have no problem with AlarmManager working while CPU
> is running, as long as I have this condition in the code.
> Honestly, I am not sure if this is correct approach...
> Related question would be how does my app know if screen is on or
> off? :-) I do not see anything in PowerManager that allows this.
> Any ideas would be greatly appreciated and thanks again Dianne!
>
> >
>


-- 
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.  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: Set Window Titile

2009-01-06 Thread Al

Is there any particular reason for using getWindow()? I've always used
setTitle and it always worked for me.

On Jan 6, 5:00 pm, mscwd01  wrote:
> Thanks for your reply Dianne,
>
> I tried it after the setContentView() as you suggested, however it
> still has no effect.
>
> I have no "android:label="@string/app_name" in my activity so at
> present the title just displays the package location of the Activity
> i.e. com.test.app.MyActivity.
>
> Is there any obvious reason why I cannot set the window title?
>
> Thanks
>
> On Jan 6, 8:09 am, "Dianne Hackborn"  wrote:
>
> > Try doing it after setContentView().
>
> > On Mon, Jan 5, 2009 at 6:47 AM, mscwd01  wrote:
>
> > > How do you set/change the title of the Activities window? I am
> > > currently using this code but it has absolutley no effect:
>
> > > @Override
> > > public void onCreate(Bundle savedInstanceState) {
>
> > >        super.onCreate(savedInstanceState);
>
> > >        // Set Window Title
> > >        getWindow().setTitle("Title of window");
>
> > >        setContentView(R.layout.main_layout);
>
> > >       ...
> > > }
>
> > > Thanks
>
> > --
> > 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.  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: button response is slow on GPhone

2009-01-06 Thread cindy


In Java, there is some design pattern called observe. User can send
request, when response is back, it will update UI. Does android has
similar functionality, but UI is designed in XML and loaded in in
onCreate() function, I need to get data in onCreate() function. How
can I do it?Could you post an sample code on how to handle? Thanks!


On Jan 5, 11:46 pm, "Dianne Hackborn"  wrote:
> It sounds like you are doing blocking/long-running operations on the main
> thread.  These should be done in another thread so that the main thread can
> remain responsive to handle input events and draw your UI.
>
>
>
> On Mon, Jan 5, 2009 at 10:27 PM, cindy  wrote:
>
> > Hi Mark,
>
> > I have problem with other applications. For example, if my application
> > has null point, android will popup an "force close" dialog, sometime I
> > couldn't click on "force click" button. I have to use track ball to
> > select the button.
>
> > But I don't have problem with "Contact" application which is a default
> > application. When I use it to dial an phone number, it response very
> > well without any delay. Are those numbers "image button"? All those
> > numbers will be highlighted when I use track ball.
>
> > In my application, I have imageviews, but they doesn't highlight when
> > I use track ball.
>
> > Any idea on when "Contact" application response very well ?
>
> > I have another question regarding to UI response time. In my login
> > screen, I send request to server, after get login session. I start
> > another activity ( called b)which will send request to retrieve user's
> > emails.  I put  the list email request in onCreate function. But I
> > think it would make UI very slow, since it needs to wait for response
> > back. I put a prgressbar dialog, but it didn't show up at all. Any
> > suggestions?
>
> > Thanks!
>
> > Cindy
>
> > On Jan 5, 11:21 am, Mark Murphy  wrote:
> > > cindy wrote:
> > > > Thank you for the reply. I found that if I use trackball, it always
> > > > work for click. But theresponsefrom hand touch is really not very
> > > > responsible. Have you tried to use G1?
>
> > > Frequently.
>
> > > Let's flip the problem around: do you have problems with other buttons
> > > in other applications, applications you did not write?
>
> > > If you do, perhaps there is some software that is causing your G1 to
> > > behave poorly, such as Locale.
>
> > > If you do not, then we know your hardware is fine and it is something
> > > with your application.
>
> > > --
> > > Mark Murphy (a Commons Guy)http://commonsware.com
>
> > > Android Training on the Ranch! -- Mar 16-20, 2009
> >http://www.bignerdranch.com/schedule.shtml
>
> --
> 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.  All such questions should be posted on public
> fo
rums, 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: Unique problem only for the EXPERTS.

2009-01-06 Thread Ninad

Here you go.. You can get the SMS in the String Array as per below:

#

  Uri uri = Uri.parse("content://sms/inbox");
Cursor c= getContentResolver().query(uri, null, "body like
'%hello%'",
null,null);

startManagingCursor(c);
if(c.getCount() !=0)
{
String[] str = new String[c.getCount()];
int i = 0;
if(c.moveToFirst())
{
do
{

str[i] = (c.getString
(songCursor.getColumnIndex("body"))).toString();

i++;

}while(c.moveToNext());
}
}

#

Once u have the String array str, you can use the substring function
as described by Al to do what u need to do!!

Cheers
Ninad

On Jan 6, 7:17 pm, Al  wrote:
> Hi, once you read the SMS into a String, you can use the
> String.substring() method to find the first character of the sms. E.g,
> if the SMS is "hello" and it is stored in String foo, you would use
> foo.substring(0,1) for the first char.
>
> On Jan 6, 7:33 am, "IPEG Student"  wrote:
>
> > Hi,
>
> > Thanks a lot for the problem, but I'm still unfortunately at square one.
>
> > 
> > Here is what I need:
>
> > Read an SMS into a string variable, then do some string operations.
>
> > For example, how can I find the first character of an SMS?
>
> > Thanks in advance for helping me out.
>
> > ###
>
> > On 1/6/09, Ninad  wrote:
>
> > > Hi..
>
> > > All you need is simple SQL..
>
> > > Modify the Cursor as:
>
> > >            Cursor c= getContentResolver().query(uri, null, "body like
> > > '%hello%'", null,null);
>
> > > Since the query takes the following argument:
>
> > > public final Cursor query(Uri uri, String[] projection, String
> > > selection, String[] selectionArgs, String sortOrder)
> > > .
> > > Arguments:
>
> > > uri:  The URI, using the content:// scheme, for the content to
> > > retrieve.
> > > projection:  A list of which columns to return. Passing null will
> > > return all columns, which is discouraged to prevent reading data from
> > > storage that isn't going to be used.
> > > selection:  A filter declaring which rows to return, formatted as an
> > > SQL WHERE clause (excluding the WHERE itself). Passing null will
> > > return all rows for the given URI.
> > > selectionArgs:  You may include ?s in selection, which will be
> > > replaced by the values from selectionArgs, in the order that they
> > > appear in the selection. The values will be bound as Strings.
> > > sortOrder:  How to order the rows, formatted as an SQL ORDER BY clause
> > > (excluding the ORDER BY itself). Passing null will use the default
> > > sort order, which may be unordered.
>
> > > I hope this solves your simple query for 'experts'!
>
> > > On Jan 6, 9:31 am, ipeg.stud...@gmail.com wrote:
> > > > Hi! am Suman. I have a code by which i can access all the sms from
> > > > inbox. The code is written below.
>
> > > > import android.app.ListActivity;
> > > > import android.content.ContentUris;
> > > > import android.content.Intent;
> > > > import android.database.Cursor;
> > > > import android.net.Uri;
> > > > import android.os.Bundle;
> > > > import android.provider.Contacts.People;
> > > > import android.provider.Telephony.Carriers;
>
> > > > import android.telephony.gsm.SmsMessage;
> > > > import android.view.View;
> > > > import android.widget.ListAdapter;
> > > > import android.widget.ListView;
> > > > import android.widget.SimpleCursorAdapter;
>
> > > > public class niceandroid8 extends ListActivity {
>
> > > >      private ListAdapter mAdapter;
>
> > > >       /** Called when the activity is first created. */
> > > >     @Override
> > > >     public void onCreate(Bundle icicle) {
> > > >         super.onCreate(icicle);
> > > >         Uri uri = Uri.parse("content://sms/inbox");
> > > >         Cursor c = getContentResolver().query(uri, null, null,
> > > >                         null,null);
> > > >        // Cursor c = getContentResolver().query(Carriers.CONTENT_URI,
> > > > null, null, null, null);
> > > >         startManagingCursor(c);
>
> > > >         String[] columns = new String[]{"body"}; // Comment
> > > >         int[] names = new int[]{R.id.row_entry};
>
> > > >         mAdapter = new SimpleCursorAdapter(this, R.layout.con1, c,
> > > > columns, names);
>
> > > >         this.setListAdapter(mAdapter);
> > > >     }
>
> > > > }
>
> > > > xml coding is..
>
> > > > 
>
> > > > http://schemas.android.com/apk/res/
> > > > android"
> > > >     android:orientation="horizontal"
> > > >     android:layout_width="fill_parent"
> > > >     android:layout_height="wrap_content"
>
> > > >  > > >     android:layout_width="wrap_content"
> > > >     android:layout_height="wrap_content"
> 

[android-developers] Resizing camera preview dimensions

2009-01-06 Thread Robert

Is anyone aware of how to lower the width and height size that is
returned by previewCallback for Camera? Right now it returns an image
with dimensions 480x320 and I would like to reduce that by at least
half. Any suggestions?

Robert
--~--~-~--~~~---~--~~
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: Set Window Titile

2009-01-06 Thread mscwd01

Thanks for your reply Dianne,

I tried it after the setContentView() as you suggested, however it
still has no effect.

I have no "android:label="@string/app_name" in my activity so at
present the title just displays the package location of the Activity
i.e. com.test.app.MyActivity.

Is there any obvious reason why I cannot set the window title?

Thanks

On Jan 6, 8:09 am, "Dianne Hackborn"  wrote:
> Try doing it after setContentView().
>
>
>
> On Mon, Jan 5, 2009 at 6:47 AM, mscwd01  wrote:
>
> > How do you set/change the title of the Activities window? I am
> > currently using this code but it has absolutley no effect:
>
> > @Override
> > public void onCreate(Bundle savedInstanceState) {
>
> >        super.onCreate(savedInstanceState);
>
> >        // Set Window Title
> >        getWindow().setTitle("Title of window");
>
> >        setContentView(R.layout.main_layout);
>
> >       ...
> > }
>
> > Thanks
>
> --
> 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.  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: Meaning of numbers on Android Market Listing

2009-01-06 Thread info.sktechnol...@gmail.com

Does this mean that google keeps track of when you uninstall apps?
Does it also do this for non-market apps?
What other info is being kept?

On Jan 6, 9:58 am, Sundog  wrote:
> Never seen any documentation on this, but I thought it was obvious;
> the number is the number of comments, and an "active" installation is
> one that hasn't been uninstalled.
>
> On Jan 6, 5:39 am, "info.sktechnol...@gmail.com"
>
>  wrote:
> > What is the meaning of the three numbers given for each app in the
> > developer market listing?
> > There is a number in paren right before the stars.
> > There are also numbers for total and active installs.
> > What makes an install active?
--~--~-~--~~~---~--~~
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 get focus for a button?

2009-01-06 Thread roland

requestFocus() works for EditText, but not Button, because the Button
is not focusable in touch mode. Call isFocusableInTouchMode() first to
check if a component could be foced.

On 7 nov 2008, 20:01, april  wrote:
> I am using emulator. In onCreate() function, I used
> "button.requestFocus()" . But the button didn'tgetfocus.
>
> Has someone tried togetfocusfor a component? thanks!
>
> April
--~--~-~--~~~---~--~~
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 can I specify message body part in SMS intent?

2009-01-06 Thread devileper

The following intent will launch the sms application with no
destination but with a valid message body.

Intent intent = new Intent(Intent.ACTION_VIEW, "sms:#");
intent.putExtra("sms_body", "The SMS text");
startActivity(intent);

On Dec 18 2008, 1:15 pm, devileper  wrote:
> I have found the approach of using type "vnd.android-dir/mms-sms" only
> works when the DIALER app is closed.  If sent while the dialer app is
> open I receive the following error:
>
> "Connection problem or invalid MMI code."
>
> Anyone have some other ideas?
>
> On Dec 9, 1:56 pm, "devile...@gmail.com"  wrote:
>
> >IntentsendIntent = newIntent(Intent.ACTION_VIEW);
> > sendIntent.putExtra("sms_body", "TheSMStext");
> > sendIntent.setType("vnd.android-dir/mms-sms");
> > startActivity(sendIntent);
>
> > Source:http://jtribe.blogspot.com/2008/12/sending-sms-using-android-intents
>
> > On Oct 28, 12:12 am, sori  wrote:
>
> > > The list of available intents (http://code.google.com/android/
> > > reference/available-intents.html) does not show any info onSMS
> > > scheme.
>
> > > I understand that there is a way to sendSMSmessages directly from my
> > > applications, but I'd like to use existing thread-basedSMS
> > > application in Android G1 by just forwarding call number and message.
>
> > > I found that "sms:number" is a way to post the destination number, but
> > > couldn't
> > > figure out how to specify the messagebody.
> > > I tried many possible options, but all failed.
>
> > > Is this supported?  Any info will be appreciated.
> > > - Sori
--~--~-~--~~~---~--~~
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] Obtain Uri references of .jpgs in MediaStore.Images.Media.EXTERNAL_CONTENT_URI

2009-01-06 Thread mobilek...@googlemail.com

Hi,

I'm wondering how to obtain Uri references of the images stored on my
SD card. I can access information about them by using
MediaStore.Images.Media.EXTERNAL_CONTENT_URI, however, I'm not sure
how to obtain a unique reference for each of them.

Could pls you give me any direction?

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: How to use command Line Arguments in Android??

2009-01-06 Thread alexdonnini

Hello,

Depending on what you want to run from the command line, you might
want to think about trying

Runtime.getRuntime().exec()

e.g.

Runtime.getRuntime().exec("top -t -n 1")

Alex Donnini

On Jan 6, 8:01 am, Mark Murphy  wrote:
> Asif k wrote:
> >   Can you lpease tell me what is the use of
> > android.content.Intent.ACTION_RUN intent???
>
> I do not believe it is presently in use in Android, except perhaps as
> part of a test harness.
>
> > can we run any other application using it??
>
> Not that I am aware of.
>
> To start another application, you need a Uri to something it can handle
> (e.g., ACTION_VIEW on a contact Uri to view the contact, ACTION_EDIT on
> a contact Uri to edit the contact).
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.9 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android 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: Meaning of numbers on Android Market Listing

2009-01-06 Thread Sundog

Never seen any documentation on this, but I thought it was obvious;
the number is the number of comments, and an "active" installation is
one that hasn't been uninstalled.

On Jan 6, 5:39 am, "info.sktechnol...@gmail.com"
 wrote:
> What is the meaning of the three numbers given for each app in the
> developer market listing?
> There is a number in paren right before the stars.
> There are also numbers for total and active installs.
> What makes an install active?
--~--~-~--~~~---~--~~
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] Can't get keyboard events: "no keyboard for id 0"

2009-01-06 Thread LeegleechN

I have a somewhat complex view hierarchy, with the focus inside of a
popup window. Navigation inside of the popup window works fine using
the d-pad and enter, the standard navigational controls. Now, I want
to intercept keypresses happening while the popup window has focus.
However, I've tried every method I could think of, including
overriding onKeyDown, adding onKeyListeners, and overriding
onKeyDispatch. I've done it on the overall popup window content view,
individual components of the content view, and in the Activity. In all
cases, they key press seems to be silently eaten, with no obvious
errors in Logcat. The only hint is that, the first time I press a key,
the following warning is printed to Logcat:

01-06 09:38:09.260: WARN/KeyCharacterMap(312): No keyboard for id 0
01-06 09:38:09.260: WARN/KeyCharacterMap(312): Using default keymap: /
system/usr/keychars/qwerty.kcm.bin

It only happens once, and it's the only indication anything is
happening with respect to key events. Can anyone help me get those key
events?

Nisarg Kothari
http://www.stelluxstudios.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] Re: what's the equivalent class of java.awt.Image

2009-01-06 Thread Mike Reed

Bitmap is correct.

I also think android has awt classes implemented, btw.

On Tue, Jan 6, 2009 at 6:54 AM, Derek  wrote:
>
> I'm trying to re-implement the missing pieces of AWT the app actually
> uses.
> >
>

--~--~-~--~~~---~--~~
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: Stopping a Thread

2009-01-06 Thread Brad Gies


Cyril... thanks... I implemented that yesterday, but I think I came up with
something even more robust while I was testing it, so I thought I'd share
it. 

My thread downloads images from my server, using http, and sends them back
to my UI thread using messages. Sometimes that can take some time, so what I
did was make the Handler a public volatile in the Bitmap thread, wrapped the
message call in a try/except and put in a check for a null Handler around
the call. Then in my UI thread I simply set the Handler in the background
Thread to null, and called the stop method. 

That way, I don't block the UI thread at all, my background thread can
continue without causing problems, and it will quit when it finishes the
next operation. 

My UI thread now looks like this :

  protected void onDestroy()
{
if (bitmapThread != null)
{
bitmapThread.handler = null;
bitmapThread.StopThread();
}

  super.onDestroy();

} 


And my background Thread class looks like this :

class StartBitmapThread 
{
private volatile boolean stopRequested = false;
public volatile Handler handler;
Thread backgroundThread;


public boolean StopThread()
{
   if (backgroundThread.isAlive())
   {
   stopRequested = true;

   return false;
   }
   else
   return true;

}


public StartBitmapThread(Handler handler,
ArrayList> bitmapsToDownload)
{  
this.handler = handler;
this.BitmapsToDownload = bitmapsToDownload;
   
StartThread();
}

private void StartThread()
{
backgroundThread = new Thread(new Runnable()


 }


I'm not 100% convinced this solves every problem (I'm the paranoid/anal
type), but it does seem to work very well.

I would appreciate anyone pointing out any problems with this implementation
:)



Sincerely,
 
Brad Gies
 
 
-
Brad Gies
27415 Greenfield Rd, # 2,
Southfield, MI, USA
48076
www.bgies.com  www.truckerphone.com 
www.EDI-Easy.com  www.pricebunny.com
-
 
Moderation in everything, including abstinence

-Original Message-
From: android-developers@googlegroups.com
[mailto:android-develop...@googlegroups.com] On Behalf Of Cyril Jaquier
Sent: Monday, January 05, 2009 11:25 AM
To: android-developers@googlegroups.com
Subject: [android-developers] Re: Stopping a Thread


Hi Brad,

> Can anyone tell me how to safely stop a thread?
> 

You can't stop a thread but you can let it die. Just return from the 
Thread#run method. Most of the time you will have something like:

public volatile boolean shutdownRequested = false;

public void run() {
   while (!shutdownRequested) {
 // ... do something ...
   }
}

Just set the shutdownRequested variable to true to quit the loop and 
stop the thread.

Regards,

Cyril



--~--~-~--~~~---~--~~
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] Restart application

2009-01-06 Thread goldfish

I need to restart my application after a user changes some
preferences. I want to restart my application as if the user hit home
and relaunched my application. Does anyone know how to do 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: the text font size in pixel != the actual pixels each character occupies?

2009-01-06 Thread David Turner
On Tue, Jan 6, 2009 at 7:09 AM, Xiongzh  wrote:

> Say, my font size of the text in TextView is 20.5px.
> It doesn't mean that every character of the text occupies 20.5px in
> the screen, does it?
>

certainly not, the "text size" is only a notional unit. the actual number of
pixels
covered by the text depend on the font design itself.

For example, try writing a document in a word processor that uses the same
words with three
different fonts (e.g. Arial, Times New Roman and Courier New), and see how
each letter has a
different height, even if they use the same font size.


>
> I'm inheriting android.widget.TextView to implement a TextView which
> text can be scrolled automatically. Just as the behavior of the HTML
> .
>
> I need to know the actual pixels the text occupied to determine how
> far I shall scroll the text.
> However the getTextSize() * getText().length() is much longer than the
> actual length of the text, so I can't make the text re-displayed on
> time.
>
> Thank you in advance for helping me.
>
> BR
> xion...@beijing, China
>
> dirtybea...@hotmail.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] Re: Repeating AnimationSet

2009-01-06 Thread Sundog

I posted about exactly this a couple of days ago with no responses.
Now with your report I'm beginning to think it's a real bug.

Anyone at Google care to toss in an opinion?

On Jan 6, 7:25 am, rsung  wrote:
> Anyone??? Is this a known bug?
>
> On Dec 21 2008, 11:00 pm, PKC  wrote:
>
>
>
> > I'm trying to make a simple set of animationsrepeat.  Based on
> > documentation, it appears that below should work but the animation
> > runs once and does notrepeat.  Any pointers would be appreciated.
>
> > Thanks
>
> >     public void onCreate(Bundle savedInstanceState) {
> >         super.onCreate(savedInstanceState);
> >         setContentView(R.layout.main);
>
> >         TextView animWindow = (TextView)findViewById(R.id.anim_text);
>
> >        AnimationSetrootSet = newAnimationSet(true);
> >         rootSet.setInterpolator(new AccelerateInterpolator());
>
> >         // Create and add first child, a motion animation.
> >         TranslateAnimation trans1 = new TranslateAnimation(0, 30, 0,
> > 0);
> >         trans1.setStartOffset(0);
> >         trans1.setDuration(800);
> >         trans1.setFillAfter(true);
> >         rootSet.addAnimation(trans1);
>
> >         // Add a final motion animation to the root set.
> >         TranslateAnimation trans2 = new TranslateAnimation(0, 0, 0,
> > 100);
> >         trans2.setFillAfter(true);
> >         trans2.setDuration(800);
> >         trans2.setStartOffset(800);
> >         rootSet.addAnimation(trans2);
>
> >         rootSet.setRepeatCount(Animation.INFINITE);
> >         rootSet.setRepeatMode(Animation.RESTART);
>
> >         // Start the animation.
> >         animWindow.startAnimation(rootSet);
> >     }- 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: Get Email log

2009-01-06 Thread ena

if anyone has the solution then please let me know...

On Dec 27 2008, 2:33 pm, ena  wrote:
> Hi All,
> How to get Email log???
> Please help me out...
> Thanks 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] Debugging into the framework source ?

2009-01-06 Thread jarkman

I'm have a frustrating time debugging our app, and I am beginning to
wonder if I'm missing some debugging tricks.

For example, right now, I am adding Filterable to a list view on a
complicated cursor. It mostly works, but under some circumstances I
get a NullPointerException with the stack below.

Obviously, I've done something wrong, but with so little visibility
into the problem it is hard to work out what that is. None of our code
is on the stack, and there are no obvious clues in the logcat window.

My question is, how do I get more information about the problem ? Is
there a straightforward way to get the framework source available in
Eclipse to help with the debugging ? How is anyone else debugging this
kind of issue ?

Here's my stack, by way of illustration:

DalvikVM[localhost:8601]
Thread [<3> main] (Suspended (exception NullPointerException))
CursorFilter.publishResults(CharSequence, 
Filter$FilterResults)
line: 67
Filter$ResultsHandler.handleMessage(Message) line: 253
Filter$ResultsHandler(Handler).dispatchMessage(Message) 
line: 88
Looper.loop() line: 123
ActivityThread.main(String[]) line: 3742
Method.invokeNative(Object, Object[], Class, Class[], 
Class, int,
boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 515
ZygoteInit$MethodAndArgsCaller.run() line: 739
ZygoteInit.main(String[]) line: 497
NativeStart.main(String[]) line: not available [native 
method]

Thread [<13> Binder Thread #2] (Running)

Thread [<11> Binder Thread #1] (Running)

Thread [<15> Filter] (Suspended (exception 
NullPointerException))
Filter$RequestHandler.handleMessage(Message) line: 213
Filter$RequestHandler(Handler).dispatchMessage(Message) 
line: 88
Looper.loop() line: 123
HandlerThread.run() line: 60

Thanks,

Richard

--~--~-~--~~~---~--~~
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] Question on recovering deleted pictures and wallpaper

2009-01-06 Thread Ed Burnette

I USB-mounted my G1 phone and was trying to use Windows to clean up
the /sdcard/dcim/Camera directory in preparation to making a copy.
Unfortunately Windows reported a bunch of read/write errors and then
deleted the whole directory from the sdcard. Any advice on recovering
the lost data (I already looked in the Windows trashcan)?

One of the pictures that I really want to save is set as my current
Android wallpaper. I can still see it even though the original picture
is gone. I poked around a bit but it's not obvious where the home
application keeps that file. I want to make a copy of it. Any ideas?

Thanks,
--Ed
--~--~-~--~~~---~--~~
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: Repeating AnimationSet

2009-01-06 Thread rsung

Anyone??? Is this a known bug?

On Dec 21 2008, 11:00 pm, PKC  wrote:
> I'm trying to make a simple set of animationsrepeat.  Based on
> documentation, it appears that below should work but the animation
> runs once and does notrepeat.  Any pointers would be appreciated.
>
> Thanks
>
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.main);
>
>         TextView animWindow = (TextView)findViewById(R.id.anim_text);
>
>        AnimationSetrootSet = newAnimationSet(true);
>         rootSet.setInterpolator(new AccelerateInterpolator());
>
>         // Create and add first child, a motion animation.
>         TranslateAnimation trans1 = new TranslateAnimation(0, 30, 0,
> 0);
>         trans1.setStartOffset(0);
>         trans1.setDuration(800);
>         trans1.setFillAfter(true);
>         rootSet.addAnimation(trans1);
>
>         // Add a final motion animation to the root set.
>         TranslateAnimation trans2 = new TranslateAnimation(0, 0, 0,
> 100);
>         trans2.setFillAfter(true);
>         trans2.setDuration(800);
>         trans2.setStartOffset(800);
>         rootSet.addAnimation(trans2);
>
>         rootSet.setRepeatCount(Animation.INFINITE);
>         rootSet.setRepeatMode(Animation.RESTART);
>
>         // Start the animation.
>         animWindow.startAnimation(rootSet);
>     }
--~--~-~--~~~---~--~~
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   >