[android-developers] Is there a way to put horizontal and scroll bar both together?

2008-11-11 Thread dilu

Hi
i want to put horizontal and vertical scroll bar both on the same
page .I am able to put the vertical scroll bar ,using scroll view,but
i wanna to put horizontal scrol bar also.so please tell me how to do
it?

Thanks
dilu
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to send email programmatically?

2008-11-11 Thread Sunit Katkar
Ok how would I implement the 'send form'. Do you mean that I should launch a
web browser and use some webmail type of application hosted on a server?
I was thinking about the Email Outbox. How can I put a simple text message
as an email in the Outbox? I know I could do this long long ago with Palm OS
ver3.0. Hope there is a way to do it on Android.

- Sunit

On Tue, Nov 11, 2008 at 5:25 PM, Andrew Burgess <[EMAIL PROTECTED]> wrote:

> If you don't want to direct the user to the typical send form, then you're
> going to have to either try and adapt an existing java based mailer to
> android or write an SMTP client from scratch.  The SMTP standard isn't too
> hard to implement.
>
>
> On Tue, Nov 11, 2008 at 8:05 PM, Sunit Katkar <[EMAIL PROTECTED]>wrote:
>
>> Any ideas? Any pointers to some examples?
>>
>>
>> On Tue, Nov 11, 2008 at 9:42 AM, Sunit Katkar <[EMAIL PROTECTED]>wrote:
>>
>>> Suppose I have an Activity which has couple of text fields - one for the
>>> subject and one for body text.
>>> And there is a simple Button. When user clicks the button, I wish to send
>>> the text in the textfields via email to a predetermined email address.
>>> How can I achieve this?
>>>
>>> Sorry for being lazy and not looking up the SDK docs :)
>>>
>>> PS: I have configured the EMAIL app on G1 using the Email setup steps, so
>>> it can receive and send email from my email account.
>>>
>>> --
>>> - Sunit Katkar
>>> http://sunitkatkar.blogspot.com/ - Android OS Tutorials
>>>
>>>
>>
>>
>> --
>> - Sunit Katkar
>> http://sunitkatkar.blogspot.com/ - Android OS Tutorials
>>
>>
>>
>>
>
>
> --
> Andrew Burgess
>
> >
>


-- 
- Sunit Katkar
http://sunitkatkar.blogspot.com/ - Android OS Tutorials

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Games

2008-11-11 Thread Craig Peterson

On Tue, Nov 11, 2008 at 3:35 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Can any one give some idea in developing some gaming projects in
> Android

http://www.rbgrn.net/blog/2008/11/getting-started-in-android-game-development.html
http://www.gamedev.net/reference/articles/article2570.asp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] 64bit Windows Problems

2008-11-11 Thread melvin ram

I'm on a windows vista64 machine and i'm not able to run the emulator.
Here's the output from the terminal:

--
C:\android-sdk\tools>ddms.bat
27:01 E/ddms: shutting down due to uncaught exception
27:01 E/ddms: java.lang.UnsatisfiedLinkError: C:\android-sdk\tools\lib
\swt-win32
-3236.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:
123)
at org.eclipse.swt.internal.win32.OS.(OS.java:18)
at org.eclipse.swt.graphics.FontData.(FontData.java:259)
at com.android.ddms.PrefsDialog.setDefaults(PrefsDialog.java:
198)
at com.android.ddms.PrefsDialog.init(PrefsDialog.java:140)
at com.android.ddms.Main.main(Main.java:74)
--

I've installed JDK 32bit, Eclipse & ADT

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Get a webpage and display it to webview

2008-11-11 Thread CharlesA

i'm newbee in android, i want  to get the page and display it to
webview, i'm able to get the page content, but i'm not sure how to set
the content to the web view.
How do i add webview to R

Any help would be appreciated.
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Intent to open an email attachment

2008-11-11 Thread Jim Ancona

I'd like my activity to be able to open a file attached to an email.
To open a file downloaded in the browser, I set up the following
intent filter:

  




  

I assume I would do something similar to open an email attachment,
possibly with a different intent category. I could try matching using
scheme+authority+path instead of mime type, but I have no idea what
values to use for received emails.

Has anyone done this, or seen it done? Thanks in advance!

Jim

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Any way to have two MediaRecorders recording at once?

2008-11-11 Thread Ulrich Scheller

You could record one audio stream and copy the desired parts into two
new streams later on.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Exchange Server Support

2008-11-11 Thread davin_thompson

Unfortunatly... Im not very good with with java... but I'm working on
it.  However, prepairing for this project, I have written an exchange
webdav client in php, so I solidly have the concept. Hopefully, in a
few days, i'll have something working in java (so far I've made it
to a basic http request =P).  Wish me luck, and i'll share my results





On Oct 17, 11:12 am, Timbobsteve <[EMAIL PROTECTED]> wrote:
> Hi Zero,
> For what it's worth I can supply my time and effort to an Exchange 
> client/library. From what I can see most of the opensource stuff on MAPI is 
> limited to Exchange 2000. Most other implementations access Exchange through 
> Outlook Web Access (OWA) + WebDAV.
> I will read up on using WebDAV and then we can look into getting an Android 
> WebDAV client library in place. I'm not the best programmer, but everyone 
> starts somewhere right?
> Cheers.
> zero wrote:if there would be a group of developers willing to build an 
> opensource implementation of MAPI for java, i'd be happy to contribute. but 
> it's way to huge to tackle it alone. at least, for me. there's propably a few 
> other ways, like webdav, to connect to exchange, but they differ in 
> stability, and clearly an opensource mapi implementation would be way more 
> elegant. zero openintents.org zeroblog.exu-mobile.com On Oct 17, 1:20 pm, 
> Timbobsteve<[EMAIL PROTECTED]>wrote:Hi All, This isn't another thread asking 
> if exchange server is supported on Android... so don't worry :P I just wanted 
> to start a dialog with other developers about how to possibly tackle the MS 
> Exchange support issues on Android. I'm not the best coder in the world, so I 
> can't really provide example code or anything, but this is more of a 
> discussion-type thread. From what I can tell, my iPhone uses WebDAV to 
> connect to Exchange to get mail (correct me if I'm wrong). So I started 
> looking @ opensource implementations of Java WebDAV clients and came across 
> Apache SLIDE Server and Client. Unfortunately Slide has been discontinued. 
> There is not that it was replaced by Apache JackRabbit, but from what I can 
> see JackRabbit is a Server implementation of WebDAV technologies. I was also 
> searching for Java MAPI support, but a lot of the MAPI APIs for Java are 
> closed-source and licensed... which is not good IMHO. What other options for 
> exchange support do people see? Do you think it is a worthwhile pursuit? Do 
> you think it will happen and will it be a paid-for product on AndroidMarket, 
> or will someone make an open-source client? There is a lot of reading to be 
> done on WebDAV and how it integrates into Exchange... so I am going to start 
> doing some reading. Feel free to share your ideas and thoughts.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Shares Preferences are not getting deleted

2008-11-11 Thread linker lv
Hi,
I can access by command "ls" to emulatro, but not handset. why?

2008/11/12 yasmin afrose <[EMAIL PROTECTED]>

> Hi,
>
> Thanks Sudha. I've tried to find where that file was stored... U told about
> that..
>
> Really I thank you lot. But I tried to open the file... but I can't .. Is
> it possible to view the data in the Shared file.
>
> Thanks for everything...
>
> Regards,
> Yasmin
>
> On Tue, Nov 11, 2008 at 5:42 PM, Sudha <[EMAIL PROTECTED]> wrote:
>
>>
>> hi
>> u can delete the values by using the clear() function
>> it wont delete the file..yaarr
>> its getting saved in data/data/ur apkpath/shared_prefs/urpref name.xml
>>
>>
>>
>> On Nov 11, 4:52 pm, "yasmin afrose" <[EMAIL PROTECTED]> wrote:
>> > Thanks..I got the output...
>> >
>> > But still I didn't try the delete action.
>> >
>> > Thanks,
>> > Yasmin
>> >
>> >
>> >
>> >
>> >
>> > On Tue, Nov 11, 2008 at 4:56 PM, Sudha <[EMAIL PROTECTED]> wrote:
>> >
>> > > Hi
>> > > shared preferences are very simple.
>> > > 1.create it
>> > > prefereceObj = context.getSharedPreferences(preferenceName,
>> > > modeOfAccess)
>> > > 2.to write the data
>> > > 1.obtain the editor
>> > > Editor edr= prefereceObj.edit();
>> > > 2.use edr.putString(key, value)..putBoolean etc etc
>> > > 3.edr.commit()
>> >
>> > > 3.to read it
>> > > prefereceObj.getFloat(key, defaultvalue if the pref/key is not there);
>> >
>> > > 4.that it...
>> >
>> > > but I am not getting my answer...
>> > > mine is like a game application.if u ones delete the game.. the data
>> > > will be there and
>> > > if you reinstall it teh game is using the old data..
>> > > thats bad...
>> > > how to do it...
>> > > its behaving like ur desktop application..if u delete the front end
>> > > the back end will be there..
>> > > hmmm
>> >
>> > --
>> > Everything is Possible For U only- 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Popup Menu Over Dialogs

2008-11-11 Thread obi

So I asked this over in the beginner forum and no one seemed to have
an answer for me.  Does anyone know how to have a menu pop up over a
dialog?  The documentation seems to imply that it is possible, but,
being new to all of this, I don't quite know what to do from their
short description.

public boolean onCreateOptionsMenu(Menu menu)
It is usually safe to proxy this call to the owner activity's
onCreateOptionsMenu(Menu) if the client desires the same menu for this
Dialog.

Can someone help me understand what this means?

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



[android-developers] Re: UI Update question

2008-11-11 Thread indiabolbol.com

After reading the Handler documentation, I got the clarification:
because mUpdateResults Thread will run on the thread to which this
handler is attached whereas new Thread will run on another thread
other than the UI thread.
Is this correct?

On Nov 12, 11:05 am, "indiabolbol.com" <[EMAIL PROTECTED]> wrote:
> Below is a snippet from 
> googlehttp://code.google.com/android/kb/commontasks.html#threading
>
> public class MyActivity extends Activity {
>
>     [ . . . ]
>     // Need handler for callbacks to the UI thread
>     final Handler mHandler = new Handler();
>
>     // Create runnable for posting
>     final Runnable mUpdateResults = new Runnable() {
>         public void run() {
>             updateResultsInUi();
>         }
>     };
>
>     @Override
>     protected void onCreate(Bundle icicle) {
>         super.onCreate(icicle);
>
>         [ . . . ]
>     }
>
>     protected void startLongRunningOperation() {
>
>         // Fire off a thread to do some work that we shouldn't do
> directly in the UI thread
>         Thread t = new Thread() {
>             public void run() {
>                 mResults = doSomethingExpensive();
>                 mHandler.post(mUpdateResults);
>             }
>         };
>         t.start();
>     }
>
>     private void updateResultsInUi() {
>
>         // Back in the UI thread -- update our UI elements based on
> the data in mResults
>         [ . . . ]
>     }}
>
> As per the best practice, we are supposed to update UI components via
> handler as shown above.
>
> My question, the Runable thread mUpdateResults can update UI directly
> but not the thread created in startLongRunningOperation..
> For eg. can we rewrite the code as follows:
>
>     protected void startLongRunningOperation() {
>
>         // Fire off a thread to do some work that we shouldn't do
> directly in the UI thread
>         Thread t = new Thread() {
>             public void run() {
>                 mResults = doSomethingExpensive();
>                 updateResultsInUi(); // updating UI here.
>             }
>         };
>         t.start();
>     }
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] UI Update question

2008-11-11 Thread indiabolbol.com

Below is a snippet from google 
http://code.google.com/android/kb/commontasks.html#threading

public class MyActivity extends Activity {

[ . . . ]
// Need handler for callbacks to the UI thread
final Handler mHandler = new Handler();

// Create runnable for posting
final Runnable mUpdateResults = new Runnable() {
public void run() {
updateResultsInUi();
}
};

@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);

[ . . . ]
}

protected void startLongRunningOperation() {

// Fire off a thread to do some work that we shouldn't do
directly in the UI thread
Thread t = new Thread() {
public void run() {
mResults = doSomethingExpensive();
mHandler.post(mUpdateResults);
}
};
t.start();
}

private void updateResultsInUi() {

// Back in the UI thread -- update our UI elements based on
the data in mResults
[ . . . ]
}
}
As per the best practice, we are supposed to update UI components via
handler as shown above.


My question, the Runable thread mUpdateResults can update UI directly
but not the thread created in startLongRunningOperation..
For eg. can we rewrite the code as follows:

protected void startLongRunningOperation() {

// Fire off a thread to do some work that we shouldn't do
directly in the UI thread
Thread t = new Thread() {
public void run() {
mResults = doSomethingExpensive();
updateResultsInUi(); // updating UI here.
}
};
t.start();
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Question on Service Choice

2008-11-11 Thread Alvin Yates

Main question:  Is there a special reason why ServiceStartArguments
uses a PendingIntent based on AlarmService.class instead of
ServiceStartArgumentsController?


For my own education:  I'm trying to decide which example of the
services I should be modeling my networking code after in order to get
the desired functionality.

Basically, my app is storing data that will be uploaded when 1) the
user hits a button or 2) on startup if not all the data has been
uploaded yet.  The uploading is naturally taking place in the
background while the app runs.

I'm planning on running it in the same process, as I don't seem to
have a burning need to do otherwise, so I'm assuming I don't need IPC
for it.  I'm also assuming that, because the other services never die
upon backing out of the app, that if the user backs out of my app the
uploading will not be interrupted.

I'm not way off base here, am I?






--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Sending HTML email with GMail installed on G1

2008-11-11 Thread thrusty

Hello,

I'm trying to send HTML email using the GMail package installed on the
T-Mobile G1.  What I'm finding is that regardless of the content-type
I specify, the message body is always translated into both text/plain
and text/html ; however, the html is escaped (e.g. "<" becomes "<")
so it does not display as html in the receiving email client.

Here's how I'm setting up the Intent:

String[] addresses = {aAddress};

Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_EMAIL, addresses);
intent.putExtra(Intent.EXTRA_SUBJECT, aSubject);
intent.putExtra(Intent.EXTRA_TEXT, aBody);
intent.setType("text/html");
startActivity(newIntent);

The email I receive looks something like this:


MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="=_Part_494_24247511.1226466478922"

--=_Part_494_24247511.1226466478922
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline



Here's a property you might want to look at:149
Ashbury,
San Francisco, CA, 94117View in Puluwai | http://www.agencylogic.com/googlebase/149Ashbury-com
">Browser

--=_Part_494_24247511.1226466478922
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Here's a property you might want to look at:

  • 149 Ashbury, San Francisco, CA, 94117
    View in Puluwai | Browser
--=_Part_494_24247511.1226466478922-- As you can see, the html is modified by gmail. The "text/plain" version is basically correct except for its mime type. I've tried setting various other content types, e.g.: "text/xhtml" "message/rfc822" "message/rfc2822" "text/plain" "multipart/mixed" No luck so far-- anyone have any ideas? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---

[android-developers] Re: Games

2008-11-11 Thread Obormot

Try Tower Defence (google it for more info).

On Nov 11, 9:12 pm, "dhuri natarajan" <[EMAIL PROTECTED]> wrote:
> i am a developer in android.
> i want to develop some gaming projects in android.
> so, i want some ideas about games.
>
> On Tue, Nov 11, 2008 at 6:45 AM, Robert Green <[EMAIL PROTECTED]> wrote:
>
> > Do you want ideas for games or how to develop games in general?
>
> > On Nov 11, 3:35 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> > > Can any one give some idea in developing some gaming projects in
> > > Android
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Drawable doesn't load sometimes

2008-11-11 Thread Obormot

It did help! Thanks a lot!
Of course, I now create a bunch of unnecessary objects, but hope it'll
be fixed soon...

On Nov 11, 10:30 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
> This is a known bug. Here is a workaround:
>
>                     in = new BufferedInputStream(new
> URL(getUrl(size)).openStream(),
>                             IO_BUFFER_SIZE);
>
>                     final ByteArrayOutputStream dataStream = new
> ByteArrayOutputStream();
>                     out = new BufferedOutputStream(dataStream, 
> IO_BUFFER_SIZE);
>                     copy(in, out);
>                     out.flush();
>
>                     final byte[] data = dataStream.toByteArray();
>                     bitmap = BitmapFactory.decodeByteArray(data, 0,
> data.length);
>
>
>
> On Tue, Nov 11, 2008 at 8:14 PM, Obormot <[EMAIL PROTECTED]> wrote:
>
> > Hi, guys.
>
> > I load Drawables (jpeg pictures) from URLs the following way:
> >                URL urlO = new URL(url);
> >                URLConnection urlC = urlO.openConnection();
> >                InputStream is = urlC.getInputStream();
> >                return Drawable.createFromStream(is, url);
>
> > It's funky that sometimes it returns null and sometimes some
> > incompletely loaded drawable.
> > I see the following errors in the log:
>
> > 11-11 22:01:41.693: DEBUG/skia(1314): xx failure to skip
> > request 3954 actual 3372
> > 11-11 22:01:41.693: DEBUG/skia(1314): xxx jpeg error 91
> > Miscellaneous marker 0x%02x, length %u
>
> > As I understand Drawable is somehow asynchronously loaded.
> > How would you recommend me go around this issue? I use those drawables
> > for example as markers on the map.
>
> --
> Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Sms with Intent

2008-11-11 Thread for android
Any help??

On Tue, Nov 11, 2008 at 11:50 AM, for android <[EMAIL PROTECTED]> wrote:

> I need to send an SMS with an Intent. whats the best way to test this.In
> the emulator I can only send an SMS,but not an SMS with an intent.
>
>
> Whats the best way to accomplish this testing?
>
> 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: disable home button

2008-11-11 Thread Romain Guy

Dianne explained how Toddler Lock does it, and it's very different
from what you do. You are disguising your application as a Home
screen, which it is NOT. And both solutions (Toddler Lock and yours)
are shortcomings of the system that need to be (and will be) fixed. It
is perfectly normal to provide a new sort of lock screen but we need
to provide you with the right APIs to do it. We unfortunately could
not do it for 1.0 and I am deeply sorry for this. But that does not
justify doing things like your solution :)

On Tue, Nov 11, 2008 at 8:02 PM, zl25drexel <[EMAIL PROTECTED]> wrote:
>
> well i am writting a screen lock app. so i need to lock all buttons.
> The toddler lock is one of the most popular apps in the market, and it
> does similar trick to disable the home button. so why cant i do the
> same?
>
> On Nov 11, 10:43 pm, hackbod <[EMAIL PROTECTED]> wrote:
>> Oh good lord.  I forgot that API was still there.  This will be
>> removed in a future version -- this was an old version of keeping
>> track of preferred applications, and completely conflicts with the new
>> better way of doing it per activity.
>>
>> On Nov 11, 7:11 pm, zl25drexel <[EMAIL PROTECTED]> wrote:
>>
>> > answering my own question again:
>>
>> > to disable home button, make your activity a home activity (see
>> > samples/HOME in the SDK) then use
>> >  pm = getPackageManager();
>> >  pm.addPackageToPreferred(getPackageName());
>>
>> > in your activity's oncreate() method to make your home activity the
>> > preferred home activity, that way your app will stay on when the home
>> > button is pressed by the user.
>>
>> > remember remove that preference when your activity is stopped.
>>
>> > On Nov 11, 10:10 pm,zl25drexel<[EMAIL PROTECTED]> wrote:
>>
>> > > answering my own question again:
>>
>> > > todisablehomebutton, make your activity ahomeactivity (see
>> > > samples/HOMEin the SDK) then use
>> > >  pm = getPackageManager();
>> > >  pm.addPackageToPreferred(getPackageName());
>>
>> > > in your activity's oncreate() method to make yourhomeactivity the
>> > > preferredhomeactivity, that way your app will stay on when 
>> > > thehomebuttonis pressed by the user.
>>
>> > > remember remove that preference when your activity is stopped.
>>
>> > > Jay
>>
>> > > On Nov 11, 12:33 pm, hackbod <[EMAIL PROTECTED]> wrote:
>>
>> > > > It didn't, it is a huge hack where it restarts itself when the user
>> > > > tries to leave it.  It's a cute hack for the toddler lock, but far
>> > > > from something any normal application should do.  (And seriously, the
>> > > > system -should- detect this and kill an app that is doing it.  I would
>> > > > consider the fact that toddler lock can do this to be a bug in the
>> > > > system.)
>>
>> > > > On Nov 11, 8:33 am,zl25drexel<[EMAIL PROTECTED]> wrote:
>>
>> > > > > anyone?
>>
>> > > > > On Nov 10, 9:53 pm,zl25drexel<[EMAIL PROTECTED]> wrote:
>>
>> > > > > > so how did the toddlers lockdisablethehomebutton?
>>
>> > > > > > On Nov 10, 9:41 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
>>
>> > > > > > > Not if the app starts on boot. (You can always boot in safe mode 
>> > > > > > > but
>> > > > > > > still... it's annoying.)
>>
>> > > > > > > TheHomekey is the best way for the user to go back to a familiar
>> > > > > > > place. That's why pressingHometwice, no matter where you are, 
>> > > > > > > will
>> > > > > > > always take you back to the center screen onHome'sdesktop.
>>
>> > > > > > > On Mon, Nov 10, 2008 at 6:26 PM,zl25drexel<[EMAIL PROTECTED]> 
>> > > > > > > wrote:
>>
>> > > > > > > > you only need to restart the phone.
>>
>> > > > > > > > On Nov 10, 8:51 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
>> > > > > > > >>zl25drexelwrote:
>> > > > > > > >> > why is making the screen lock actually lock evil?
>>
>> > > > > > > >> 1. If the app has a bug, and won't "unlock", the user is hosed
>>
>> > > > > > > >> 2. If the app is malicious, and won't "unlock", the user is 
>> > > > > > > >> hosed
>>
>> > > > > > > >> The Google team has tried to minimize any chance of a rogue 
>> > > > > > > >> application
>> > > > > > > >> causing problems, particularly permanent ones. This approach 
>> > > > > > > >> has
>> > > > > > > >> trade-offs; making it difficult todisablethehomebuttonis one 
>> > > > > > > >> of those.
>>
>> > > > > > > >> --
>> > > > > > > >> Mark Murphy (a Commons Guy)http://commonsware.com
>>
>> > > > > > > >> Android Training on the Ranch! -- Mar 16-20, 
>> > > > > > > >> 2009http://www.bignerdranch.com/schedule.shtml
>>
>> > > > > > > --
>> > > > > > > Romain Guywww.curious-creature.org
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/androi

[android-developers] Re: Drawable doesn't load sometimes

2008-11-11 Thread Romain Guy

This is a known bug. Here is a workaround:

in = new BufferedInputStream(new
URL(getUrl(size)).openStream(),
IO_BUFFER_SIZE);

final ByteArrayOutputStream dataStream = new
ByteArrayOutputStream();
out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE);
copy(in, out);
out.flush();

final byte[] data = dataStream.toByteArray();
bitmap = BitmapFactory.decodeByteArray(data, 0,
data.length);

On Tue, Nov 11, 2008 at 8:14 PM, Obormot <[EMAIL PROTECTED]> wrote:
>
> Hi, guys.
>
> I load Drawables (jpeg pictures) from URLs the following way:
>URL urlO = new URL(url);
>URLConnection urlC = urlO.openConnection();
>InputStream is = urlC.getInputStream();
>return Drawable.createFromStream(is, url);
>
> It's funky that sometimes it returns null and sometimes some
> incompletely loaded drawable.
> I see the following errors in the log:
>
> 11-11 22:01:41.693: DEBUG/skia(1314): xx failure to skip
> request 3954 actual 3372
> 11-11 22:01:41.693: DEBUG/skia(1314): xxx jpeg error 91
> Miscellaneous marker 0x%02x, length %u
>
> As I understand Drawable is somehow asynchronously loaded.
> How would you recommend me go around this issue? I use those drawables
> for example as markers on the map.
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem with Service Permission

2008-11-11 Thread Raktim Das

Thanks a ton. It worked!

On Nov 11, 3:42 pm, hackbod <[EMAIL PROTECTED]> wrote:
> Be sure you install the .apk providing the permission before the one
> using it.  You can see what permissions your app has been granted by
> digging through the output of "adb shell dumpsys package".
>
> Also PLEASE DO NOT use the name "android.permission."  The namespaces
> "android.* and "com.android.*" are reserved for the android platforms,
> and applications MUST NOT USE THEM.
>
> On Nov 11, 11:43 am, Raktim Das <[EMAIL PROTECTED]> wrote:
>
> > Thanks a lot for analyzing the problem.
>
> > First, my comment on your second point -
> > This I had already been doing - as in the client application's
> > manifest, the service application's manifest too has this entry under
> > the manifest tag:
> >  > android:name="android.permission.ACCESS_BACKGROUND_SERVICE" />
>
> > Now coming to the first point, I changed the client code line from -
> > Intent intent = new Intent(this,
> > com.abc.xyz.service.BackgroundService.class);
> > to
> > Intent intent = new Intent("com.abc.xyz.service.BackgroundService");
>
> > After the change, it seems the service is identified and the earlier
> > warning message -
> > "Unable to start service Intent{ comp={com.abc.xyz.client/
> > com.abc.xyz.service.BackgroundService} }:not found "
> > is not coming.
> > But then the permission related SecurityException is coming at the
> > client statement "startService(intent)" as below:
>
> > - WARN/PackageManager(57): Not granting permission
> > android.permission.ACCESS_BACKGROUND_SERVICE to package
> > com.abc.xyz.client (protectionLevel=3 flags=0x44)
> > - ERROR/AndroidRuntime(): ERROR: thread attach failed
> > - WARN/ActivityManager(57): Permission Denial: Accessing service
> > ComponentInfo{com.abc.xyz/com.abc.xyz.service.BackgroundService} from
> > pid=57, uid=1000 requires android.permission.ACCESS_BACKGROUND_SERVICE
> > - ERROR/AndroidRuntime(1120): java.lang.RuntimeException: Unable to
> > start activity ComponentInfo{com.abc.xyz.client/
> > com.abc.xyz.client.ClientActivity}: java.lang.SecurityException: Not
> > allowed to start service Intent
> > { action=com.abc.xyz.service.BackgroundService } without permission
> > android.permission.ACCESS_BACKGROUND_SERVICE
>
> > I think I am missing something with the declaration of permission in
> > the manifest(s). What is your opinion?
>
> > Thanks,
> > Raktim.
>
> > On Nov 11, 4:48 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > The Intent you are making to bind to the service is trying to find a
> > > component in your own .apk, not the other.
>
> > > The last permission error you mention is because you need to
> > > explicitly request to use even your own permissions.
>
> > > On Nov 10, 9:31 pm, Raktim Das <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
> > > > I am using 0.9 beta SDK.
> > > > I want to have a service defined within one application to be
> > > > invokable from another.
> > > > The application hosting the service has, in its manifest, the
> > > > following inside the application tag:
>
> > > >  > > > android:process=":remote"  android:exported="true"
> > > > android:permission="android.permission.ACCESS_BACKGROUND_SERVICE">
> > > >         
> > > >                  > > > android:name="com.abc.xyz.service.BackgroundService" />
> > > >         
> > > > 
>
> > > > It also has the following inside the manifest tag:
> > > >  > > > android:protectionLevel="dangerous"/>
>
> > > > In my client application's manifest xml file, I have the following
> > > > inside manifest tag:
> > > >  > > > android:name="android.permission.ACCESS_BACKGROUND_SERVICE" />
>
> > > > The client Activity code has the following API called from its
> > > > onCreate() method:
>
> > > >     private void startBackgroundService()
> > > >     {
> > > >         mConnection = new ServiceConnection()
> > > >         {
> > > >             public void onServiceConnected(ComponentName className,
> > > > IBinder service)
> > > >             {
> > > >                 Log.i(TAG, "Connected to background service");
> > > >                 mService =
> > > > BackgroundService.Stub.asInterface(service);
> > > >             }
>
> > > >             public void onServiceDisconnected(ComponentName className)
> > > >             {
> > > >                 mService = null;
> > > >                 Log.i(TAG, "Background service disconnected");
> > > >             }
> > > >         };
>
> > > >         Intent intent = new Intent(this,
> > > >                 com.abc.xyz.service.BackgroundService.class);
>
> > > >         startService(intent);
>
> > > >         boolean result = bindService(intent, mConnection,
> > > > Context.BIND_AUTO_CREATE);
>
> > > >         Log.i(TAG, "Background service bind result:  " + result);
> > > >     }
>
> > > > When I run the client Activity, it can not bind to the service:
> > > > - the log statement at the end has "Background service bind result:
> > > > false".
> > > > - the onServiceConnected() method is not cal

[android-developers] Drawable doesn't load sometimes

2008-11-11 Thread Obormot

Hi, guys.

I load Drawables (jpeg pictures) from URLs the following way:
URL urlO = new URL(url);
URLConnection urlC = urlO.openConnection();
InputStream is = urlC.getInputStream();
return Drawable.createFromStream(is, url);

It's funky that sometimes it returns null and sometimes some
incompletely loaded drawable.
I see the following errors in the log:

11-11 22:01:41.693: DEBUG/skia(1314): xx failure to skip
request 3954 actual 3372
11-11 22:01:41.693: DEBUG/skia(1314): xxx jpeg error 91
Miscellaneous marker 0x%02x, length %u

As I understand Drawable is somehow asynchronously loaded.
How would you recommend me go around this issue? I use those drawables
for example as markers on the map.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: does android phone have a IP address?

2008-11-11 Thread Lei

Hi Christine
Thanks for your relay. I had added the permission.

On Nov 11, 8:42 pm, Christine <[EMAIL PROTECTED]> wrote:
> Err, is this line in your manifest file?
>         
>
> just asking
>
> On Nov 11, 9:06 am, Lei <[EMAIL PROTECTED]> wrote:
>
> > Hi all
>
> > I want to program a server on android phone. I use socket.
> > Is the android emulator's IP address the same to the PC's?
> > I got exceptions from the client which I program on the same PC.
>
> > the exceptions is:
> > java.net.ConnectException: Connection refused: connect
> > java.lang.NullPointerException
>
> > the code is below:
>
> > java client:
> > import java.io.DataInputStream;
> > import java.io.DataOutputStream;
> > import java.io.IOException;
> > import java.net.InetAddress;
> > import java.net.Socket;
> > import java.net.UnknownHostException;
>
> > public class JavaClient {
>
> >         public static void main(String argv[])
> >         {
> >         Socket ClientSocket = null;
>
> >         DataOutputStream os= null;
> >         DataInputStream is = null;
>
> >         try {
> >             // Retrieve the ServerName
> >             InetAddress serverAddr = InetAddress.getByName(SERVERIP);
>
> >             /* Create new UDP-Socket */
> >             ClientSocket = new Socket(serverAddr,SERVERPORT);
>
> >             os= new DataOutputStream(ClientSocket.getOutputStream());
> >             is = new DataInputStream(ClientSocket.getInputStream());
> >         } catch (UnknownHostException e) {
> >             System.err.println("Don't know about host: hostname");
> >         } catch (IOException e) {
> >             System.err.println(e);
> >         }
>
> >         try {
>
> >             os.writeBytes("hello");
>
> >             byte[] input = new byte[100];
> >             while(is.read(input, 0, 10)!=-1)
> >             {
> >                 System.out.println(new String(input));
> >             }
>
> >             os.close();
> >             is.close();
> >             ClientSocket.close();
>
> >        } catch (Exception e) {
> >            System.out.println(e);
>
> >        }
> >         }
>
> >     public static final String SERVERIP = "142.19.128.114"; //
> > 'Within' the emulator!
> >     public static final int SERVERPORT = ;
>
> > }
>
> > android server:
> > public class AndroidServer extends Activity {
> >     /** Called when the activity is first created. */
> >     @Override
> >     public void onCreate(Bundle savedInstanceState) {
> >         super.onCreate(savedInstanceState);
> >         setContentView(R.layout.main);
>
> >         DataOutputStream os=null;
> >         DataInputStream is = null;
> >         ServerSocket socket = null;
> >         Socket ClientSocket = null;
>
> >         try {
> >             /* Create new UDP-Socket */
> >             socket = new ServerSocket(SERVERPORT);
> >             ClientSocket = socket.accept();
>
> >             os = new DataOutputStream(ClientSocket.getOutputStream());
> >             is = new DataInputStream(ClientSocket.getInputStream());
>
> >             /* By magic we know, how much data will be waiting for us
> > */
> >             byte[] buf = new byte[100];
>
> >             while(is.read(buf, 0, 10)!=0)
> >             {
> >                 Log.d("TCP", new String(buf));
> >                 os.writeBytes("end");
>
> >             }
>
> >             os.close();
> >             is.close();
> >             socket.close();
> >             ClientSocket.close();
>
> >        } catch (Exception e) {
> >            System.out.println(e);
> >        }
> >         }
>
> >     public static final int SERVERPORT = ;
>
> > }
>
> > Regards,
> > Lei
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: does android phone have a IP address?

2008-11-11 Thread Jean-Baptiste Queru

As a general rule, you shouldn't expect that anyone will be able to
connect to an Android phone directly - in most circumstances the IP
addresses that those devices get either aren't routable or aren't
reachable.

JBQ

On Tue, Nov 11, 2008 at 8:08 PM, Lei <[EMAIL PROTECTED]> wrote:
>
> Hi Mark Murphy
>
> Thanks for your replay.
> And the G1 (the real phone) may have a IP address. Am I right?
>
> Regards,
> Lei
>
> On Nov 11, 9:27 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
>> Lei wrote:
>> > I want to program a server on android phone. I use socket.
>> > Is the android emulator's IP address the same to the PC's?
>>
>> No.
>>
>> On the emulator, 10.0.2.2 is a magic IP address that converts into
>> localhost on your PC.
>>
>> http://code.google.com/android/reference/emulator.html#networkaddresses
>>
>> --
>> Mark Murphy (a Commons Guy)http://commonsware.com
>> _The Busy Coder's Guide to Android Development_ Version 1.4 Published!
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: does android phone have a IP address?

2008-11-11 Thread Lei

Hi Mark Murphy

Thanks for your replay.
And the G1 (the real phone) may have a IP address. Am I right?

Regards,
Lei

On Nov 11, 9:27 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> Lei wrote:
> > I want to program a server on android phone. I use socket.
> > Is the android emulator's IP address the same to the PC's?
>
> No.
>
> On the emulator, 10.0.2.2 is a magic IP address that converts into
> localhost on your PC.
>
> http://code.google.com/android/reference/emulator.html#networkaddresses
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.4 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: disable home button

2008-11-11 Thread zl25drexel

well i am writting a screen lock app. so i need to lock all buttons.
The toddler lock is one of the most popular apps in the market, and it
does similar trick to disable the home button. so why cant i do the
same?

On Nov 11, 10:43 pm, hackbod <[EMAIL PROTECTED]> wrote:
> Oh good lord.  I forgot that API was still there.  This will be
> removed in a future version -- this was an old version of keeping
> track of preferred applications, and completely conflicts with the new
> better way of doing it per activity.
>
> On Nov 11, 7:11 pm, zl25drexel <[EMAIL PROTECTED]> wrote:
>
> > answering my own question again:
>
> > to disable home button, make your activity a home activity (see
> > samples/HOME in the SDK) then use
> >  pm = getPackageManager();
> >  pm.addPackageToPreferred(getPackageName());
>
> > in your activity's oncreate() method to make your home activity the
> > preferred home activity, that way your app will stay on when the home
> > button is pressed by the user.
>
> > remember remove that preference when your activity is stopped.
>
> > On Nov 11, 10:10 pm,zl25drexel<[EMAIL PROTECTED]> wrote:
>
> > > answering my own question again:
>
> > > todisablehomebutton, make your activity ahomeactivity (see
> > > samples/HOMEin the SDK) then use
> > >  pm = getPackageManager();
> > >  pm.addPackageToPreferred(getPackageName());
>
> > > in your activity's oncreate() method to make yourhomeactivity the
> > > preferredhomeactivity, that way your app will stay on when 
> > > thehomebuttonis pressed by the user.
>
> > > remember remove that preference when your activity is stopped.
>
> > > Jay
>
> > > On Nov 11, 12:33 pm, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > > It didn't, it is a huge hack where it restarts itself when the user
> > > > tries to leave it.  It's a cute hack for the toddler lock, but far
> > > > from something any normal application should do.  (And seriously, the
> > > > system -should- detect this and kill an app that is doing it.  I would
> > > > consider the fact that toddler lock can do this to be a bug in the
> > > > system.)
>
> > > > On Nov 11, 8:33 am,zl25drexel<[EMAIL PROTECTED]> wrote:
>
> > > > > anyone?
>
> > > > > On Nov 10, 9:53 pm,zl25drexel<[EMAIL PROTECTED]> wrote:
>
> > > > > > so how did the toddlers lockdisablethehomebutton?
>
> > > > > > On Nov 10, 9:41 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Not if the app starts on boot. (You can always boot in safe mode 
> > > > > > > but
> > > > > > > still... it's annoying.)
>
> > > > > > > TheHomekey is the best way for the user to go back to a familiar
> > > > > > > place. That's why pressingHometwice, no matter where you are, will
> > > > > > > always take you back to the center screen onHome'sdesktop.
>
> > > > > > > On Mon, Nov 10, 2008 at 6:26 PM,zl25drexel<[EMAIL PROTECTED]> 
> > > > > > > wrote:
>
> > > > > > > > you only need to restart the phone.
>
> > > > > > > > On Nov 10, 8:51 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> > > > > > > >>zl25drexelwrote:
> > > > > > > >> > why is making the screen lock actually lock evil?
>
> > > > > > > >> 1. If the app has a bug, and won't "unlock", the user is hosed
>
> > > > > > > >> 2. If the app is malicious, and won't "unlock", the user is 
> > > > > > > >> hosed
>
> > > > > > > >> The Google team has tried to minimize any chance of a rogue 
> > > > > > > >> application
> > > > > > > >> causing problems, particularly permanent ones. This approach 
> > > > > > > >> has
> > > > > > > >> trade-offs; making it difficult todisablethehomebuttonis one 
> > > > > > > >> of those.
>
> > > > > > > >> --
> > > > > > > >> Mark Murphy (a Commons Guy)http://commonsware.com
>
> > > > > > > >> Android Training on the Ranch! -- Mar 16-20, 
> > > > > > > >> 2009http://www.bignerdranch.com/schedule.shtml
>
> > > > > > > --
> > > > > > > Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: disable home button

2008-11-11 Thread hackbod

Oh good lord.  I forgot that API was still there.  This will be
removed in a future version -- this was an old version of keeping
track of preferred applications, and completely conflicts with the new
better way of doing it per activity.

On Nov 11, 7:11 pm, zl25drexel <[EMAIL PROTECTED]> wrote:
> answering my own question again:
>
> to disable home button, make your activity a home activity (see
> samples/HOME in the SDK) then use
>  pm = getPackageManager();
>  pm.addPackageToPreferred(getPackageName());
>
> in your activity's oncreate() method to make your home activity the
> preferred home activity, that way your app will stay on when the home
> button is pressed by the user.
>
> remember remove that preference when your activity is stopped.
>
> On Nov 11, 10:10 pm,zl25drexel<[EMAIL PROTECTED]> wrote:
>
> > answering my own question again:
>
> > todisablehomebutton, make your activity ahomeactivity (see
> > samples/HOMEin the SDK) then use
> >  pm = getPackageManager();
> >  pm.addPackageToPreferred(getPackageName());
>
> > in your activity's oncreate() method to make yourhomeactivity the
> > preferredhomeactivity, that way your app will stay on when thehomebuttonis 
> > pressed by the user.
>
> > remember remove that preference when your activity is stopped.
>
> > Jay
>
> > On Nov 11, 12:33 pm, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > It didn't, it is a huge hack where it restarts itself when the user
> > > tries to leave it.  It's a cute hack for the toddler lock, but far
> > > from something any normal application should do.  (And seriously, the
> > > system -should- detect this and kill an app that is doing it.  I would
> > > consider the fact that toddler lock can do this to be a bug in the
> > > system.)
>
> > > On Nov 11, 8:33 am,zl25drexel<[EMAIL PROTECTED]> wrote:
>
> > > > anyone?
>
> > > > On Nov 10, 9:53 pm,zl25drexel<[EMAIL PROTECTED]> wrote:
>
> > > > > so how did the toddlers lockdisablethehomebutton?
>
> > > > > On Nov 10, 9:41 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
>
> > > > > > Not if the app starts on boot. (You can always boot in safe mode but
> > > > > > still... it's annoying.)
>
> > > > > > TheHomekey is the best way for the user to go back to a familiar
> > > > > > place. That's why pressingHometwice, no matter where you are, will
> > > > > > always take you back to the center screen onHome'sdesktop.
>
> > > > > > On Mon, Nov 10, 2008 at 6:26 PM,zl25drexel<[EMAIL PROTECTED]> wrote:
>
> > > > > > > you only need to restart the phone.
>
> > > > > > > On Nov 10, 8:51 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> > > > > > >>zl25drexelwrote:
> > > > > > >> > why is making the screen lock actually lock evil?
>
> > > > > > >> 1. If the app has a bug, and won't "unlock", the user is hosed
>
> > > > > > >> 2. If the app is malicious, and won't "unlock", the user is hosed
>
> > > > > > >> The Google team has tried to minimize any chance of a rogue 
> > > > > > >> application
> > > > > > >> causing problems, particularly permanent ones. This approach has
> > > > > > >> trade-offs; making it difficult todisablethehomebuttonis one of 
> > > > > > >> those.
>
> > > > > > >> --
> > > > > > >> Mark Murphy (a Commons Guy)http://commonsware.com
>
> > > > > > >> Android Training on the Ranch! -- Mar 16-20, 
> > > > > > >> 2009http://www.bignerdranch.com/schedule.shtml
>
> > > > > > --
> > > > > > Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: disable home button

2008-11-11 Thread Romain Guy

Please, do NOT do this. You are ruining the user experience. First of
all, your application will be offered to the user every time the user
really wants to go Home (for instance, after booting the phone) but
your application is NOT a Home screen. Then you are preventing the
user from always recovering his workflow by going back to a safe and
known state, the Home screen from where he can access the settings and
launch other apps. What you are doing is a disservice to your users
and to your application.

On Tue, Nov 11, 2008 at 7:10 PM, zl25drexel <[EMAIL PROTECTED]> wrote:
>
> answering my own question again:
>
> to disable home button, make your activity a home activity (see
> samples/HOME in the SDK) then use
>  pm = getPackageManager();
>  pm.addPackageToPreferred(getPackageName());
>
> in your activity's oncreate() method to make your home activity the
> preferred home activity, that way your app will stay on when the home
> button is pressed by the user.
>
> remember remove that preference when your activity is stopped.
>
> Jay
>
> On Nov 11, 12:33 pm, hackbod <[EMAIL PROTECTED]> wrote:
>> It didn't, it is a huge hack where it restarts itself when the user
>> tries to leave it.  It's a cute hack for the toddler lock, but far
>> from something any normal application should do.  (And seriously, the
>> system -should- detect this and kill an app that is doing it.  I would
>> consider the fact that toddler lock can do this to be a bug in the
>> system.)
>>
>> On Nov 11, 8:33 am, zl25drexel <[EMAIL PROTECTED]> wrote:
>>
>> > anyone?
>>
>> > On Nov 10, 9:53 pm, zl25drexel <[EMAIL PROTECTED]> wrote:
>>
>> > > so how did the toddlers lockdisablethehomebutton?
>>
>> > > On Nov 10, 9:41 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
>>
>> > > > Not if the app starts on boot. (You can always boot in safe mode but
>> > > > still... it's annoying.)
>>
>> > > > TheHomekey is the best way for the user to go back to a familiar
>> > > > place. That's why pressingHometwice, no matter where you are, will
>> > > > always take you back to the center screen onHome'sdesktop.
>>
>> > > > On Mon, Nov 10, 2008 at 6:26 PM, zl25drexel <[EMAIL PROTECTED]> wrote:
>>
>> > > > > you only need to restart the phone.
>>
>> > > > > On Nov 10, 8:51 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
>> > > > >> zl25drexel wrote:
>> > > > >> > why is making the screen lock actually lock evil?
>>
>> > > > >> 1. If the app has a bug, and won't "unlock", the user is hosed
>>
>> > > > >> 2. If the app is malicious, and won't "unlock", the user is hosed
>>
>> > > > >> The Google team has tried to minimize any chance of a rogue 
>> > > > >> application
>> > > > >> causing problems, particularly permanent ones. This approach has
>> > > > >> trade-offs; making it difficult todisablethehomebuttonis one of 
>> > > > >> those.
>>
>> > > > >> --
>> > > > >> Mark Murphy (a Commons Guy)http://commonsware.com
>>
>> > > > >> Android Training on the Ranch! -- Mar 16-20, 
>> > > > >> 2009http://www.bignerdranch.com/schedule.shtml
>>
>> > > > --
>> > > > Romain Guywww.curious-creature.org
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Shares Preferences are not getting deleted

2008-11-11 Thread yasmin afrose
Hi,

Thanks Sudha. I've tried to find where that file was stored... U told about
that..

Really I thank you lot. But I tried to open the file... but I can't .. Is it
possible to view the data in the Shared file.

Thanks for everything...

Regards,
Yasmin

On Tue, Nov 11, 2008 at 5:42 PM, Sudha <[EMAIL PROTECTED]> wrote:

>
> hi
> u can delete the values by using the clear() function
> it wont delete the file..yaarr
> its getting saved in data/data/ur apkpath/shared_prefs/urpref name.xml
>
>
>
> On Nov 11, 4:52 pm, "yasmin afrose" <[EMAIL PROTECTED]> wrote:
> > Thanks..I got the output...
> >
> > But still I didn't try the delete action.
> >
> > Thanks,
> > Yasmin
> >
> >
> >
> >
> >
> > On Tue, Nov 11, 2008 at 4:56 PM, Sudha <[EMAIL PROTECTED]> wrote:
> >
> > > Hi
> > > shared preferences are very simple.
> > > 1.create it
> > > prefereceObj = context.getSharedPreferences(preferenceName,
> > > modeOfAccess)
> > > 2.to write the data
> > > 1.obtain the editor
> > > Editor edr= prefereceObj.edit();
> > > 2.use edr.putString(key, value)..putBoolean etc etc
> > > 3.edr.commit()
> >
> > > 3.to read it
> > > prefereceObj.getFloat(key, defaultvalue if the pref/key is not there);
> >
> > > 4.that it...
> >
> > > but I am not getting my answer...
> > > mine is like a game application.if u ones delete the game.. the data
> > > will be there and
> > > if you reinstall it teh game is using the old data..
> > > thats bad...
> > > how to do it...
> > > its behaving like ur desktop application..if u delete the front end
> > > the back end will be there..
> > > hmmm
> >
> > --
> > Everything is Possible For U only- Hide quoted text -
> >
> > - Show quoted text -
>  >
>


-- 
Everything is Possible For U only

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Games

2008-11-11 Thread dhuri natarajan
i am a developer in android.
i want to develop some gaming projects in android.
so, i want some ideas about games.

On Tue, Nov 11, 2008 at 6:45 AM, Robert Green <[EMAIL PROTECTED]> wrote:

>
> Do you want ideas for games or how to develop games in general?
>
> On Nov 11, 3:35 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> > Can any one give some idea in developing some gaming projects in
> > Android
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: disable home button

2008-11-11 Thread zl25drexel

answering my own question again:

to disable home button, make your activity a home activity (see
samples/HOME in the SDK) then use
 pm = getPackageManager();
 pm.addPackageToPreferred(getPackageName());

in your activity's oncreate() method to make your home activity the
preferred home activity, that way your app will stay on when the home
button is pressed by the user.

remember remove that preference when your activity is stopped.

On Nov 11, 10:10 pm, zl25drexel <[EMAIL PROTECTED]> wrote:
> answering my own question again:
>
> todisablehomebutton, make your activity ahomeactivity (see
> samples/HOMEin the SDK) then use
>  pm = getPackageManager();
>  pm.addPackageToPreferred(getPackageName());
>
> in your activity's oncreate() method to make yourhomeactivity the
> preferredhomeactivity, that way your app will stay on when thehomebuttonis 
> pressed by the user.
>
> remember remove that preference when your activity is stopped.
>
> Jay
>
> On Nov 11, 12:33 pm, hackbod <[EMAIL PROTECTED]> wrote:
>
> > It didn't, it is a huge hack where it restarts itself when the user
> > tries to leave it.  It's a cute hack for the toddler lock, but far
> > from something any normal application should do.  (And seriously, the
> > system -should- detect this and kill an app that is doing it.  I would
> > consider the fact that toddler lock can do this to be a bug in the
> > system.)
>
> > On Nov 11, 8:33 am, zl25drexel <[EMAIL PROTECTED]> wrote:
>
> > > anyone?
>
> > > On Nov 10, 9:53 pm, zl25drexel <[EMAIL PROTECTED]> wrote:
>
> > > > so how did the toddlers lockdisablethehomebutton?
>
> > > > On Nov 10, 9:41 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
>
> > > > > Not if the app starts on boot. (You can always boot in safe mode but
> > > > > still... it's annoying.)
>
> > > > > TheHomekey is the best way for the user to go back to a familiar
> > > > > place. That's why pressingHometwice, no matter where you are, will
> > > > > always take you back to the center screen onHome'sdesktop.
>
> > > > > On Mon, Nov 10, 2008 at 6:26 PM, zl25drexel <[EMAIL PROTECTED]> wrote:
>
> > > > > > you only need to restart the phone.
>
> > > > > > On Nov 10, 8:51 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> > > > > >> zl25drexel wrote:
> > > > > >> > why is making the screen lock actually lock evil?
>
> > > > > >> 1. If the app has a bug, and won't "unlock", the user is hosed
>
> > > > > >> 2. If the app is malicious, and won't "unlock", the user is hosed
>
> > > > > >> The Google team has tried to minimize any chance of a rogue 
> > > > > >> application
> > > > > >> causing problems, particularly permanent ones. This approach has
> > > > > >> trade-offs; making it difficult todisablethehomebuttonis one of 
> > > > > >> those.
>
> > > > > >> --
> > > > > >> Mark Murphy (a Commons Guy)http://commonsware.com
>
> > > > > >> Android Training on the Ranch! -- Mar 16-20, 
> > > > > >> 2009http://www.bignerdranch.com/schedule.shtml
>
> > > > > --
> > > > > Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: disable home button

2008-11-11 Thread zl25drexel

answering my own question again:

to disable home button, make your activity a home activity (see
samples/HOME in the SDK) then use
 pm = getPackageManager();
 pm.addPackageToPreferred(getPackageName());

in your activity's oncreate() method to make your home activity the
preferred home activity, that way your app will stay on when the home
button is pressed by the user.

remember remove that preference when your activity is stopped.

Jay

On Nov 11, 12:33 pm, hackbod <[EMAIL PROTECTED]> wrote:
> It didn't, it is a huge hack where it restarts itself when the user
> tries to leave it.  It's a cute hack for the toddler lock, but far
> from something any normal application should do.  (And seriously, the
> system -should- detect this and kill an app that is doing it.  I would
> consider the fact that toddler lock can do this to be a bug in the
> system.)
>
> On Nov 11, 8:33 am, zl25drexel <[EMAIL PROTECTED]> wrote:
>
> > anyone?
>
> > On Nov 10, 9:53 pm, zl25drexel <[EMAIL PROTECTED]> wrote:
>
> > > so how did the toddlers lockdisablethehomebutton?
>
> > > On Nov 10, 9:41 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
>
> > > > Not if the app starts on boot. (You can always boot in safe mode but
> > > > still... it's annoying.)
>
> > > > TheHomekey is the best way for the user to go back to a familiar
> > > > place. That's why pressingHometwice, no matter where you are, will
> > > > always take you back to the center screen onHome'sdesktop.
>
> > > > On Mon, Nov 10, 2008 at 6:26 PM, zl25drexel <[EMAIL PROTECTED]> wrote:
>
> > > > > you only need to restart the phone.
>
> > > > > On Nov 10, 8:51 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> > > > >> zl25drexel wrote:
> > > > >> > why is making the screen lock actually lock evil?
>
> > > > >> 1. If the app has a bug, and won't "unlock", the user is hosed
>
> > > > >> 2. If the app is malicious, and won't "unlock", the user is hosed
>
> > > > >> The Google team has tried to minimize any chance of a rogue 
> > > > >> application
> > > > >> causing problems, particularly permanent ones. This approach has
> > > > >> trade-offs; making it difficult todisablethehomebuttonis one of 
> > > > >> those.
>
> > > > >> --
> > > > >> Mark Murphy (a Commons Guy)http://commonsware.com
>
> > > > >> Android Training on the Ranch! -- Mar 16-20, 
> > > > >> 2009http://www.bignerdranch.com/schedule.shtml
>
> > > > --
> > > > Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Shares Preferences are not getting deleted

2008-11-11 Thread Sudha

Yes
it seems to be the same..
same case with your sqlite also..
since teh data is getting saved in data/data folder
and ur application in data/app folder
when u r deleting from ur emulator ( as far as I know)
we are deleting it from the data/app folder only
so the data wont getting deleted..

So I wanna know is there any specific apk or batch file in the device
which will delete all the application realted data once you remove the
apk...
?
experts plz help

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Signing Apps for a external testing group

2008-11-11 Thread hackbod

The certificate is only checked at install time, so if you create a
certificate that expires in 60 days that only prevents that .apk from
being installed after 60 days; any current installs will continue to
work.

And anyway, if someone wants to continue to use your app, they can
just take your .apk, and repackage and sign its contents with their
own certificate.

I would strongly recommend against using multiple certificates, since
if someone has the app installed with one certificate, to install
another version with a different certificate they will need to first
uninstall the current version, deleting all existing data.

On Nov 11, 8:16 am, WampBier <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I want to sign my application to let a group of tester install it to
> there mobiles.
> Is it possible to create certifications with limited time of use for
> the test people.
>
> Or can I use the existing signing method with a  validity period  from
> 60 days?
>
> I need a new certification, or?
>
> Is it possible to re-install a app with a different certification?
>
> Or should I give them the app with the dev-certification?
>
> Greetings
> WampBier
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: RingtoneManager question

2008-11-11 Thread Selmi

i guess i found solution. ID is not unique, ID with combination with
URI is (one of items with same id was external and one internal)
so i was wrong that both ringtones were created from music file - one
of them was bultin

On 11. Nov, 23:32 h., Selmi <[EMAIL PROTECTED]> wrote:
> hi
>
> i found what was problem with my application (thread differences
> between emulator (1.0rc1) and actual device (g1) ).
>
> problem is not with list of checkboxes, but somehow ringtone manager
> shows same id for two different ringtones! how its possible? both
> ringtones are created from music file and both have id 15
>
> RingtoneManager  mRingtoneManager=new RingtoneManager(this);
> mRingtoneManager.setIncludeDrm(true);
> Cursor cursor=mRingtoneManager.getCursor();
>
> now when i list cursor for id and title
>                         cursor.moveToPosition(position);
>                         long 
> realid=cursor.getLong(RingtoneManager.ID_COLUMN_INDEX);
>                         String 
> text=cursor.getString(RingtoneManager.TITLE_COLUMN_INDEX);
>
> i find that there are 2 ringtones with id 15 which have different
> title! how its possible? how can i distinct which alarm is which? by
> name?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: MediaRecorder on G1

2008-11-11 Thread cirion

Hi g1ster - are you running on the G1 or the emulator?  On the
emulator, I've followed the steps people described above, but still
run into the problem with constant AudioStreamInGeneric messages and
an eventual RuntimeException that says "start failed."  I don't see
anything in DDMS that indicates what the underlying problem might be;
I'm wondering if it just isn't supported on the emulator.

On Nov 10, 6:30 am, g1ster <[EMAIL PROTECTED]> wrote:
> Cool!!!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to send email programmatically?

2008-11-11 Thread Andrew Burgess
If you don't want to direct the user to the typical send form, then you're
going to have to either try and adapt an existing java based mailer to
android or write an SMTP client from scratch.  The SMTP standard isn't too
hard to implement.

On Tue, Nov 11, 2008 at 8:05 PM, Sunit Katkar <[EMAIL PROTECTED]> wrote:

> Any ideas? Any pointers to some examples?
>
>
> On Tue, Nov 11, 2008 at 9:42 AM, Sunit Katkar <[EMAIL PROTECTED]>wrote:
>
>> Suppose I have an Activity which has couple of text fields - one for the
>> subject and one for body text.
>> And there is a simple Button. When user clicks the button, I wish to send
>> the text in the textfields via email to a predetermined email address.
>> How can I achieve this?
>>
>> Sorry for being lazy and not looking up the SDK docs :)
>>
>> PS: I have configured the EMAIL app on G1 using the Email setup steps, so
>> it can receive and send email from my email account.
>>
>> --
>> - Sunit Katkar
>> http://sunitkatkar.blogspot.com/ - Android OS Tutorials
>>
>>
>
>
> --
> - Sunit Katkar
> http://sunitkatkar.blogspot.com/ - Android OS Tutorials
>
>
> >
>


-- 
Andrew Burgess

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: EditTextPreference mask passwords

2008-11-11 Thread Brian Yarger

Thanks!  I don't know why I didn't just try that, works great!

Brian

On Nov 11, 5:47 am, Christine <[EMAIL PROTECTED]> wrote:
> There's a "password" attribute you can use in the xml file.
>
> On Nov 11, 5:25 am, Brian Yarger <[EMAIL PROTECTED]> wrote:
>
> > I've got a userpreferencethat is apassword.  Is there a way to mask
> > the input like there is with an EditText component?  Or do I need to
> > subclass EditTextPreference to get this behavior?
>
> > Brian
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to send email programmatically?

2008-11-11 Thread Sunit Katkar
Any ideas? Any pointers to some examples?

On Tue, Nov 11, 2008 at 9:42 AM, Sunit Katkar <[EMAIL PROTECTED]> wrote:

> Suppose I have an Activity which has couple of text fields - one for the
> subject and one for body text.
> And there is a simple Button. When user clicks the button, I wish to send
> the text in the textfields via email to a predetermined email address.
> How can I achieve this?
>
> Sorry for being lazy and not looking up the SDK docs :)
>
> PS: I have configured the EMAIL app on G1 using the Email setup steps, so
> it can receive and send email from my email account.
>
> --
> - Sunit Katkar
> http://sunitkatkar.blogspot.com/ - Android OS Tutorials
>
>


-- 
- Sunit Katkar
http://sunitkatkar.blogspot.com/ - Android OS Tutorials

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: no callback to onItemClick() on clicking my ListView

2008-11-11 Thread Peli

You're right :-)
Omitting it works just as fine.

Peli

On Nov 11, 10:59 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
> The first line is useless :)
>
>
>
> On Tue, Nov 11, 2008 at 1:49 PM, Peli <[EMAIL PROTECTED]> wrote:
>
> > Thanks for the pointer. The following worked in my case:
>
> >        getListView().setAddStatesFromChildren(false);
> >        getListView().setItemsCanFocus(true);
>
> > It is tricky to find the right combination of settings that do what I
> > want :-)
>
> > Peli
>
> > On Nov 11, 6:05 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
> >> AlarmClock does not select the whole row. It uses two different
> >> widgets inside one list item. You can however give the highlight to
> >> the entire row by using android:addStatesFromChildren (or something
> >> similar, check the documentation of ViewGroup.)
>
> >> On Tue, Nov 11, 2008 at 8:46 AM, Peli <[EMAIL PROTECTED]> wrote:
>
> >> > I have a similar problem. I want to do something similar as the
> >> > AlarmClock application does (with CheckBox to the right, and clickable
> >> > area to the left). With the onClick listeners this works in touch
> >> > mode. Still, using the trackball, the whole row is selected. How can I
> >> > prevent that and have the clickable area and the checkbox be
> >> > selectable by trackball?
>
> >> > Peli
>
> >> > On Nov 11, 3:02 am, Romain Guy <[EMAIL PROTECTED]> wrote:
> >> >> Test trackball navigation then, it might not work.
>
> >> >> On Mon, Nov 10, 2008 at 5:24 PM, Nickname <[EMAIL PROTECTED]> wrote:
>
> >> >> > Hi, Romain and Sunit.
>
> >> >> > Thanks for replies from you both.
>
> >> >> > My app needs to get both callbacks from the Button as well as from
> >> >> > "the other area" of a ListView item.
>
> >> >> > Right now, I use a onClick listener to the LinearLayout of every
> >> >> > ListView item. It works so far :-)
>
> >> >> > On Nov 10, 8:34 am, Romain Guy <[EMAIL PROTECTED]> wrote:
> >> >> >> If you put a focusable View inside a list item, then the list item
> >> >> >> will not be clickable. You would have to set a click listener on the
> >> >> >> button for instance.
>
> >> >> >> On Sun, Nov 9, 2008 at 10:18 PM, Nickname <[EMAIL PROTECTED]> wrote:
>
> >> >> >> > One of my ListView's has a Button view on every item's 
> >> >> >> > LinearLayout.
>
> >> >> >> > I just found that clicking on any item of the ListView does not
> >> >> >> > callback its onItemClick(), which is set thru
> >> >> >> > ListView.setOnItemClickListener().
>
> >> >> >> > If I remove the Button view from item layout, callback is ok then.
>
> >> >> >> > Can anybody advise me how I get the callback on the ListView with
> >> >> >> > Button?
>
> >> >> >> > Thanks.
>
> >> >> >> --
> >> >> >> Romain Guywww.curious-creature.org
>
> >> >> --
> >> >> Romain Guywww.curious-creature.org
>
> >> --
> >> Romain Guywww.curious-creature.org
>
> --
> Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: InCallScreen is not public

2008-11-11 Thread hackbod

The in call screen is an implementation detail.  You need to use
Intent.ACTION_CALL and let the system find the proper activity to
launch.  (In fact the InCallScreen isn't even part of the frameworks,
it is part of the implementation of the phone app, so it would be
impossible to make public.)

On Nov 11, 2:42 pm, j <[EMAIL PROTECTED]> wrote:
> I want to pass the intent to InCallScreen directly so that my intent
> won't be intercepted by another app:
>
>         Intent newIntent = new Intent(Intent.ACTION_CALL, uri);
>         newIntent.putExtra(Intent.EXTRA_PHONE_NUMBER, number);
>         newIntent.setClass(this, InCallScreen.class);
>         newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
>         this.startActivity(newIntent);
>
> But InCallScreen is not in the public SDK 1.0.  Why is that?  Can we
> expect it to become public in a later SDK release?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Unique Emulator ID

2008-11-11 Thread Cadge

Is there a way to get a unique ID for different emulator instances
running on the same machine?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Any way to have two MediaRecorders recording at once?

2008-11-11 Thread Blake B.

Ok, I thought that may be the case.

I need to create a "sliding window" effect in the recording, so that
there is always 15 seconds of audio history recorded. I wanted to
stair-step two 20-second recorders so that every 5 seconds I would
delete one audio recording file when its "history" got too long, then
restart it. In this way, there would at most be two files of 20
seconds of audio on the SDcard and not get too large.

I can concatenate two .amr recordings, but I have to indroduce a 100ms
delay between stopping one recording and starting the next, otherwise
I get the same "Record channel already open" error.  This delay of
course causes a skip in the audio file where 100ms of audio is
omitted.

Since can't have two recorders recording, is there any way to:

- direct the audio recording stream to multiple files?
- buffer the audio recording so that I can manage the recording size
in-memory?
- other creative ideas to accomplish the "sliding window" effect?

Thanks

On Nov 11, 1:29 pm, Dave <[EMAIL PROTECTED]> wrote:
> No, this use case is not supported.
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Animation seems slow

2008-11-11 Thread Romain Guy

Because it's a lot of work to perform in software: you are compositing
a fullscreen scaled and translucent bitmap. Android does not offer 2D
hardware acceleration yet, so this kind of animation is expensive.

On Tue, Nov 11, 2008 at 2:29 PM, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>
> Is there a particular reason as to why it will be slow? I have a grid
> of only 6 images (each image (png) is about 40Kb).
>
> Rohit
>
>
> On Nov 11, 2:00 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
>> It depends on the rest of your UI. But if you're animating a
>> fullscreen GridView, it's gonna be slow on the G1 (unfortunately.)
>>
>>
>>
>> On Tue, Nov 11, 2008 at 1:27 PM, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>>
>> > Hmmm...ok - I thought that it might be trying to set the view to
>> > invisible while the animation is going on and that might cause some
>> > choppiness. You're saying that that is not the case? How can I make
>> > the animation smoother and snappier?
>>
>> > Rohit
>>
>> > On Nov 11, 1:18 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
>> >> Actually the way you did it earlier is simpler and is meant to work.
>> >> No need for a listener.
>>
>> >> On Tue, Nov 11, 2008 at 1:14 PM, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>>
>> >> > I moved to using an AnimationListener to make the view invisible at
>> >> > the end of the animation. That seems more correct now but it still
>> >> > doesn't improve the speed or smoothness (yes - i want to know how to
>> >> > do that too) of the animation.
>>
>> >> > Here is my listener :
>>
>> >> > class TestAnimListener implements AnimationListener {
>> >> >@Override
>> >> >public void onAnimationEnd(Animation arg0) {
>> >> >// TODO Auto-generated method stub
>> >> >gv.setVisibility(View.INVISIBLE);
>> >> >}
>>
>> >> >@Override
>> >> >public void onAnimationRepeat(Animation animation) {
>> >> >// TODO Auto-generated method stub
>>
>> >> >}
>>
>> >> >@Override
>> >> >public void onAnimationStart(Animation arg0) {
>> >> >// TODO Auto-generated method stub
>>
>> >> >}
>> >> > }
>>
>> >> > and I set it on the animation as follows:
>>
>> >> > a.setAnimationListener(new TestAnimListener());
>>
>> >> > Rohit
>>
>> >> > On Nov 11, 1:01 pm, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>> >> >> I have a Grid View and it has 6 jpeg images. I am applying a scale and
>> >> >> alpha animation to that grid and then at the end of the animation i
>> >> >> set the visibility of that view to invisible. The animation seems
>> >> >> slow. I tried to use an AccelerateInterpolator but that doesnt seem to
>> >> >> help. Is there a way to speed up the animation? Here is what my
>> >> >> animation looks like (testanim.xml)
>>
>> >> >> 
>> >> >> http://schemas.android.com/apk/res/android";>
>>
>> >> >> > >> >> android:duration="300" />
>>
>> >> >> > >> >> android:fromXScale="1.75" android:toXScale="1"
>> >> >> android:fromYScale="1.75" android:toYScale="1"
>> >> >> android:pivotX="50%" android:pivotY="50%" />
>>
>> >> >> 
>>
>> >> >> I load this animation in java as follows
>>
>> >> >> GridView gv = (GridView) findViewById(R.id.grid);
>> >> >> Animation a =  AnimationUtils.loadAnimation(this, R.anim.testanim);
>> >> >> a.setInterpolator(new LinearInterpolator());
>> >> >> gv.startAnimation(a);
>> >> >> gv.setVisibility(View.INVISIBLE);
>>
>> >> >> any ideas what I need to do to speed up the animation?
>>
>> >> --
>> >> Romain Guywww.curious-creature.org
>>
>> --
>> Romain Guywww.curious-creature.org
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Trouble with SoundPool

2008-11-11 Thread Michael


I'm in the same boat - I've got an app idea that needs to be able to
do realtime analysis of the sound being recorded - this doesn't seem
to be possible yet either.  I guess we can only hope for it in a later
revision, or work on adding such things in ourselves.


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



[android-developers] Re: progress dialog

2008-11-11 Thread Michael


The way I do this is how the market app does it - show a placeholder
image that's in your resources directory, then have a thread load the
real image and update when it's fetched that.

Not too hard to do.  You can also do this when the particular list row
is in view, see the samples, in the API Demos section, look for
List13.java.

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



[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread Mark Murphy

dreamerBoy wrote:
>> You could putter through the source code to see how the in-call
>> application handles it. Again, whatever technique it uses is probably
>> not for public consumption, your mileage may vary, do not taunt Happy
>> Fun Android, etc.
> 
> I thought that Android was supposed to be about empowering developers
> to create new breeds of applications.

It is.

However, Android is an open source project, and those who busted their 
asses to build the system get to call the shots at the outset -- not 
you, and not me. Just as Android's feature set will never ever ever meet 
everyone's needs, the decisions of those with commit authority will 
never ever ever meet everyone's needs. That's no different than any 
other open source project, whether started by 1 developer or 100.

At least with Android, there's a sign that non-OHA developers might get 
such authority:

http://source.android.com/project

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

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

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Animation seems slow

2008-11-11 Thread Rohit Mordani

ok - thanks !

Rohit


On Nov 11, 2:33 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
> Because it's a lot of work to perform in software: you are compositing
> a fullscreen scaled and translucent bitmap. Android does not offer 2D
> hardware acceleration yet, so this kind of animation is expensive.
>
>
>
> On Tue, Nov 11, 2008 at 2:29 PM, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>
> > Is there a particular reason as to why it will be slow? I have a grid
> > of only 6 images (each image (png) is about 40Kb).
>
> > Rohit
>
> > On Nov 11, 2:00 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
> >> It depends on the rest of your UI. But if you're animating a
> >> fullscreen GridView, it's gonna be slow on the G1 (unfortunately.)
>
> >> On Tue, Nov 11, 2008 at 1:27 PM, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>
> >> > Hmmm...ok - I thought that it might be trying to set the view to
> >> > invisible while the animation is going on and that might cause some
> >> > choppiness. You're saying that that is not the case? How can I make
> >> > the animation smoother and snappier?
>
> >> > Rohit
>
> >> > On Nov 11, 1:18 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
> >> >> Actually the way you did it earlier is simpler and is meant to work.
> >> >> No need for a listener.
>
> >> >> On Tue, Nov 11, 2008 at 1:14 PM, Rohit Mordani <[EMAIL PROTECTED]> 
> >> >> wrote:
>
> >> >> > I moved to using an AnimationListener to make the view invisible at
> >> >> > the end of the animation. That seems more correct now but it still
> >> >> > doesn't improve the speed or smoothness (yes - i want to know how to
> >> >> > do that too) of the animation.
>
> >> >> > Here is my listener :
>
> >> >> > class TestAnimListener implements AnimationListener {
> >> >> >       [EMAIL PROTECTED]
> >> >> >        public void onAnimationEnd(Animation arg0) {
> >> >> >                // TODO Auto-generated method stub
> >> >> >                gv.setVisibility(View.INVISIBLE);
> >> >> >        }
>
> >> >> >       [EMAIL PROTECTED]
> >> >> >        public void onAnimationRepeat(Animation animation) {
> >> >> >                // TODO Auto-generated method stub
>
> >> >> >        }
>
> >> >> >       [EMAIL PROTECTED]
> >> >> >        public void onAnimationStart(Animation arg0) {
> >> >> >                // TODO Auto-generated method stub
>
> >> >> >        }
> >> >> > }
>
> >> >> > and I set it on the animation as follows:
>
> >> >> > a.setAnimationListener(new TestAnimListener());
>
> >> >> > Rohit
>
> >> >> > On Nov 11, 1:01 pm, Rohit Mordani <[EMAIL PROTECTED]> wrote:
> >> >> >> I have a Grid View and it has 6 jpeg images. I am applying a scale 
> >> >> >> and
> >> >> >> alpha animation to that grid and then at the end of the animation i
> >> >> >> set the visibility of that view to invisible. The animation seems
> >> >> >> slow. I tried to use an AccelerateInterpolator but that doesnt seem 
> >> >> >> to
> >> >> >> help. Is there a way to speed up the animation? Here is what my
> >> >> >> animation looks like (testanim.xml)
>
> >> >> >> 
> >> >> >> http://schemas.android.com/apk/res/android";>
>
> >> >> >>          >> >> >>                 android:duration="300" />
>
> >> >> >>          >> >> >>                 android:fromXScale="1.75" android:toXScale="1"
> >> >> >>                 android:fromYScale="1.75" android:toYScale="1"
> >> >> >>                 android:pivotX="50%" android:pivotY="50%" />
>
> >> >> >> 
>
> >> >> >> I load this animation in java as follows
>
> >> >> >> GridView gv = (GridView) findViewById(R.id.grid);
> >> >> >> Animation a =  AnimationUtils.loadAnimation(this, R.anim.testanim);
> >> >> >> a.setInterpolator(new LinearInterpolator());
> >> >> >> gv.startAnimation(a);
> >> >> >> gv.setVisibility(View.INVISIBLE);
>
> >> >> >> any ideas what I need to do to speed up the animation?
>
> >> >> --
> >> >> Romain Guywww.curious-creature.org
>
> >> --
> >> Romain Guywww.curious-creature.org
>
> --
> Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] InCallScreen is not public

2008-11-11 Thread j

I want to pass the intent to InCallScreen directly so that my intent
won't be intercepted by another app:

Intent newIntent = new Intent(Intent.ACTION_CALL, uri);
newIntent.putExtra(Intent.EXTRA_PHONE_NUMBER, number);
newIntent.setClass(this, InCallScreen.class);
newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.startActivity(newIntent);

But InCallScreen is not in the public SDK 1.0.  Why is that?  Can we
expect it to become public in a later SDK release?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Trouble with SoundPool

2008-11-11 Thread Robert Green

Awesome.  I look forward to that.

Is there any talk of exposing the audio buffer for direct input to the
device?  I'd like to get started on the G1 Virtual Kazoo but you know
I need to synthesize that so without being able to "fling" my audio
somewhere, I can't do it :)

On Nov 11, 1:56 pm, Dave <[EMAIL PROTECTED]> wrote:
> I can't commit to a date, but I can tell you that it will be addressed
> in the next SDK release.
>
> On Nov 10, 1:27 pm, Robert Green <[EMAIL PROTECTED]> wrote:
>
> > Unfortunately it is the only suitable API for sounds in games at the
> > moment.  I tried to use MediaPlayers for mine and the performance and
> > player management was sub-par.  I had problems with it but after I
> > switched to OGGs they seemed to go away.  I'm prepared to retrofit my
> > games once the API is finalized but until then it's really the only
> > way to handle multiple triggered sounds well.
>
> > Dave - got an ETA on when that will be ready?  :)
>
> > On Nov 10, 1:52 pm, Dave <[EMAIL PROTECTED]> wrote:
>
> > > SoundPool is undocumented because it is not ready as a public API and
> > > is subject to change. There are serious problems with it including the
> > > likelihood that your application will deadlock if you attempt to use
> > > it. When it is ready, we will publish the API documentation.
>
> > > On Nov 9, 5:04 pm, g1bb <[EMAIL PROTECTED]> wrote:
>
> > > > This worked great. Thank you very much. The lack of documentation on
> > > > SoundPool is disturbting.
>
> > > > On Nov 9, 2:10 pm, Robert Green <[EMAIL PROTECTED]> wrote:
>
> > > > > Yeah there's something you need to know about SoundPool:  Init well
> > > > > before playing - that is, you need to know way ahead of time what
> > > > > sounds you will be using because it doesn't work well to play
> > > > > immediately after initializing.  I think they attempt to initialize
> > > > > asynchronously or something because I had problems when I tried to
> > > > > load and play back to back like you're trying there.
>
> > > > > When I use SoundPool, I load everything upon creation of the instance
> > > > > of the game then trigger the plays whenever I need them.  Here's my
> > > > > current code for SoundPoolSoundManager:
>
> > > > > public class SoundPoolSoundManager implements SoundManager {
> > > > >         private static final String TAG = "SoundPoolSoundManager";
>
> > > > >         public static final int SOUND_1 = 1;
>
> > > > >         private boolean enabled = true;
> > > > >         private Context context;
> > > > >         private SoundPool soundPool;
> > > > >         private HashMap soundPoolMap;
>
> > > > >         public SoundPoolSoundManager(Context context) {
> > > > >                 this.context = context;
> > > > >         }
>
> > > > >         public void reInit() {
> > > > >                 init();
> > > > >         }
>
> > > > >         public void init() {
> > > > >                 if (enabled) {
> > > > >                         Log.d(TAG, "Initializing new SoundPool");
> > > > >                         //re-init sound pool to work around bugs
> > > > >                         release();
> > > > >                         soundPool = new SoundPool(SOUNDPOOL_STREAMS,
> > > > > AudioManager.STREAM_MUSIC, 100);
> > > > >                         soundPoolMap = new HashMap > > > > Integer>();
> > > > >                         soundPoolMap.put(SOUND_1, 
> > > > > soundPool.load(context, R.raw.sound1,
> > > > > 1));
> > > > >                         Log.d(TAG, "SoundPool initialized");
> > > > >                 }
> > > > >         }
>
> > > > >         public void release() {
> > > > >                 if (soundPool != null) {
> > > > >                         Log.d(TAG, "Closing SoundPool");
> > > > >                         soundPool.release();
> > > > >                         soundPool = null;
> > > > >                         Log.d(TAG, "SoundPool closed");
> > > > >                         return;
> > > > >                 }
> > > > >         }
>
> > > > >         public void playSound(int sound) {
> > > > >                 if (soundPool != null) {
> > > > >                         Log.d(TAG, "Playing Sound " + sound);
> > > > >                         AudioManager mgr = (AudioManager)
> > > > > context.getSystemService(Context.AUDIO_SERVICE);
> > > > >                         int streamVolume = 
> > > > > mgr.getStreamVolume(AudioManager.STREAM_MUSIC);
> > > > >                         Integer soundId = soundPoolMap.get(sound);
> > > > >                         if (soundId != null) {
> > > > >                                 
> > > > > soundPool.play(soundPoolMap.get(sound), streamVolume,
> > > > > streamVolume, 1, 0, 1f);
> > > > >                         }
> > > > >                 }
> > > > >         }
>
> > > > >         public void setEnabled(boolean enabled) {
> > > > >                 this.enabled = enabled;
> > > > >         }
>
> > > > > }
>
> > > > > On Nov 9, 4:28 am, g1bb <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hell

[android-developers] RingtoneManager question

2008-11-11 Thread Selmi

hi

i found what was problem with my application (thread differences
between emulator (1.0rc1) and actual device (g1) ).

problem is not with list of checkboxes, but somehow ringtone manager
shows same id for two different ringtones! how its possible? both
ringtones are created from music file and both have id 15

RingtoneManager  mRingtoneManager=new RingtoneManager(this);
mRingtoneManager.setIncludeDrm(true);
Cursor cursor=mRingtoneManager.getCursor();

now when i list cursor for id and title
cursor.moveToPosition(position);
long 
realid=cursor.getLong(RingtoneManager.ID_COLUMN_INDEX);
String 
text=cursor.getString(RingtoneManager.TITLE_COLUMN_INDEX);

i find that there are 2 ringtones with id 15 which have different
title! how its possible? how can i distinct which alarm is which? by
name?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Animation seems slow

2008-11-11 Thread Rohit Mordani

Is there a particular reason as to why it will be slow? I have a grid
of only 6 images (each image (png) is about 40Kb).

Rohit


On Nov 11, 2:00 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
> It depends on the rest of your UI. But if you're animating a
> fullscreen GridView, it's gonna be slow on the G1 (unfortunately.)
>
>
>
> On Tue, Nov 11, 2008 at 1:27 PM, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>
> > Hmmm...ok - I thought that it might be trying to set the view to
> > invisible while the animation is going on and that might cause some
> > choppiness. You're saying that that is not the case? How can I make
> > the animation smoother and snappier?
>
> > Rohit
>
> > On Nov 11, 1:18 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
> >> Actually the way you did it earlier is simpler and is meant to work.
> >> No need for a listener.
>
> >> On Tue, Nov 11, 2008 at 1:14 PM, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>
> >> > I moved to using an AnimationListener to make the view invisible at
> >> > the end of the animation. That seems more correct now but it still
> >> > doesn't improve the speed or smoothness (yes - i want to know how to
> >> > do that too) of the animation.
>
> >> > Here is my listener :
>
> >> > class TestAnimListener implements AnimationListener {
> >> >       [EMAIL PROTECTED]
> >> >        public void onAnimationEnd(Animation arg0) {
> >> >                // TODO Auto-generated method stub
> >> >                gv.setVisibility(View.INVISIBLE);
> >> >        }
>
> >> >       [EMAIL PROTECTED]
> >> >        public void onAnimationRepeat(Animation animation) {
> >> >                // TODO Auto-generated method stub
>
> >> >        }
>
> >> >       [EMAIL PROTECTED]
> >> >        public void onAnimationStart(Animation arg0) {
> >> >                // TODO Auto-generated method stub
>
> >> >        }
> >> > }
>
> >> > and I set it on the animation as follows:
>
> >> > a.setAnimationListener(new TestAnimListener());
>
> >> > Rohit
>
> >> > On Nov 11, 1:01 pm, Rohit Mordani <[EMAIL PROTECTED]> wrote:
> >> >> I have a Grid View and it has 6 jpeg images. I am applying a scale and
> >> >> alpha animation to that grid and then at the end of the animation i
> >> >> set the visibility of that view to invisible. The animation seems
> >> >> slow. I tried to use an AccelerateInterpolator but that doesnt seem to
> >> >> help. Is there a way to speed up the animation? Here is what my
> >> >> animation looks like (testanim.xml)
>
> >> >> 
> >> >> http://schemas.android.com/apk/res/android";>
>
> >> >>          >> >>                 android:duration="300" />
>
> >> >>          >> >>                 android:fromXScale="1.75" android:toXScale="1"
> >> >>                 android:fromYScale="1.75" android:toYScale="1"
> >> >>                 android:pivotX="50%" android:pivotY="50%" />
>
> >> >> 
>
> >> >> I load this animation in java as follows
>
> >> >> GridView gv = (GridView) findViewById(R.id.grid);
> >> >> Animation a =  AnimationUtils.loadAnimation(this, R.anim.testanim);
> >> >> a.setInterpolator(new LinearInterpolator());
> >> >> gv.startAnimation(a);
> >> >> gv.setVisibility(View.INVISIBLE);
>
> >> >> any ideas what I need to do to speed up the animation?
>
> >> --
> >> Romain Guywww.curious-creature.org
>
> --
> Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: progress dialog

2008-11-11 Thread chouman82

Hi Christine,

Thanks for your help. That seems to only work in the initial loading
screen.  How do I go about doing the same when the user scroll to an
image that I am still loading and then show the loading progress bar.
Is there an example somewhere that i can follow?

thanks

On Nov 11, 4:45 am, Christine <[EMAIL PROTECTED]> wrote:
> At the start of your program, do
>         requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
>
> Then when you want to display a rotating little circle in the title
> bar, do
>                 setProgressBarIndeterminateVisibility(true);
>
> When updating or whatever is done, do
>                 setProgressBarIndeterminateVisibility(false);
>
> Of course, you can use other types of progress bars in pretty much the
> same way.
>
> On Nov 11, 9:00 am, chouman82 <[EMAIL PROTECTED]> wrote:
>
> > I am having a little problem of using progress dialog. Trying to
> > figure out how and the optimal way of using the progress dialog. My
> > application needs to grab information from different servers, so I am
> > trying to show the progress dialog at the appropriate moment.
>
> > I am trying to use a gallery to grab different images. At the start of
> > the activity, I will have a pop up that says loading, and then spin
> > off a different thread to start retrieving images in the background
> > and store the images in a bitmap array. And once I get the first few
> > images, the thread would send a message to the activity to let it know
> > that it can set up the adapter and start displaying the first few
> > images. The user then can start flipping through different images. In
> > the adapter getView method, I will check the bitmap array from the
> > thread to see if the image in the specific position that the user is
> > trying to view is loaded yet. If the bitmap array for the position is
> > null then the adapter will send a message to the activity and asks the
> > activity to display the progress dialog and at the same time the
> > adapter will tell the thread that the user is trying to view the image
> > at that specific position. Then the thread will then send a message to
> > the activity to dismiss the progress dialog once the image of that
> > specific position has been loaded.
>
> > That's the general idea, but for some reason the message been sent
> > from the adapter to the activity for showing the progress dialog is
> > not working. I can see the message been send because the logging is
> > been printed out in the message handler but the dialog is not showing
> > up. Anyone has a clue?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: How to get the Screen Width and Height?

2008-11-11 Thread Eric

You can get the size of the usable area by asking your activity's top-
level view (typically a layout object) for its width and height.  Make
sure your XML file defines an ID for it, then use getViewById to get
the view.  That width and height will be the screen size less the
status bar and title bar (if present), and will vary depending on the
device orientation.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread hackbod

On Nov 11, 11:35 am, dreamerBoy <[EMAIL PROTECTED]> wrote:
> Actually, thank you - you WERE correct - onCreate is NOT being called
> for this Activity.
>
> I tried doing a wait() for 5  - then 30 seconds on the onCreate
> callback being called - the wait timed out...  Hmmm how to force
> an Activity to properly initialize itself.

Wait isn't going to do anything, because all application components
are called from them main thread.  So if you block in one of the
callbacks, none of the others will run either.

See the section on threads here: 
http://code.google.com/android/intro/appmodel.html

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Animation seems slow

2008-11-11 Thread Romain Guy

It depends on the rest of your UI. But if you're animating a
fullscreen GridView, it's gonna be slow on the G1 (unfortunately.)

On Tue, Nov 11, 2008 at 1:27 PM, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>
> Hmmm...ok - I thought that it might be trying to set the view to
> invisible while the animation is going on and that might cause some
> choppiness. You're saying that that is not the case? How can I make
> the animation smoother and snappier?
>
> Rohit
>
>
> On Nov 11, 1:18 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
>> Actually the way you did it earlier is simpler and is meant to work.
>> No need for a listener.
>>
>>
>>
>> On Tue, Nov 11, 2008 at 1:14 PM, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>>
>> > I moved to using an AnimationListener to make the view invisible at
>> > the end of the animation. That seems more correct now but it still
>> > doesn't improve the speed or smoothness (yes - i want to know how to
>> > do that too) of the animation.
>>
>> > Here is my listener :
>>
>> > class TestAnimListener implements AnimationListener {
>> >@Override
>> >public void onAnimationEnd(Animation arg0) {
>> >// TODO Auto-generated method stub
>> >gv.setVisibility(View.INVISIBLE);
>> >}
>>
>> >@Override
>> >public void onAnimationRepeat(Animation animation) {
>> >// TODO Auto-generated method stub
>>
>> >}
>>
>> >@Override
>> >public void onAnimationStart(Animation arg0) {
>> >// TODO Auto-generated method stub
>>
>> >}
>> > }
>>
>> > and I set it on the animation as follows:
>>
>> > a.setAnimationListener(new TestAnimListener());
>>
>> > Rohit
>>
>> > On Nov 11, 1:01 pm, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>> >> I have a Grid View and it has 6 jpeg images. I am applying a scale and
>> >> alpha animation to that grid and then at the end of the animation i
>> >> set the visibility of that view to invisible. The animation seems
>> >> slow. I tried to use an AccelerateInterpolator but that doesnt seem to
>> >> help. Is there a way to speed up the animation? Here is what my
>> >> animation looks like (testanim.xml)
>>
>> >> 
>> >> http://schemas.android.com/apk/res/android";>
>>
>> >> > >> android:duration="300" />
>>
>> >> > >> android:fromXScale="1.75" android:toXScale="1"
>> >> android:fromYScale="1.75" android:toYScale="1"
>> >> android:pivotX="50%" android:pivotY="50%" />
>>
>> >> 
>>
>> >> I load this animation in java as follows
>>
>> >> GridView gv = (GridView) findViewById(R.id.grid);
>> >> Animation a =  AnimationUtils.loadAnimation(this, R.anim.testanim);
>> >> a.setInterpolator(new LinearInterpolator());
>> >> gv.startAnimation(a);
>> >> gv.setVisibility(View.INVISIBLE);
>>
>> >> any ideas what I need to do to speed up the animation?
>>
>> --
>> Romain Guywww.curious-creature.org
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: no callback to onItemClick() on clicking my ListView

2008-11-11 Thread Romain Guy

The first line is useless :)

On Tue, Nov 11, 2008 at 1:49 PM, Peli <[EMAIL PROTECTED]> wrote:
>
> Thanks for the pointer. The following worked in my case:
>
>getListView().setAddStatesFromChildren(false);
>getListView().setItemsCanFocus(true);
>
> It is tricky to find the right combination of settings that do what I
> want :-)
>
> Peli
>
> On Nov 11, 6:05 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
>> AlarmClock does not select the whole row. It uses two different
>> widgets inside one list item. You can however give the highlight to
>> the entire row by using android:addStatesFromChildren (or something
>> similar, check the documentation of ViewGroup.)
>>
>>
>>
>> On Tue, Nov 11, 2008 at 8:46 AM, Peli <[EMAIL PROTECTED]> wrote:
>>
>> > I have a similar problem. I want to do something similar as the
>> > AlarmClock application does (with CheckBox to the right, and clickable
>> > area to the left). With the onClick listeners this works in touch
>> > mode. Still, using the trackball, the whole row is selected. How can I
>> > prevent that and have the clickable area and the checkbox be
>> > selectable by trackball?
>>
>> > Peli
>>
>> > On Nov 11, 3:02 am, Romain Guy <[EMAIL PROTECTED]> wrote:
>> >> Test trackball navigation then, it might not work.
>>
>> >> On Mon, Nov 10, 2008 at 5:24 PM, Nickname <[EMAIL PROTECTED]> wrote:
>>
>> >> > Hi, Romain and Sunit.
>>
>> >> > Thanks for replies from you both.
>>
>> >> > My app needs to get both callbacks from the Button as well as from
>> >> > "the other area" of a ListView item.
>>
>> >> > Right now, I use a onClick listener to the LinearLayout of every
>> >> > ListView item. It works so far :-)
>>
>> >> > On Nov 10, 8:34 am, Romain Guy <[EMAIL PROTECTED]> wrote:
>> >> >> If you put a focusable View inside a list item, then the list item
>> >> >> will not be clickable. You would have to set a click listener on the
>> >> >> button for instance.
>>
>> >> >> On Sun, Nov 9, 2008 at 10:18 PM, Nickname <[EMAIL PROTECTED]> wrote:
>>
>> >> >> > One of my ListView's has a Button view on every item's LinearLayout.
>>
>> >> >> > I just found that clicking on any item of the ListView does not
>> >> >> > callback its onItemClick(), which is set thru
>> >> >> > ListView.setOnItemClickListener().
>>
>> >> >> > If I remove the Button view from item layout, callback is ok then.
>>
>> >> >> > Can anybody advise me how I get the callback on the ListView with
>> >> >> > Button?
>>
>> >> >> > Thanks.
>>
>> >> >> --
>> >> >> Romain Guywww.curious-creature.org
>>
>> >> --
>> >> Romain Guywww.curious-creature.org
>>
>> --
>> Romain Guywww.curious-creature.org
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: java.rmi.RemoteException

2008-11-11 Thread Michael


Um, what does downloading jar files have to do with this exception?
Perhaps you could post the code in question?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: no callback to onItemClick() on clicking my ListView

2008-11-11 Thread Peli

Thanks for the pointer. The following worked in my case:

getListView().setAddStatesFromChildren(false);
getListView().setItemsCanFocus(true);

It is tricky to find the right combination of settings that do what I
want :-)

Peli

On Nov 11, 6:05 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
> AlarmClock does not select the whole row. It uses two different
> widgets inside one list item. You can however give the highlight to
> the entire row by using android:addStatesFromChildren (or something
> similar, check the documentation of ViewGroup.)
>
>
>
> On Tue, Nov 11, 2008 at 8:46 AM, Peli <[EMAIL PROTECTED]> wrote:
>
> > I have a similar problem. I want to do something similar as the
> > AlarmClock application does (with CheckBox to the right, and clickable
> > area to the left). With the onClick listeners this works in touch
> > mode. Still, using the trackball, the whole row is selected. How can I
> > prevent that and have the clickable area and the checkbox be
> > selectable by trackball?
>
> > Peli
>
> > On Nov 11, 3:02 am, Romain Guy <[EMAIL PROTECTED]> wrote:
> >> Test trackball navigation then, it might not work.
>
> >> On Mon, Nov 10, 2008 at 5:24 PM, Nickname <[EMAIL PROTECTED]> wrote:
>
> >> > Hi, Romain and Sunit.
>
> >> > Thanks for replies from you both.
>
> >> > My app needs to get both callbacks from the Button as well as from
> >> > "the other area" of a ListView item.
>
> >> > Right now, I use a onClick listener to the LinearLayout of every
> >> > ListView item. It works so far :-)
>
> >> > On Nov 10, 8:34 am, Romain Guy <[EMAIL PROTECTED]> wrote:
> >> >> If you put a focusable View inside a list item, then the list item
> >> >> will not be clickable. You would have to set a click listener on the
> >> >> button for instance.
>
> >> >> On Sun, Nov 9, 2008 at 10:18 PM, Nickname <[EMAIL PROTECTED]> wrote:
>
> >> >> > One of my ListView's has a Button view on every item's LinearLayout.
>
> >> >> > I just found that clicking on any item of the ListView does not
> >> >> > callback its onItemClick(), which is set thru
> >> >> > ListView.setOnItemClickListener().
>
> >> >> > If I remove the Button view from item layout, callback is ok then.
>
> >> >> > Can anybody advise me how I get the callback on the ListView with
> >> >> > Button?
>
> >> >> > Thanks.
>
> >> >> --
> >> >> Romain Guywww.curious-creature.org
>
> >> --
> >> Romain Guywww.curious-creature.org
>
> --
> Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem with Service Permission

2008-11-11 Thread hackbod

Be sure you install the .apk providing the permission before the one
using it.  You can see what permissions your app has been granted by
digging through the output of "adb shell dumpsys package".

Also PLEASE DO NOT use the name "android.permission."  The namespaces
"android.* and "com.android.*" are reserved for the android platforms,
and applications MUST NOT USE THEM.

On Nov 11, 11:43 am, Raktim Das <[EMAIL PROTECTED]> wrote:
> Thanks a lot for analyzing the problem.
>
> First, my comment on your second point -
> This I had already been doing - as in the client application's
> manifest, the service application's manifest too has this entry under
> the manifest tag:
>  android:name="android.permission.ACCESS_BACKGROUND_SERVICE" />
>
> Now coming to the first point, I changed the client code line from -
> Intent intent = new Intent(this,
> com.abc.xyz.service.BackgroundService.class);
> to
> Intent intent = new Intent("com.abc.xyz.service.BackgroundService");
>
> After the change, it seems the service is identified and the earlier
> warning message -
> "Unable to start service Intent{ comp={com.abc.xyz.client/
> com.abc.xyz.service.BackgroundService} }:not found "
> is not coming.
> But then the permission related SecurityException is coming at the
> client statement "startService(intent)" as below:
>
> - WARN/PackageManager(57): Not granting permission
> android.permission.ACCESS_BACKGROUND_SERVICE to package
> com.abc.xyz.client (protectionLevel=3 flags=0x44)
> - ERROR/AndroidRuntime(): ERROR: thread attach failed
> - WARN/ActivityManager(57): Permission Denial: Accessing service
> ComponentInfo{com.abc.xyz/com.abc.xyz.service.BackgroundService} from
> pid=57, uid=1000 requires android.permission.ACCESS_BACKGROUND_SERVICE
> - ERROR/AndroidRuntime(1120): java.lang.RuntimeException: Unable to
> start activity ComponentInfo{com.abc.xyz.client/
> com.abc.xyz.client.ClientActivity}: java.lang.SecurityException: Not
> allowed to start service Intent
> { action=com.abc.xyz.service.BackgroundService } without permission
> android.permission.ACCESS_BACKGROUND_SERVICE
>
> I think I am missing something with the declaration of permission in
> the manifest(s). What is your opinion?
>
> Thanks,
> Raktim.
>
> On Nov 11, 4:48 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > The Intent you are making to bind to the service is trying to find a
> > component in your own .apk, not the other.
>
> > The last permission error you mention is because you need to
> > explicitly request to use even your own permissions.
>
> > On Nov 10, 9:31 pm, Raktim Das <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
> > > I am using 0.9 beta SDK.
> > > I want to have a service defined within one application to be
> > > invokable from another.
> > > The application hosting the service has, in its manifest, the
> > > following inside the application tag:
>
> > >  > > android:process=":remote"  android:exported="true"
> > > android:permission="android.permission.ACCESS_BACKGROUND_SERVICE">
> > >         
> > >                  > > android:name="com.abc.xyz.service.BackgroundService" />
> > >         
> > > 
>
> > > It also has the following inside the manifest tag:
> > >  > > android:protectionLevel="dangerous"/>
>
> > > In my client application's manifest xml file, I have the following
> > > inside manifest tag:
> > >  > > android:name="android.permission.ACCESS_BACKGROUND_SERVICE" />
>
> > > The client Activity code has the following API called from its
> > > onCreate() method:
>
> > >     private void startBackgroundService()
> > >     {
> > >         mConnection = new ServiceConnection()
> > >         {
> > >             public void onServiceConnected(ComponentName className,
> > > IBinder service)
> > >             {
> > >                 Log.i(TAG, "Connected to background service");
> > >                 mService =
> > > BackgroundService.Stub.asInterface(service);
> > >             }
>
> > >             public void onServiceDisconnected(ComponentName className)
> > >             {
> > >                 mService = null;
> > >                 Log.i(TAG, "Background service disconnected");
> > >             }
> > >         };
>
> > >         Intent intent = new Intent(this,
> > >                 com.abc.xyz.service.BackgroundService.class);
>
> > >         startService(intent);
>
> > >         boolean result = bindService(intent, mConnection,
> > > Context.BIND_AUTO_CREATE);
>
> > >         Log.i(TAG, "Background service bind result:  " + result);
> > >     }
>
> > > When I run the client Activity, it can not bind to the service:
> > > - the log statement at the end has "Background service bind result:
> > > false".
> > > - the onServiceConnected() method is not called
> > > - There is a waring log from ActivityManager:
> > > WARN/ActivityManager(58): Unable to start service Intent
> > > { comp={com.abc.xyz.client/com.abc.xyz.service.BackgroundService} }:
> > > not found
>
> > > I have tried running the same without any permission in the service

[android-developers] Re: AlarmManager.RTC_WAKEUP Not Waking Device?

2008-11-11 Thread hackbod

Yes, for both these things, you need to hold a partial wake lock to
keep the phone from turning off.

On Nov 11, 12:02 pm, g1bb <[EMAIL PROTECTED]> wrote:
> Maybe PARTIAL_WAKE_LOCK, looking at it now... interesting.
>
> On Nov 11, 10:45 am, g1bb <[EMAIL PROTECTED]> wrote:
>
> > Another question on this:
>
> > Have you seen the Stopwatch application developed by Tom Taylor? I
> > just downloaded it, and it keeps counting after the phone is put to
> > sleep entirely. Any ideas on how he's doing that? I'm looking for that
> > kind of functionality.
>
> > Thanks again.
>
> > On Nov 11, 3:51 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > It does wake it up, but you are going to need to hold a wake lock to
> > > keep the device awake after your intent receiver returns.
>
> > > On Nov 10, 11:14 pm,g1bb<[EMAIL PROTECTED]> wrote:
>
> > > > Hello,
>
> > > > I've been trying to use AlarmManager.RTC_WAKEUP to wake up my device
> > > > while it's sleeping, and then play some sounds. It seems like when
> > > > it's charging, this works fine, but when it's not, the service doesn't
> > > > start until I hit the menu button and am presented with the lock
> > > > screen.
>
> > > > Also, this seems to be working fine in the emulator, but not my real
> > > > phone.
>
> > > > Here's the alarm scheduling:
> > > >                   ntent intent = new Intent(Main.this, 
> > > > OneShotAlarm.class);
> > > >                   PendingIntent sender =
> > > > PendingIntent.getBroadcast(Main.this, 0, intent, 0);
>
> > > >                     // We want the alarm to go off 30 seconds from now.
> > > >                     Calendar calendar = Calendar.getInstance();
> > > >                     
> > > > calendar.setTimeInMillis(System.currentTimeMillis());
> > > >                     calendar.add(Calendar.SECOND, 60);
>
> > > >                     // Schedule the alarm!
> > > >                     AlarmManager am =
> > > > (AlarmManager)getSystemService(ALARM_SERVICE);
> > > >                     am.set(AlarmManager.RTC_WAKEUP,
> > > > calendar.getTimeInMillis(), sender);
> > > > -
> > > > The OneShotAlarm BroadCastReceiver:
>
> > > > public class OneShotAlarm extends BroadcastReceiver
> > > > {
>
> > > >     @Override
> > > >     public void onReceive(Context context, Intent intent)
> > > >     {
> > > >         Toast.makeText(context, "OneShotAlarm Broadcast invoked",
> > > > 1000).show();
>
> > > >           intent = new Intent(context, ServiceClassToRun.class);
>
> > > >          context.startService(intent);
> > > >      }
> > > > -
> > > > The Service:
>
> > > > public class ServiceClassToRun extends Service {
> > > >         protected static final int Rnd = 0;
>
> > > >          public void onStart(Intent intent, int startId) {
> > > >          //do some business here
> > > >      }
> > > > -
> > > > And finally, my manifest:
>
> > > >  
> > > >  
>
> > > > Any ideas are greatly appreciated. Has anyone else experienced this as
> > > > well? Thanks in advance.- 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Animation seems slow

2008-11-11 Thread Rohit Mordani

Hmmm...ok - I thought that it might be trying to set the view to
invisible while the animation is going on and that might cause some
choppiness. You're saying that that is not the case? How can I make
the animation smoother and snappier?

Rohit


On Nov 11, 1:18 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
> Actually the way you did it earlier is simpler and is meant to work.
> No need for a listener.
>
>
>
> On Tue, Nov 11, 2008 at 1:14 PM, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>
> > I moved to using an AnimationListener to make the view invisible at
> > the end of the animation. That seems more correct now but it still
> > doesn't improve the speed or smoothness (yes - i want to know how to
> > do that too) of the animation.
>
> > Here is my listener :
>
> > class TestAnimListener implements AnimationListener {
> >       [EMAIL PROTECTED]
> >        public void onAnimationEnd(Animation arg0) {
> >                // TODO Auto-generated method stub
> >                gv.setVisibility(View.INVISIBLE);
> >        }
>
> >       [EMAIL PROTECTED]
> >        public void onAnimationRepeat(Animation animation) {
> >                // TODO Auto-generated method stub
>
> >        }
>
> >       [EMAIL PROTECTED]
> >        public void onAnimationStart(Animation arg0) {
> >                // TODO Auto-generated method stub
>
> >        }
> > }
>
> > and I set it on the animation as follows:
>
> > a.setAnimationListener(new TestAnimListener());
>
> > Rohit
>
> > On Nov 11, 1:01 pm, Rohit Mordani <[EMAIL PROTECTED]> wrote:
> >> I have a Grid View and it has 6 jpeg images. I am applying a scale and
> >> alpha animation to that grid and then at the end of the animation i
> >> set the visibility of that view to invisible. The animation seems
> >> slow. I tried to use an AccelerateInterpolator but that doesnt seem to
> >> help. Is there a way to speed up the animation? Here is what my
> >> animation looks like (testanim.xml)
>
> >> 
> >> http://schemas.android.com/apk/res/android";>
>
> >>          >>                 android:duration="300" />
>
> >>          >>                 android:fromXScale="1.75" android:toXScale="1"
> >>                 android:fromYScale="1.75" android:toYScale="1"
> >>                 android:pivotX="50%" android:pivotY="50%" />
>
> >> 
>
> >> I load this animation in java as follows
>
> >> GridView gv = (GridView) findViewById(R.id.grid);
> >> Animation a =  AnimationUtils.loadAnimation(this, R.anim.testanim);
> >> a.setInterpolator(new LinearInterpolator());
> >> gv.startAnimation(a);
> >> gv.setVisibility(View.INVISIBLE);
>
> >> any ideas what I need to do to speed up the animation?
>
> --
> Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Animation seems slow

2008-11-11 Thread Romain Guy

Actually the way you did it earlier is simpler and is meant to work.
No need for a listener.

On Tue, Nov 11, 2008 at 1:14 PM, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>
> I moved to using an AnimationListener to make the view invisible at
> the end of the animation. That seems more correct now but it still
> doesn't improve the speed or smoothness (yes - i want to know how to
> do that too) of the animation.
>
> Here is my listener :
>
> class TestAnimListener implements AnimationListener {
>@Override
>public void onAnimationEnd(Animation arg0) {
>// TODO Auto-generated method stub
>gv.setVisibility(View.INVISIBLE);
>}
>
>@Override
>public void onAnimationRepeat(Animation animation) {
>// TODO Auto-generated method stub
>
>}
>
>@Override
>public void onAnimationStart(Animation arg0) {
>// TODO Auto-generated method stub
>
>}
> }
>
> and I set it on the animation as follows:
>
> a.setAnimationListener(new TestAnimListener());
>
> Rohit
>
>
> On Nov 11, 1:01 pm, Rohit Mordani <[EMAIL PROTECTED]> wrote:
>> I have a Grid View and it has 6 jpeg images. I am applying a scale and
>> alpha animation to that grid and then at the end of the animation i
>> set the visibility of that view to invisible. The animation seems
>> slow. I tried to use an AccelerateInterpolator but that doesnt seem to
>> help. Is there a way to speed up the animation? Here is what my
>> animation looks like (testanim.xml)
>>
>> 
>> http://schemas.android.com/apk/res/android";>
>>
>> > android:duration="300" />
>>
>> > android:fromXScale="1.75" android:toXScale="1"
>> android:fromYScale="1.75" android:toYScale="1"
>> android:pivotX="50%" android:pivotY="50%" />
>>
>> 
>>
>> I load this animation in java as follows
>>
>> GridView gv = (GridView) findViewById(R.id.grid);
>> Animation a =  AnimationUtils.loadAnimation(this, R.anim.testanim);
>> a.setInterpolator(new LinearInterpolator());
>> gv.startAnimation(a);
>> gv.setVisibility(View.INVISIBLE);
>>
>> any ideas what I need to do to speed up the animation?
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] java.rmi.RemoteException

2008-11-11 Thread Avinash Patil
Hi,
How to remove java.rmi.RemoteException in android.
Can you please suggest link from where I can download supporting JAR files
into eclipse - anroid platform.

Thanks,
Avi.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Animation seems slow

2008-11-11 Thread Rohit Mordani

I moved to using an AnimationListener to make the view invisible at
the end of the animation. That seems more correct now but it still
doesn't improve the speed or smoothness (yes - i want to know how to
do that too) of the animation.

Here is my listener :

class TestAnimListener implements AnimationListener {
@Override
public void onAnimationEnd(Animation arg0) {
// TODO Auto-generated method stub
gv.setVisibility(View.INVISIBLE);
}

@Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub

}

@Override
public void onAnimationStart(Animation arg0) {
// TODO Auto-generated method stub

}
}

and I set it on the animation as follows:

a.setAnimationListener(new TestAnimListener());

Rohit


On Nov 11, 1:01 pm, Rohit Mordani <[EMAIL PROTECTED]> wrote:
> I have a Grid View and it has 6 jpeg images. I am applying a scale and
> alpha animation to that grid and then at the end of the animation i
> set the visibility of that view to invisible. The animation seems
> slow. I tried to use an AccelerateInterpolator but that doesnt seem to
> help. Is there a way to speed up the animation? Here is what my
> animation looks like (testanim.xml)
>
> 
> http://schemas.android.com/apk/res/android";>
>
>                          android:duration="300" />
>
>                          android:fromXScale="1.75" android:toXScale="1"
>                 android:fromYScale="1.75" android:toYScale="1"
>                 android:pivotX="50%" android:pivotY="50%" />
>
> 
>
> I load this animation in java as follows
>
> GridView gv = (GridView) findViewById(R.id.grid);
> Animation a =  AnimationUtils.loadAnimation(this, R.anim.testanim);
> a.setInterpolator(new LinearInterpolator());
> gv.startAnimation(a);
> gv.setVisibility(View.INVISIBLE);
>
> any ideas what I need to do to speed up the animation?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Animation seems slow

2008-11-11 Thread Rohit Mordani

I have a Grid View and it has 6 jpeg images. I am applying a scale and
alpha animation to that grid and then at the end of the animation i
set the visibility of that view to invisible. The animation seems
slow. I tried to use an AccelerateInterpolator but that doesnt seem to
help. Is there a way to speed up the animation? Here is what my
animation looks like (testanim.xml)


http://schemas.android.com/apk/res/android";>







I load this animation in java as follows

GridView gv = (GridView) findViewById(R.id.grid);
Animation a =  AnimationUtils.loadAnimation(this, R.anim.testanim);
a.setInterpolator(new LinearInterpolator());
gv.startAnimation(a);
gv.setVisibility(View.INVISIBLE);


any ideas what I need to do to speed up the animation?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Text mask

2008-11-11 Thread zl25drexel

all right, answering my own question again.
i figured out how to achieve that effect, adjust the matrix and the
gradient parameter to adjust effect to your own liking.

txtPaint = new Paint();
txtPaint.setColor(Color.GRAY);
txtPaint.setAntiAlias(true);
txtPaint.setTextSize(25);
shader = new LinearGradient(0, 0, 200, 0,
   new int[]{Color.argb(255, 120, 120, 120),
Color.argb(255, 120, 120, 120), Color.argb(255, 255, 255, 255)}, new
float[]{0, 0.7f, 1}, TileMode.MIRROR);
txtPaint.setShader(shader);

@Override
protected void onDraw(Canvas canvas) {
long now = System.currentTimeMillis();
float elapsed = (now - lastTime)/7;
dx+= elapsed;
Matrix matrix = new Matrix();
matrix.setTranslate(dx, 0);
shader.setLocalMatrix(matrix);
canvas.drawText("Text mask effect", 0, 25, txtPaint);
lastTime = now;
invalidate();
}

On Nov 11, 11:39 am, zl25drexel <[EMAIL PROTECTED]> wrote:
> Do you have any example codes? Themaskgradient is not clipped over
> thetext.
>
> On Nov 11, 11:35 am, Romain Guy <[EMAIL PROTECTED]> wrote:
>
> > That's how to do it. What did you do exactly?
>
> > On Tue, Nov 11, 2008 at 8:33 AM, zl25drexel <[EMAIL PROTECTED]> wrote:
>
> > > Didnt work for me. Any other suggestions?
>
> > > On Nov 8, 3:09 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
> > >> Hi,
>
> > >> You would need to draw thetextmanually on a Canvas object (from the
> > >> onDraw() method of your View for instance.) Then, in the Paint you use
> > >> to draw thetext, simply set a linear gradient shader. All you have to
> > >> do is animate the coordinates of the shader to make it look like it's
> > >> moving and you'll get the desired effect.
>
> > >> On Sat, Nov 8, 2008 at 12:03 PM, zl25drexel <[EMAIL PROTECTED]> wrote:
>
> > >> > Hi, does anyone know how to dotextmaskeffect in android?
>
> > >> > like the below in flash
> > >> >http://www.entheosweb.com/Flash/video_tutorials/shining_text_effect.asp
>
> > >> > thanks,
>
> > >> --
> > >> Romain Guywww.curious-creature.org
>
> > --
> > Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: AlarmManager.RTC_WAKEUP Not Waking Device?

2008-11-11 Thread g1bb

Maybe PARTIAL_WAKE_LOCK, looking at it now... interesting.

On Nov 11, 10:45 am, g1bb <[EMAIL PROTECTED]> wrote:
> Another question on this:
>
> Have you seen the Stopwatch application developed by Tom Taylor? I
> just downloaded it, and it keeps counting after the phone is put to
> sleep entirely. Any ideas on how he's doing that? I'm looking for that
> kind of functionality.
>
> Thanks again.
>
> On Nov 11, 3:51 am, hackbod <[EMAIL PROTECTED]> wrote:
>
>
>
> > It does wake it up, but you are going to need to hold a wake lock to
> > keep the device awake after your intent receiver returns.
>
> > On Nov 10, 11:14 pm,g1bb<[EMAIL PROTECTED]> wrote:
>
> > > Hello,
>
> > > I've been trying to use AlarmManager.RTC_WAKEUP to wake up my device
> > > while it's sleeping, and then play some sounds. It seems like when
> > > it's charging, this works fine, but when it's not, the service doesn't
> > > start until I hit the menu button and am presented with the lock
> > > screen.
>
> > > Also, this seems to be working fine in the emulator, but not my real
> > > phone.
>
> > > Here's the alarm scheduling:
> > >                   ntent intent = new Intent(Main.this, 
> > > OneShotAlarm.class);
> > >                   PendingIntent sender =
> > > PendingIntent.getBroadcast(Main.this, 0, intent, 0);
>
> > >                     // We want the alarm to go off 30 seconds from now.
> > >                     Calendar calendar = Calendar.getInstance();
> > >                     calendar.setTimeInMillis(System.currentTimeMillis());
> > >                     calendar.add(Calendar.SECOND, 60);
>
> > >                     // Schedule the alarm!
> > >                     AlarmManager am =
> > > (AlarmManager)getSystemService(ALARM_SERVICE);
> > >                     am.set(AlarmManager.RTC_WAKEUP,
> > > calendar.getTimeInMillis(), sender);
> > > -
> > > The OneShotAlarm BroadCastReceiver:
>
> > > public class OneShotAlarm extends BroadcastReceiver
> > > {
>
> > >     @Override
> > >     public void onReceive(Context context, Intent intent)
> > >     {
> > >         Toast.makeText(context, "OneShotAlarm Broadcast invoked",
> > > 1000).show();
>
> > >           intent = new Intent(context, ServiceClassToRun.class);
>
> > >          context.startService(intent);
> > >      }
> > > -
> > > The Service:
>
> > > public class ServiceClassToRun extends Service {
> > >         protected static final int Rnd = 0;
>
> > >          public void onStart(Intent intent, int startId) {
> > >          //do some business here
> > >      }
> > > -
> > > And finally, my manifest:
>
> > >  
> > >  
>
> > > Any ideas are greatly appreciated. Has anyone else experienced this as
> > > well? Thanks in advance.- 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread dreamerBoy

Battle of the quotes, from:

http://code.google.com/android/reference/android/app/Service.html

"Other application components running in the same process as the
service (such as an Activity) can, of course, increase the importance
of the overall process beyond just the importance of the service
itself. "

This is like trying to interpret the Talmud or something... ;-)

On Nov 10, 6:12 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> dreamerBoywrote:
> > Thanks for the reply, Mark (I recognize the name - I read your book.)
>
> Thanks!
>
> > I am trying to place a call with the Activity that may - but need not,
> > have any graphical UI aspect to it.  Launching an Activity appears to
> > be the only way to place a call in Android 1.0.  If the thinking of
> > the API is to disallow any calls being placed in an automated fashion,
> > it seems to me that there would be no need for ACTION_CALL - only
> > ACTION_DIAL.
>
> In the ACTION_CALL documentation, it states:
>
> "Note: there will be restrictions on which applications can initiate a
> call; most applications should use the ACTION_DIAL."
>
> So even if you can get past the NullPointerException, you may still not
> be able to place the call.
>
> Now, probably it will work, as there have been recent tutorials
> demonstrating that it works from an activity, but I could see where this
> might get locked down sometime in the future.
>
> > I am also wondering if there exists within the exposed Android API, a
> > way to hang up a call in an automated fashion.  No appropriate intents
> > exist - it seems the only remaining possibility is calling finish() or
> > finishActivity(ACTIVITY_ID) on the Activity used to place or answer
> > the call.  However, there is nothing in the docs which actually states
> > that.  If I can get past my currently difficulty, I will definitely
> > test it.
>
> You could putter through the source code to see how the in-call
> application handles it. Again, whatever technique it uses is probably
> not for public consumption, your mileage may vary, do not taunt Happy
> Fun Android, etc.
>
> > I'll be reconfiguring the program to see if I can get different
> > results - perhaps I missed something simple in the Manifest.  However,
> > a NullPointerException really does merit some explanation.
>
> Well, hackbod took a guess, and her guesses are pretty damn good.
>
> Is whatever Context represented by initiateCall "real"? For example, if
> initiateCall is some Activity you instantiated yourself as part of this
> automated , that may not be fully-formed (i.e., gone through the normal
> lifecycle) and therefore may not be able to start other activities.
>
> I hate to be the bearer of bad tidings, since you read my book and all
> ;-), but I'm not terribly hopeful you'll be able to place a call,
> initiated by some remote application, automatically, without user
> intervention.
>
> Or, to put it another way, if it works, it'll scare the crap out of me,
> because there's all sorts of nasty things one can do with that technique.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.4 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Trouble with SoundPool

2008-11-11 Thread Dave

I can't commit to a date, but I can tell you that it will be addressed
in the next SDK release.

On Nov 10, 1:27 pm, Robert Green <[EMAIL PROTECTED]> wrote:
> Unfortunately it is the only suitable API for sounds in games at the
> moment.  I tried to use MediaPlayers for mine and the performance and
> player management was sub-par.  I had problems with it but after I
> switched to OGGs they seemed to go away.  I'm prepared to retrofit my
> games once the API is finalized but until then it's really the only
> way to handle multiple triggered sounds well.
>
> Dave - got an ETA on when that will be ready?  :)
>
> On Nov 10, 1:52 pm, Dave <[EMAIL PROTECTED]> wrote:
>
> > SoundPool is undocumented because it is not ready as a public API and
> > is subject to change. There are serious problems with it including the
> > likelihood that your application will deadlock if you attempt to use
> > it. When it is ready, we will publish the API documentation.
>
> > On Nov 9, 5:04 pm, g1bb <[EMAIL PROTECTED]> wrote:
>
> > > This worked great. Thank you very much. The lack of documentation on
> > > SoundPool is disturbting.
>
> > > On Nov 9, 2:10 pm, Robert Green <[EMAIL PROTECTED]> wrote:
>
> > > > Yeah there's something you need to know about SoundPool:  Init well
> > > > before playing - that is, you need to know way ahead of time what
> > > > sounds you will be using because it doesn't work well to play
> > > > immediately after initializing.  I think they attempt to initialize
> > > > asynchronously or something because I had problems when I tried to
> > > > load and play back to back like you're trying there.
>
> > > > When I use SoundPool, I load everything upon creation of the instance
> > > > of the game then trigger the plays whenever I need them.  Here's my
> > > > current code for SoundPoolSoundManager:
>
> > > > public class SoundPoolSoundManager implements SoundManager {
> > > > private static final String TAG = "SoundPoolSoundManager";
>
> > > > public static final int SOUND_1 = 1;
>
> > > > private boolean enabled = true;
> > > > private Context context;
> > > > private SoundPool soundPool;
> > > > private HashMap soundPoolMap;
>
> > > > public SoundPoolSoundManager(Context context) {
> > > > this.context = context;
> > > > }
>
> > > > public void reInit() {
> > > > init();
> > > > }
>
> > > > public void init() {
> > > > if (enabled) {
> > > > Log.d(TAG, "Initializing new SoundPool");
> > > > //re-init sound pool to work around bugs
> > > > release();
> > > > soundPool = new SoundPool(SOUNDPOOL_STREAMS,
> > > > AudioManager.STREAM_MUSIC, 100);
> > > > soundPoolMap = new HashMap();
> > > > soundPoolMap.put(SOUND_1, 
> > > > soundPool.load(context, R.raw.sound1,
> > > > 1));
> > > > Log.d(TAG, "SoundPool initialized");
> > > > }
> > > > }
>
> > > > public void release() {
> > > > if (soundPool != null) {
> > > > Log.d(TAG, "Closing SoundPool");
> > > > soundPool.release();
> > > > soundPool = null;
> > > > Log.d(TAG, "SoundPool closed");
> > > > return;
> > > > }
> > > > }
>
> > > > public void playSound(int sound) {
> > > > if (soundPool != null) {
> > > > Log.d(TAG, "Playing Sound " + sound);
> > > > AudioManager mgr = (AudioManager)
> > > > context.getSystemService(Context.AUDIO_SERVICE);
> > > > int streamVolume = 
> > > > mgr.getStreamVolume(AudioManager.STREAM_MUSIC);
> > > > Integer soundId = soundPoolMap.get(sound);
> > > > if (soundId != null) {
> > > > soundPool.play(soundPoolMap.get(sound), 
> > > > streamVolume,
> > > > streamVolume, 1, 0, 1f);
> > > > }
> > > > }
> > > > }
>
> > > > public void setEnabled(boolean enabled) {
> > > > this.enabled = enabled;
> > > > }
>
> > > > }
>
> > > > On Nov 9, 4:28 am, g1bb <[EMAIL PROTECTED]> wrote:
>
> > > > > Hello,
>
> > > > > I posted this on the AndDev forums as well, and I'm somewhat of a
> > > > > novice to Java.
>
> > > > > I've tried the following code after seeing the snippet 
> > > > > athttp://www.anddev.org/using_soundpool_instead_of_mediaplayer-t3115.html,
> > > > > and I can't seem to get this to work. Here's what I have:
>
> > > > > public class OneShotAlarm extends BroadcastReceiver
> > > > > {
> > > > >  private SoundPool soundPool;
> > > > >   private HashMap soundPoolMap;
>
> > > > > @Over

[android-developers] Re: Service causing application to crash

2008-11-11 Thread Dave

Have you looked at the log output? There should be a stack trace
telling you where the service crashed.

On Nov 10, 9:01 pm, "&roid" <[EMAIL PROTECTED]> wrote:
> HI
> I have implemented a service to download online podcast episodes.I
> have put checks inside service that if there is not enough memory in
> the Sdcard then it should not download. There is infact enough memory
> in the card and it is allowing to download but afterwards results a
> crash. Any idea why this could be happening?
> 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Best approach to fullscreen video?

2008-11-11 Thread Dave

The following are for the T-Mobile G1, other Android devices will
likely have different specs based on their hardware capabilities:

H.264 AVC baseline, H.263, and MPEG4-SP codecs are supported in a 3GPP
container file. H.264 AVC is also supported in an MP4 container.

The H.264 AVC format is preferred due to support for h/w acceleration.
Video size up to 480x320, with video bit rates up to 600K bps average.
Make sure you disable b-frames (not supported in baseline).

VideoView adjusts the surface size based on the reported aspect ratio
from the video. If you want it to fill the display, make sure that the
video aspect ratio matches the screen aspect ratio.

On Nov 10, 6:42 pm, jean-guys <[EMAIL PROTECTED]> wrote:
> Our app has a simple 3 second intro video that plays the first time
> the app is launched. So far we've experienced two issues with this.
>
> The first is that we seem to be limited to H263 video in a 3GP
> container at "standard" resolutions (i.e. 352x288).  H264 video
> doesn't play at all in a 3GP container.  Is there a published list of
> supported video codec and container combinations?
>
> The second is that we can't get the VideoView to fill the screen in
> the case that the source video does not exactly match the device
> screen.  We'd like to be able to programatically determine the optimum
> video dimensions and have the video player scale appropriately.
> Setting the VideoView to FILL_PARENT works fine until the video starts
> playing, at which time the VideoView is resized to the video
> dimensions.
>
> Is there an equivalent to a setWidth and setHeight that will stick?
>
> This is our simple layout:
>
> 
> http://schemas.android.com/apk/res/
> android"
>   android:orientation="vertical"
>   android:layout_width="fill_parent"
>   android:layout_height="fill_parent">
>
> android:layout_gravity="center"
> android:layout_width="fill_parent" android:layout_height="fill_parent"
>android:minHeight="480">
> 
>
> 
>
> Tried with and without the minHeight and the results appear identical.
>
> Help?  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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Problem with Service Permission

2008-11-11 Thread Raktim Das

Thanks a lot for analyzing the problem.

First, my comment on your second point -
This I had already been doing - as in the client application's
manifest, the service application's manifest too has this entry under
the manifest tag:



Now coming to the first point, I changed the client code line from -
Intent intent = new Intent(this,
com.abc.xyz.service.BackgroundService.class);
to
Intent intent = new Intent("com.abc.xyz.service.BackgroundService");

After the change, it seems the service is identified and the earlier
warning message -
"Unable to start service Intent{ comp={com.abc.xyz.client/
com.abc.xyz.service.BackgroundService} }:not found "
is not coming.
But then the permission related SecurityException is coming at the
client statement "startService(intent)" as below:

- WARN/PackageManager(57): Not granting permission
android.permission.ACCESS_BACKGROUND_SERVICE to package
com.abc.xyz.client (protectionLevel=3 flags=0x44)
- ERROR/AndroidRuntime(): ERROR: thread attach failed
- WARN/ActivityManager(57): Permission Denial: Accessing service
ComponentInfo{com.abc.xyz/com.abc.xyz.service.BackgroundService} from
pid=57, uid=1000 requires android.permission.ACCESS_BACKGROUND_SERVICE
- ERROR/AndroidRuntime(1120): java.lang.RuntimeException: Unable to
start activity ComponentInfo{com.abc.xyz.client/
com.abc.xyz.client.ClientActivity}: java.lang.SecurityException: Not
allowed to start service Intent
{ action=com.abc.xyz.service.BackgroundService } without permission
android.permission.ACCESS_BACKGROUND_SERVICE


I think I am missing something with the declaration of permission in
the manifest(s). What is your opinion?

Thanks,
Raktim.


On Nov 11, 4:48 am, hackbod <[EMAIL PROTECTED]> wrote:
> The Intent you are making to bind to the service is trying to find a
> component in your own .apk, not the other.
>
> The last permission error you mention is because you need to
> explicitly request to use even your own permissions.
>
> On Nov 10, 9:31 pm, Raktim Das <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> > I am using 0.9 beta SDK.
> > I want to have a service defined within one application to be
> > invokable from another.
> > The application hosting the service has, in its manifest, the
> > following inside the application tag:
>
> >  > android:process=":remote"  android:exported="true"
> > android:permission="android.permission.ACCESS_BACKGROUND_SERVICE">
> >         
> >                  > android:name="com.abc.xyz.service.BackgroundService" />
> >         
> > 
>
> > It also has the following inside the manifest tag:
> >  > android:protectionLevel="dangerous"/>
>
> > In my client application's manifest xml file, I have the following
> > inside manifest tag:
> >  > android:name="android.permission.ACCESS_BACKGROUND_SERVICE" />
>
> > The client Activity code has the following API called from its
> > onCreate() method:
>
> >     private void startBackgroundService()
> >     {
> >         mConnection = new ServiceConnection()
> >         {
> >             public void onServiceConnected(ComponentName className,
> > IBinder service)
> >             {
> >                 Log.i(TAG, "Connected to background service");
> >                 mService =
> > BackgroundService.Stub.asInterface(service);
> >             }
>
> >             public void onServiceDisconnected(ComponentName className)
> >             {
> >                 mService = null;
> >                 Log.i(TAG, "Background service disconnected");
> >             }
> >         };
>
> >         Intent intent = new Intent(this,
> >                 com.abc.xyz.service.BackgroundService.class);
>
> >         startService(intent);
>
> >         boolean result = bindService(intent, mConnection,
> > Context.BIND_AUTO_CREATE);
>
> >         Log.i(TAG, "Background service bind result:  " + result);
> >     }
>
> > When I run the client Activity, it can not bind to the service:
> > - the log statement at the end has "Background service bind result:
> > false".
> > - the onServiceConnected() method is not called
> > - There is a waring log from ActivityManager:
> > WARN/ActivityManager(58): Unable to start service Intent
> > { comp={com.abc.xyz.client/com.abc.xyz.service.BackgroundService} }:
> > not found
>
> > I have tried running the same without any permission in the service
> > application manifest and also without the uses-permission tag in
> > client. The result was the same.
>
> > But when I run a similar client code inside my service application
> > (without specifying any permissions), it runs perfectly.
>
> > Finally, the most peculiar thing is happening when I am running this
> > client code inside my service application but with the permissions
> > specified (as written above) in the manifest - it runs with this error
> > at the statement "startService(intent)":
>
> > Caused by: java.lang.SecurityException: Not allowed to start service
> > Intent { comp={com.abc.xyz/com.abc.xyz.service.BackgroundService} }
> > without permission android.permission.AC

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread dreamerBoy

Actually, thank you - you WERE correct - onCreate is NOT being called
for this Activity.

I tried doing a wait() for 5  - then 30 seconds on the onCreate
callback being called - the wait timed out...  Hmmm how to force
an Activity to properly initialize itself.

On Nov 10, 5:42 pm, hackbod <[EMAIL PROTECTED]> wrote:
> Probably you are calling this before Activity.onCreate(), which is
> where the mInstrumentation field is set.
>
> Note that calling into an activity from a Service like this is pretty
> sketchy -- you will need to be very very careful about activity
> lifecycle and updating the service as the activity changes.
>
> On Nov 10, 2:22 pm,dreamerBoy<[EMAIL PROTECTED]> wrote:
>
> > Thanks for your reply - ha ha, wouldn't that be nice if it were that
> > simple.  Nope, I checked the return from the Uri.parse - not null.
>
> > I got a hold of the Android source code.  It is crashing here in
> > Activity.java:
>
> >      public void startActivityForResult(Intent intent, int
> > requestCode) {
> >          if (mParent == null) {
> >             Instrumentation.ActivityResult ar =
> > ->>>             mInstrumentation.execStartActivity(
> >                      this, mMainThread.getApplicationThread(), mToken,
> > th 
>
> >                      intent, requestCode);
>
> > Apparently, mInstrumentation is null.
> > mInstrumentation is set in a routine called attach in Activity.java.
>
> > I am trying to launch the Activity inside a Service - I don't see
> > anything that says that's illegal.  However, clearly, I'm not giving
> > Android something that it wants.
>
> > Still scratching my head on this one for the time being...
>
> > On Nov 7, 6:10 pm, Chris <[EMAIL PROTECTED]> wrote:
>
> > > You don't check if Uri.parse returns null, do you?
>
> > > On Fri, Nov 7, 2008 at 3:53 PM,dreamerBoy<[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > I'm attempting to initiate an outgoing call from inside a Service.
>
> > > > In onStart(), I create an ACTION_CALL Intent, then attempt to start an
> > > > Activity
>
> > > >         myIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" +
> > > > phoneNumber));
>
> > > >         initiateCall.startActivityForResult(myIntent,
> > > > CALL_SETUP_ACTIVITY_ID);
>
> > > > However, when I run the code I get a NullPointerException.  Clearly,
> > > > the intent and activity are non-null, so I'm wondering what Android is
> > > > lacking here.
>
> > > > 11-07 13:24:19.801: INFO/PhoneTestService(1250): onCreate called
> > > > 11-07 13:24:19.801: INFO/PhoneTestService(1250): onStart called
> > > > 11-07 13:24:19.801: INFO/PhoneTestService(1250): doIt called
> > > > 11-07 13:24:19.811: DEBUG/PhoneTestService(1250): creating
> > > > initiateCall activity
> > > > 11-07 13:24:19.811: DEBUG/PhoneTestService(1250): initiateCall is NOT
> > > > NULL!
> > > > 11-07 13:24:19.820: INFO/PhoneTestService(1250): phone state is:
> > > > CALL_STATE_IDLE
> > > > 11-07 13:24:21.601: INFO/PhoneTestService(1250): starting to listen
> > > > Fri Nov 07 13:24:19 PST 2008
> > > > 11-07 13:24:21.622: INFO/PhoneTestService(1250): starting call intent.
> > > > 11-07 13:24:21.622: DEBUG/PhoneTestService(1250): myIntent is NOT
> > > > NULL!
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250): ERROR:
> > > > java.lang.NullPointerException
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):
> > > > java.lang.NullPointerException
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.Activity.startActivityForResult(Activity.java:2528)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > test.phone.PhoneTestService.doIt(PhoneTestService.java:254)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > test.phone.PhoneTestService.onStart(PhoneTestService.java:145)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2429)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.ActivityThread.access$3100(ActivityThread.java:112)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1640)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.os.Handler.dispatchMessage(Handler.java:88)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.os.Looper.loop(Looper.java:123)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.ActivityThread.main(ActivityThread.java:3742)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > java.lang.reflect.Method.invokeNative(Native Method)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > java.lang.reflect.Method.invoke(Method.java:515)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > com.android.internal.os.ZygoteInit
> > > > $MethodAndArgsC

[android-developers] Re: Any way to have two MediaRecorders recording at once?

2008-11-11 Thread Dave

No, this use case is not supported.

On Nov 11, 5:34 am, "Blake B." <[EMAIL PROTECTED]> wrote:
> Hi all,
>  For my app I need to have two audio recordings that overlap each
> other - that is, at some points in time there will be two separate
> audio files being created from the same audio source.  I have
> attempted to use two MediaRecorders and start the second one while the
> first is still recording.  When I do this I get the following error:
>
> ERROR/AudioFlinger(25): Record channel already open
>
> Is there any way to get around this?
>
> Thanks in advance,
> Blake
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Does SoundPool work or has anyone successfully used it?

2008-11-11 Thread Dave

By default, the MediaPlayer volume should be set to 1.0, i.e. no
attenuation.

Which stream type are you using when you create the MediaPlayer? Have
you checked to make sure that the master stream volume is set
correctly?

On Nov 11, 10:10 am, plusminus <[EMAIL PROTECTED]> wrote:
> Thx for the code but I have that onCompletion working with the
> MediaPlayer already.
> The problem actually is that the volume is s silent on some files
> (even after volume-normalizing them).
>
> Does anyone which values to choose, calling the following method on a
> MediaPlayer:
> --
> setVolume(float leftVolume, float rightVolume)
> Sets the volume on this player.
> --
> I was using 10, as that had been returned once from
> mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
>
> SoundPool is playing them in the proper loudness. :(
> But using an unstable API is not what I'd like to do :(
>
> On Nov 11, 9:43 am, Robert Green <[EMAIL PROTECTED]> wrote:
>
> > Here's an example for managing sounds that will be played many times
> > (like gunshots, explosions, clicks, etc) using a pool and then sounds
> > that are just one-offs, like an announcer or an intro sound.
>
> > public class MediaPlayerPool {
> > private static final String TAG = "MediaPlayerPool";
>
> > private Context context;
> > private int streamType;
>
> > private HashMap> pools;
>
> > public MediaPlayerPool(Context context, int streamType) {
> > this.context = context;
> > this.streamType = streamType;
> > pools = new HashMap>();
> > }
>
> > public boolean hasMedia(int resourceId) {
> > return pools.keySet().contains(resourceId);
> > }
>
> > public void addMedia(int resourceId, int poolSize) {
> > ArrayList pool = pools.get(resourceId);
> > if (pool == null) {
> > pool = new ArrayList();
> > }
> > for (int i = 0; i < poolSize; i++) {
> > pool.add(createMediaPlayer(resourceId));
> > }
> > pools.put(resourceId, pool);
> > }
>
> > public void playMedia(int resourceId) {
> > ArrayList pool = pools.get(resourceId);
> > MediaPlayer player = null;
> > if (pool.size() > 0) {
> > player = pool.remove(0);
> > }
> > if (player == null) {
> > Log.e(TAG, "Pool is empty for resource " + 
> > resourceId);
> > } else {
> > player.start();
> > }
> > }
>
> > public void release() {
> > for (Integer key : pools.keySet()) {
> > ArrayList pool = pools.get(key);
> > for (MediaPlayer player : pool) {
> > if (player.isPlaying()) {
> > player.stop();
> > }
> > player.release();
> > }
> > pool.clear();
> > }
> > pools.clear();
> > }
>
> > private MediaPlayer createMediaPlayer(final int resourceId) {
> > MediaPlayer mp = MediaPlayer.create(context, resourceId);
> > mp.setOnCompletionListener(new 
> > MediaPlayer.OnCompletionListener() {
> > public void onCompletion(MediaPlayer player) {
> > player.seekTo(0);
> > returnToPool(resourceId, player);
> > }
> > });
> > mp.setAudioStreamType(streamType);
> > return mp;
> > }
>
> > private void returnToPool(int resourceId, MediaPlayer player) {
> > ArrayList pool = pools.get(new 
> > Integer(resourceId));
> > pool.add(player);
> > }
>
> > }
>
> > public class MediaPlayerSoundManager {
> > private static final String TAG = "MediaPlayerSoundManager";
>
> > private Context context;
> > private MediaPlayerPool pool;
> > private HashMap soundResourceMap;
>
> > public MediaPlayerSoundManager(Context context) {
> > this.context = context;
> > this.pool = new MediaPlayerPool(context, 
> > AudioManager.STREAM_MUSIC);
> > this.soundResourceMap = new HashMap();
> > }
>
> > public void init() {
> > release();
> > pool.addMedia(R.raw.sound_1, 2);
> > soundResourceMap.put(SOUND_1, R.raw.sound_1);
> > }
>
> > public void playSound(int soundId) {
> > int resourceId = getResourceId(soundId);
> > if 

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread dreamerBoy



On Nov 10, 6:12 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> dreamerBoywrote:
> > Thanks for the reply, Mark (I recognize the name - I read your book.)
>

> In the ACTION_CALL documentation, it states:
>
> "Note: there will be restrictions on which applications can initiate a
> call; most applications should use the ACTION_DIAL."

Whoever wrote that sounds like a politician - lots of room to maneuver
there -

>
> Now, probably it will work, as there have been recent tutorials
> demonstrating that it works from an activity, but I could see where this
> might get locked down sometime in the future.

Ahhh - I miss the good ole days when there was something called a
SecurityPolicy that one could customize ...

>
> > I am also wondering if there exists within the exposed Android API, a
> > way to hang up a call in an automated fashion.  No appropriate intents
> > exist - it seems the only remaining possibility is calling finish() or
> > finishActivity(ACTIVITY_ID) on the Activity used to place or answer
> > the call.  However, there is nothing in the docs which actually states
> > that.  If I can get past my currently difficulty, I will definitely
> > test it.
>
> You could putter through the source code to see how the in-call
> application handles it. Again, whatever technique it uses is probably
> not for public consumption, your mileage may vary, do not taunt Happy
> Fun Android, etc.

I thought that Android was supposed to be about empowering developers
to create new breeds of applications.

>
> > I'll be reconfiguring the program to see if I can get different
> > results - perhaps I missed something simple in the Manifest.  However,
> > a NullPointerException really does merit some explanation.
>
> Well, hackbod took a guess, and her guesses are pretty damn good.

According to my logCat readout - onCreate was already called a while
back - time to drill in deeper I guess.

I'm wondering why my attempt to install my own Instrumentation object
doesn't appear to be working (at least, none of the lifecycle
callbacks are talking to me).

>
> Is whatever Context represented by initiateCall "real"? For example, if
> initiateCall is some Activity you instantiated yourself as part of this
> automated , that may not be fully-formed (i.e., gone through the normal
> lifecycle) and therefore may not be able to start other activities.

Yep, it's possible that I got my life cycle out of order .. working on
that -

>
> I hate to be the bearer of bad tidings, since you read my book and all
> ;-),

Actually your book, Haseman's book ("Android Essentials"), Gramlich's
book ("Programming in Android"), and DiMarzio's book ("Programming in
Android").


> but I'm not terribly hopeful you'll be able to place a call,
> initiated by some remote application, automatically, without user
> intervention.

I could think of some quite useful applications that would utilize
automated calling.
Leave a voice or text message for a bunch o' people.  Try to contact
computer support or the IRS every 15 minutes - if someone actually
picks up, then transfer the call to the user ...

Yes, I suppose the latter capability could be used in a malicious way
e.g., to stalk someone - however, there's something called a "Previous
Number Dialed" button which can be used to do the same thing manually.

>
> Or, to put it another way, if it works, it'll scare the crap out of me,
> because there's all sorts of nasty things one can do with that technique.
>

Yes, that situation already came up in the case of Applets ...
download an Applet - it will steal your passwords, start emailing
advertisements for erectile dysfunction cures, harass old ladies
etc...

See:

http://www.securingjava.com/chapter-two/

Not saying you're wrong - Android designers may have indeed been
afraid of this but if there are limitations they should be enumerated
somehow - sigh.

> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.4 Published!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Check for new version of applications

2008-11-11 Thread Shane Isbell
We also have an update notification feature in SAM. If you update you
application version at SlideME site, the user will receive a notification,
allowing them to download the new version. This does require, however, that
the user have downloaded the application through SAM.

Shane

On Tue, Nov 11, 2008 at 9:53 AM, Peli <[EMAIL PROTECTED]> wrote:

>
> As far as I understand, Google plans something like this for the
> future (maybe when paid apps start to become possible). For now the
> developer is left by themselves.
>
> We also initially copied an update checker routine in all of our OI
> applications, but this has 2 major drawbacks:
> 1) It requires each application to have the INTERNET permission, even
> though the app itself won't use it.
> 2) A lot of code is duplicated in the various applications.
>
> We have been developing OI Update, an open source update checker,
> which is ready to be released soon. We wrote it mainly for our own
> applications, but it is written generally enough to allow other
> applications to take advantage of it as well easily.
>
> Your application only needs to include a small meta-data in your
> manifest, and you need to keep a file on a server with update
> information (which can be compatible to VeeCheck; AndAppStore.com can
> generate that file on the fly). This inconvenience is necessary,
> because the Market does not provide version information to 3rd party
> applications (or at least I'm not aware of how to do it).
>
> All the rest is handled by OI Update. It checks every couple of days
> (as set by the user) for updates, and notifies the user. If the user
> wishes they are then directly forwarded to the Market where they can
> download the new version.
>
> I hope this could clarify a couple of points.
>
> Peli
> www.openintents.org
>
> On Nov 11, 3:48 pm, loty <[EMAIL PROTECTED]> wrote:
> > I'm wondering about the same thing. All applications need to have a
> > simple ability to notify users of new versions. For me 3rd party
> > updaters/checkers is not an option - I can just as easily add simple
> > check against my web site and download new APK file directly.
> >
> > A much cleaner solution is to query Android Market directly for new
> > version.
> > Can anyone illuminate me if this is possible or planned in the future.
> >
> > On Nov 10, 10:02 am, G <[EMAIL PROTECTED]> wrote:
> >
> > > So version checking needs to be done through an outside resource...
> > > Is there anintentwe can use to launch theAndroidMarketApp
> > > directly to the listing for our own app, for when an update is
> > > available?
> >
> > > On Nov 10, 4:35 am, friedger <[EMAIL PROTECTED]> wrote:
> >
> > > > Hi,
> >
> > > > we have prepared a release version of the OI Updater. There is no
> need
> > > > to send intents, but developers only need to add a meta-data node to
> > > > the application manifest in order to be handled by the updater.
> >
> > > > Early feedback welcome!
> >
> > > > Description:http://www.openintents.org/en/node/136
> > > > Download:
> http://openintents.googlecode.com/files/UpdateChecker-1.0.0.apk
> >
> > > > Cheers,
> > > > Friedger
> >
> > > > On 6 Nov., 20:31, Guillaume Perrot <[EMAIL PROTECTED]> wrote:
> >
> > > > > Because we use a XMPP based application, we chosed Pubsub as a way
> to
> > > > > notify new versions to the user. The main advantage is that it uses
> a
> > > > > push model. The user is aware of a new version when he launches
> > > > > the app or in real time if he's online while a new version has just
> > > > > been released. No timer or service at all in the application code.
> >
> > > > > On Nov 5, 11:57 pm, friedger <[EMAIL PROTECTED]> wrote:
> >
> > > > > > Currently, relying on an external resource is the way to do
> updates,
> > > > > > this is how it is described in the documentation.
> >
> > > > > > If someone is checking againstMarket, please let us know.
> >
> > > > > > Friedger
> >
> > > > > > On Nov 4, 8:49 pm, "Dan B." <[EMAIL PROTECTED]> wrote:
> >
> > > > > > > isn't there some way tocheckthe version against
> theMarketinstead
> > > > > > > of having to host version information somewhere else? I know
> the app
> > > > > > > Locale somehow knows when anupdateis available, it seems
> reasonable
> > > > > > > to query theMarketrather than relying on outside sources :\
> >
> > > > > > > On Nov 1, 1:50 pm,friedger<[EMAIL PROTECTED]> wrote:
> >
> > > > > > > > I'd say the package name is the global identifier.
> >
> > > > > > > > Maybe you can just provide a VeeCheck url based on the
> package name
> > > > > > > > (as alternative to the app id). So I couldcheckthat url. If
> you
> > > > > > > > don't host an app for the package name or if it is not unique
> you
> > > > > > > > could return a HTTP 400.
> >
> > > > > > > >Friedger
> >
> > > > > > > > On 1 Nov., 17:37, Al Sutton <[EMAIL PROTECTED]> wrote:
> >
> > > > > > > > >Friedger,
> >
> > > > > > > > > How are you identifying the apps?, I'd happily add an extra
> field or two
> > > > > > > > >

[android-developers] Re: Check for new version of applications

2008-11-11 Thread G

It would be cool if google added the ability to check your version
against the market, but for the time being, I'm fine with using a
version URL as you described. But I'm still fuzzy on one thing, is
there an action available to launch the market app directly to your
product page?

Example:
-user opens app
-app checks update url finds new version exists
-app presents dialog box - "click ok to goto the Android Market"
-user clicks ok
-new intent launches android market with your app's content_id

Does anyone know if a simple solution like that currently exists, or
do we just have to notify the user about the update, and tell them to
goto the market?


Also in regards to the OI Update app, is there a way to require it be
installed as well, or would my app have to download and install it
directly on it's first run? And would that even be possible if the
user never checked off "Allow Non-Market Apps"?

On Nov 11, 12:53 pm, Peli <[EMAIL PROTECTED]> wrote:
> As far as I understand, Google plans something like this for the
> future (maybe when paid apps start to become possible). For now the
> developer is left by themselves.
>
> We also initially copied an update checker routine in all of our OI
> applications, but this has 2 major drawbacks:
> 1) It requires each application to have the INTERNET permission, even
> though the app itself won't use it.
> 2) A lot of code is duplicated in the various applications.
>
> We have been developing OI Update, an open source update checker,
> which is ready to be released soon. We wrote it mainly for our own
> applications, but it is written generally enough to allow other
> applications to take advantage of it as well easily.
>
> Your application only needs to include a small meta-data in your
> manifest, and you need to keep a file on a server with update
> information (which can be compatible to VeeCheck; AndAppStore.com can
> generate that file on the fly). This inconvenience is necessary,
> because the Market does not provide version information to 3rd party
> applications (or at least I'm not aware of how to do it).
>
> All the rest is handled by OI Update. It checks every couple of days
> (as set by the user) for updates, and notifies the user. If the user
> wishes they are then directly forwarded to the Market where they can
> download the new version.
>
> I hope this could clarify a couple of points.
>
> Peliwww.openintents.org
>
> On Nov 11, 3:48 pm, loty <[EMAIL PROTECTED]> wrote:
>
> > I'm wondering about the same thing. All applications need to have a
> > simple ability to notify users of new versions. For me 3rd party
> > updaters/checkers is not an option - I can just as easily add simple
> > check against my web site and download new APK file directly.
>
> > A much cleaner solution is to query Android Market directly for new
> > version.
> > Can anyone illuminate me if this is possible or planned in the future.
>
> > On Nov 10, 10:02 am, G <[EMAIL PROTECTED]> wrote:
>
> > > So version checking needs to be done through an outside resource...
> > > Is there anintentwe can use to launch theAndroidMarketApp
> > > directly to the listing for our own app, for when an update is
> > > available?
>
> > > On Nov 10, 4:35 am, friedger <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > we have prepared a release version of the OI Updater. There is no need
> > > > to send intents, but developers only need to add a meta-data node to
> > > > the application manifest in order to be handled by the updater.
>
> > > > Early feedback welcome!
>
> > > > Description:http://www.openintents.org/en/node/136
> > > > Download:http://openintents.googlecode.com/files/UpdateChecker-1.0.0.apk
>
> > > > Cheers,
> > > > Friedger
>
> > > > On 6 Nov., 20:31, Guillaume Perrot <[EMAIL PROTECTED]> wrote:
>
> > > > > Because we use a XMPP based application, we chosed Pubsub as a way to
> > > > > notify new versions to the user. The main advantage is that it uses a
> > > > > push model. The user is aware of a new version when he launches
> > > > > the app or in real time if he's online while a new version has just
> > > > > been released. No timer or service at all in the application code.
>
> > > > > On Nov 5, 11:57 pm, friedger <[EMAIL PROTECTED]> wrote:
>
> > > > > > Currently, relying on an external resource is the way to do updates,
> > > > > > this is how it is described in the documentation.
>
> > > > > > If someone is checking againstMarket, please let us know.
>
> > > > > > Friedger
>
> > > > > > On Nov 4, 8:49 pm, "Dan B." <[EMAIL PROTECTED]> wrote:
>
> > > > > > > isn't there some way tocheckthe version against theMarketinstead
> > > > > > > of having to host version information somewhere else? I know the 
> > > > > > > app
> > > > > > > Locale somehow knows when anupdateis available, it seems 
> > > > > > > reasonable
> > > > > > > to query theMarketrather than relying on outside sources :\
>
> > > > > > > On Nov 1, 1:50 pm,friedger<[EMAIL PROTECTED]> wrote:
>
> > > > > > > > I'd say

[android-developers] Re: Two Notifications

2008-11-11 Thread Christine

On Nov 11, 6:21 pm, Peli <[EMAIL PROTECTED]> wrote:

> The idea is to only show 1 notification, also when you slide down the
> screen, leaving the user with only 1 choice.

Then I don't see the point of having an extended statusbar. Why not
execute the intent soon as the user clicks the icon? My preference
would be if there's one notification, execute it soon as the user
clicks it, if there's more, show the extended status bar.

> But this 1 choice directs her to your application where you present a
> list of possible options (the ones you wanted to show in separate
> notifications in the first place).

So you click the icon, then you click the extended notification bar's
one option, then you select an option.

I found my way around it, my app removes the old notification and
places a new one, so there's always one icon. What also works is to
give the second notification a transparent icon, which doesn't show.
Then you have one visible icon and two or more lines in the extended
notification bar. But I won't do that, don't want to steal space in
the task bar :-)


>
> Peli
>
> On Nov 11, 3:34 pm, Christine <[EMAIL PROTECTED]> wrote:
>
> > On Nov 11, 2:39 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > > Perhaps think about doing something like the calendar app,
> > > where selecting the notification brings you to a list of the
> > > interesting things behind it.
>
> > Well, that's kind of what I was hoping to achieve by having one icon
> > pop up multiple notifications in the screen that slides down when you
> > pull down the task bar icon. I can do that, but it shows two icons
> > rather than one. My problem is not the notifications, my problem is
> > that I get two icons for one Notificationmanager where I need one
> > icon.
>
> > > On Nov 10, 4:06 pm, Christine <[EMAIL PROTECTED]> wrote:
>
> > > > Just got an email from a user who says "why can't the app just start
> > > > right when you click the task bar icon". If that could be done, my app
> > > > would have one icon per action. But the user gets these bars that come
> > > > down, where you can put multiple notifications. So what you want is
> > > > one icon, even if you have multiple notifications at the same time. I
> > > > want to keep both of them, because they represent different user
> > > > actions.
> > > > What bothers me is that you have multiple bars appearing, but why do
> > > > you get multiple icons also? It looks very cute, a whole series of
> > > > tweeting birds in the task bar, but I don't think a user appreciates
> > > > that, after an initial smile :-)
>
> > > > On Nov 11, 12:27 am, Peli <[EMAIL PROTECTED]> wrote:
>
> > > > > Can't you simply remove your existing notification before you add the
> > > > > new one?
>
> > > > > Peli
>
> > > > > On Nov 10, 11:14 pm, Christine <[EMAIL PROTECTED]> wrote:
>
> > > > > > How can I send two Notifications to one NotificationManager in a way
> > > > > > that I get only one icon for that NotificationManager? What happens
> > > > > > now is that you get a second icon for the second notification - and 
> > > > > > a
> > > > > > third, fourth, etc.
> > > > > > I've seen this question before, but I don't think it got answered?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: "Cannot finish download. There is not enough space."

2008-11-11 Thread Jean-Baptiste Queru

I've checked the code, and there is no difference whatsoever between
the download code in RC19 and RC28/29/30.

If anyone runs into this issue and has their device configured to run
adb, the following information could help me diagnose what's going on:

-the result of "adb shell df"
-any line output by "adb logcat" that contains the string "DownloadManager".

Thanks,
JBQ

On Mon, Nov 10, 2008 at 12:11 PM, Seismic Gelatin <[EMAIL PROTECTED]> wrote:
>
> It seems to have happened after the RC28/29 OTA (or manual for those
> who chose that route) Update.
>
> Apparently the browser now only wishes to download to the internal
> memory reserved for the OS, and
> makes no notice of the microSD card.
>
> For example, on my phone (now running RC30)
>
> Going into Settings > SD card and phone storage reports 53mb free
> internal storage and a nearly empty SD card.
> However, using the System Monitor app I downloaded from the Market,
> internal storage is listed as 63mb used
> out of a total of 67mb. (the SD card still shows that it's nearly
> empty)
>
> All attempts to download through the browser fail.  I have done a
> factory reset and it does not remedy
> the issue.  I can only assume that a symlink is broken or that it was
> purposefully done to impede the
> download and installation of non-Market applications.
>
> Any resolution to this issue would be greatly appreciated.
>
> On Nov 3, 11:53 am, "Kipling Inscore" <[EMAIL PROTECTED]> wrote:
>> Is that 48MB on the device's internal memory or on the SD card in the
>> device? Downloads go to the SD card.
>>
>> On Sun, Nov 2, 2008 at 10:22 PM, GasBot <[EMAIL PROTECTED]> wrote:
>>
>> > I'm trying to set up my IIS server to serve out my APK for anyone who
>> > wants todownloadit directly from my site.  I added the .apk
>> > extension and mime type to my site which changed the error I was
>> > getting in the android's browser from not compatible with the device,
>> > to not enough space on the device.  However it's showing that I have
>> > more than enough space (the apk is only 9KB and device shows over 48MB
>> > available).  I'm guessing there's some other kind of configuration
>> > error going on with this.  Has anyone seen this issue before?
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] progress dialog

2008-11-11 Thread chouman82

I am having a little problem of using progress dialog. Trying to
figure out how and the optimal way of using the progress dialog. My
application needs to grab information from different servers, so I am
trying to show the progress dialog at the appropriate moment.

I am trying to use a gallery to grab different images. At the start of
the activity, I will have a pop up that says loading, and then spin
off a different thread to start retrieving images in the background
and store the images in a bitmap array. And once I get the first few
images, the thread would send a message to the activity to let it know
that it can set up the adapter and start displaying the first few
images. The user then can start flipping through different images. In
the adapter getView method, I will check the bitmap array from the
thread to see if the image in the specific position that the user is
trying to view is loaded yet. If the bitmap array for the position is
null then the adapter will send a message to the activity and asks the
activity to display the progress dialog and at the same time the
adapter will tell the thread that the user is trying to view the image
at that specific position. Then the thread will then send a message to
the activity to dismiss the progress dialog once the image of that
specific position has been loaded.

That's the general idea, but for some reason the message been sent
from the adapter to the activity for showing the progress dialog is
not working. I can see the message been send because the logging is
been printed out in the message handler but the dialog is not showing
up. Anyone has a clue?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread dreamerBoy

Sorry... I should have checked my logCat ... in fact onCreate has
already been called at the point where the NullPointerException is
thrown.

On Nov 10, 5:42 pm, hackbod <[EMAIL PROTECTED]> wrote:
> Probably you are calling this before Activity.onCreate(), which is
> where the mInstrumentation field is set.
>
> Note that calling into an activity from a Service like this is pretty
> sketchy -- you will need to be very very careful about activity
> lifecycle and updating the service as the activity changes.
>
> On Nov 10, 2:22 pm,dreamerBoy<[EMAIL PROTECTED]> wrote:
>
> > Thanks for your reply - ha ha, wouldn't that be nice if it were that
> > simple.  Nope, I checked the return from the Uri.parse - not null.
>
> > I got a hold of the Android source code.  It is crashing here in
> > Activity.java:
>
> >      public void startActivityForResult(Intent intent, int
> > requestCode) {
> >          if (mParent == null) {
> >             Instrumentation.ActivityResult ar =
> > ->>>             mInstrumentation.execStartActivity(
> >                      this, mMainThread.getApplicationThread(), mToken,
> > th 
>
> >                      intent, requestCode);
>
> > Apparently, mInstrumentation is null.
> > mInstrumentation is set in a routine called attach in Activity.java.
>
> > I am trying to launch the Activity inside a Service - I don't see
> > anything that says that's illegal.  However, clearly, I'm not giving
> > Android something that it wants.
>
> > Still scratching my head on this one for the time being...
>
> > On Nov 7, 6:10 pm, Chris <[EMAIL PROTECTED]> wrote:
>
> > > You don't check if Uri.parse returns null, do you?
>
> > > On Fri, Nov 7, 2008 at 3:53 PM,dreamerBoy<[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > I'm attempting to initiate an outgoing call from inside a Service.
>
> > > > In onStart(), I create an ACTION_CALL Intent, then attempt to start an
> > > > Activity
>
> > > >         myIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" +
> > > > phoneNumber));
>
> > > >         initiateCall.startActivityForResult(myIntent,
> > > > CALL_SETUP_ACTIVITY_ID);
>
> > > > However, when I run the code I get a NullPointerException.  Clearly,
> > > > the intent and activity are non-null, so I'm wondering what Android is
> > > > lacking here.
>
> > > > 11-07 13:24:19.801: INFO/PhoneTestService(1250): onCreate called
> > > > 11-07 13:24:19.801: INFO/PhoneTestService(1250): onStart called
> > > > 11-07 13:24:19.801: INFO/PhoneTestService(1250): doIt called
> > > > 11-07 13:24:19.811: DEBUG/PhoneTestService(1250): creating
> > > > initiateCall activity
> > > > 11-07 13:24:19.811: DEBUG/PhoneTestService(1250): initiateCall is NOT
> > > > NULL!
> > > > 11-07 13:24:19.820: INFO/PhoneTestService(1250): phone state is:
> > > > CALL_STATE_IDLE
> > > > 11-07 13:24:21.601: INFO/PhoneTestService(1250): starting to listen
> > > > Fri Nov 07 13:24:19 PST 2008
> > > > 11-07 13:24:21.622: INFO/PhoneTestService(1250): starting call intent.
> > > > 11-07 13:24:21.622: DEBUG/PhoneTestService(1250): myIntent is NOT
> > > > NULL!
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250): ERROR:
> > > > java.lang.NullPointerException
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):
> > > > java.lang.NullPointerException
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.Activity.startActivityForResult(Activity.java:2528)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > test.phone.PhoneTestService.doIt(PhoneTestService.java:254)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > test.phone.PhoneTestService.onStart(PhoneTestService.java:145)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2429)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.ActivityThread.access$3100(ActivityThread.java:112)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1640)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.os.Handler.dispatchMessage(Handler.java:88)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.os.Looper.loop(Looper.java:123)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.ActivityThread.main(ActivityThread.java:3742)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > java.lang.reflect.Method.invokeNative(Native Method)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > java.lang.reflect.Method.invoke(Method.java:515)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > com.android.internal.os.ZygoteInit
> > > > $MethodAndArgsCaller.run(ZygoteInit.java:739)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > com.android.internal.os.Z

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread dreamerBoy

Hmmm... so perhaps I can call wait() or use some other kind of
synchronizer until I get the proper onCreate callback.  Thank you very
much for that ... it's a start.



On Nov 10, 5:42 pm, hackbod <[EMAIL PROTECTED]> wrote:
> Probably you are calling this before Activity.onCreate(), which is
> where the mInstrumentation field is set.
>
> Note that calling into an activity from a Service like this is pretty
> sketchy -- you will need to be very very careful about activity
> lifecycle and updating the service as the activity changes.
>
> On Nov 10, 2:22 pm,dreamerBoy<[EMAIL PROTECTED]> wrote:
>
> > Thanks for your reply - ha ha, wouldn't that be nice if it were that
> > simple.  Nope, I checked the return from the Uri.parse - not null.
>
> > I got a hold of the Android source code.  It is crashing here in
> > Activity.java:
>
> >      public void startActivityForResult(Intent intent, int
> > requestCode) {
> >          if (mParent == null) {
> >             Instrumentation.ActivityResult ar =
> > ->>>             mInstrumentation.execStartActivity(
> >                      this, mMainThread.getApplicationThread(), mToken,
> > th 
>
> >                      intent, requestCode);
>
> > Apparently, mInstrumentation is null.
> > mInstrumentation is set in a routine called attach in Activity.java.
>
> > I am trying to launch the Activity inside a Service - I don't see
> > anything that says that's illegal.  However, clearly, I'm not giving
> > Android something that it wants.
>
> > Still scratching my head on this one for the time being...
>
> > On Nov 7, 6:10 pm, Chris <[EMAIL PROTECTED]> wrote:
>
> > > You don't check if Uri.parse returns null, do you?
>
> > > On Fri, Nov 7, 2008 at 3:53 PM,dreamerBoy<[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > I'm attempting to initiate an outgoing call from inside a Service.
>
> > > > In onStart(), I create an ACTION_CALL Intent, then attempt to start an
> > > > Activity
>
> > > >         myIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" +
> > > > phoneNumber));
>
> > > >         initiateCall.startActivityForResult(myIntent,
> > > > CALL_SETUP_ACTIVITY_ID);
>
> > > > However, when I run the code I get a NullPointerException.  Clearly,
> > > > the intent and activity are non-null, so I'm wondering what Android is
> > > > lacking here.
>
> > > > 11-07 13:24:19.801: INFO/PhoneTestService(1250): onCreate called
> > > > 11-07 13:24:19.801: INFO/PhoneTestService(1250): onStart called
> > > > 11-07 13:24:19.801: INFO/PhoneTestService(1250): doIt called
> > > > 11-07 13:24:19.811: DEBUG/PhoneTestService(1250): creating
> > > > initiateCall activity
> > > > 11-07 13:24:19.811: DEBUG/PhoneTestService(1250): initiateCall is NOT
> > > > NULL!
> > > > 11-07 13:24:19.820: INFO/PhoneTestService(1250): phone state is:
> > > > CALL_STATE_IDLE
> > > > 11-07 13:24:21.601: INFO/PhoneTestService(1250): starting to listen
> > > > Fri Nov 07 13:24:19 PST 2008
> > > > 11-07 13:24:21.622: INFO/PhoneTestService(1250): starting call intent.
> > > > 11-07 13:24:21.622: DEBUG/PhoneTestService(1250): myIntent is NOT
> > > > NULL!
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250): ERROR:
> > > > java.lang.NullPointerException
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):
> > > > java.lang.NullPointerException
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.Activity.startActivityForResult(Activity.java:2528)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > test.phone.PhoneTestService.doIt(PhoneTestService.java:254)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > test.phone.PhoneTestService.onStart(PhoneTestService.java:145)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2429)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.ActivityThread.access$3100(ActivityThread.java:112)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1640)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.os.Handler.dispatchMessage(Handler.java:88)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.os.Looper.loop(Looper.java:123)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > android.app.ActivityThread.main(ActivityThread.java:3742)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > java.lang.reflect.Method.invokeNative(Native Method)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > java.lang.reflect.Method.invoke(Method.java:515)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > com.android.internal.os.ZygoteInit
> > > > $MethodAndArgsCaller.run(ZygoteInit.java:739)
> > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > 

[android-developers] Re: Does SoundPool work or has anyone successfully used it?

2008-11-11 Thread plusminus

Thx for the code but I have that onCompletion working with the
MediaPlayer already.
The problem actually is that the volume is s silent on some files
(even after volume-normalizing them).

Does anyone which values to choose, calling the following method on a
MediaPlayer:
--
setVolume(float leftVolume, float rightVolume)
Sets the volume on this player.
--
I was using 10, as that had been returned once from
mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);

SoundPool is playing them in the proper loudness. :(
But using an unstable API is not what I'd like to do :(

On Nov 11, 9:43 am, Robert Green <[EMAIL PROTECTED]> wrote:
> Here's an example for managing sounds that will be played many times
> (like gunshots, explosions, clicks, etc) using a pool and then sounds
> that are just one-offs, like an announcer or an intro sound.
>
> public class MediaPlayerPool {
>         private static final String TAG = "MediaPlayerPool";
>
>         private Context context;
>         private int streamType;
>
>         private HashMap> pools;
>
>         public MediaPlayerPool(Context context, int streamType) {
>                 this.context = context;
>                 this.streamType = streamType;
>                 pools = new HashMap>();
>         }
>
>         public boolean hasMedia(int resourceId) {
>                 return pools.keySet().contains(resourceId);
>         }
>
>         public void addMedia(int resourceId, int poolSize) {
>                 ArrayList pool = pools.get(resourceId);
>                 if (pool == null) {
>                         pool = new ArrayList();
>                 }
>                 for (int i = 0; i < poolSize; i++) {
>                         pool.add(createMediaPlayer(resourceId));
>                 }
>                 pools.put(resourceId, pool);
>         }
>
>         public void playMedia(int resourceId) {
>                 ArrayList pool = pools.get(resourceId);
>                 MediaPlayer player = null;
>                 if (pool.size() > 0) {
>                         player = pool.remove(0);
>                 }
>                 if (player == null) {
>                         Log.e(TAG, "Pool is empty for resource " + 
> resourceId);
>                 } else {
>                         player.start();
>                 }
>         }
>
>         public void release() {
>                 for (Integer key : pools.keySet()) {
>                         ArrayList pool = pools.get(key);
>                         for (MediaPlayer player : pool) {
>                                 if (player.isPlaying()) {
>                                         player.stop();
>                                 }
>                                 player.release();
>                         }
>                         pool.clear();
>                 }
>                 pools.clear();
>         }
>
>         private MediaPlayer createMediaPlayer(final int resourceId) {
>                 MediaPlayer mp = MediaPlayer.create(context, resourceId);
>                 mp.setOnCompletionListener(new 
> MediaPlayer.OnCompletionListener() {
>                         public void onCompletion(MediaPlayer player) {
>                                 player.seekTo(0);
>                                 returnToPool(resourceId, player);
>                         }
>                 });
>                 mp.setAudioStreamType(streamType);
>                 return mp;
>         }
>
>         private void returnToPool(int resourceId, MediaPlayer player) {
>                 ArrayList pool = pools.get(new 
> Integer(resourceId));
>                 pool.add(player);
>         }
>
> }
>
> public class MediaPlayerSoundManager {
>         private static final String TAG = "MediaPlayerSoundManager";
>
>         private Context context;
>         private MediaPlayerPool pool;
>         private HashMap soundResourceMap;
>
>         public MediaPlayerSoundManager(Context context) {
>                 this.context = context;
>                 this.pool = new MediaPlayerPool(context, 
> AudioManager.STREAM_MUSIC);
>                 this.soundResourceMap = new HashMap();
>         }
>
>         public void init() {
>                 release();
>                 pool.addMedia(R.raw.sound_1, 2);
>                 soundResourceMap.put(SOUND_1, R.raw.sound_1);
>         }
>
>         public void playSound(int soundId) {
>                 int resourceId = getResourceId(soundId);
>                 if (pool.hasMedia(resourceId)) {
>                         pool.playMedia(resourceId);
>                 } else {
>                         playOneShotSound(resourceId);
>                 }
>         }
>
>         private int getResourceId(int soundId) {
>                 Integer resourceId = soundResourceMap.get(soundId);
>                 if (resourceId == null) {
>                         Log.e(TAG, "No resource found for soundId " + 
> soundId);
>                 }
>                 retur

[android-developers] Re: Head-scratcher: NullPointerException from startActivity(ACTION_CALL)

2008-11-11 Thread dreamerBoy

initiateCall is just an Activity.  Activity initiateCall = new
Activity(); (actually a derived class of Activity with nothing added
but debug statements to signal when each lifecycle/callback method is
called).

On Nov 10, 5:37 pm, dreamerBoy <[EMAIL PROTECTED]> wrote:
> Hi - thank you for your reply.  Yes, line 254 is just:
>
>          initiateCall.startActivityForResult(myIntent,
> CALL_SETUP_ACTIVITY_ID);
>
> That is the statement that throws the NullPointerException.
>
> On Nov 10, 4:28 pm, Christine <[EMAIL PROTECTED]> wrote:
>
> > Your log says that the error is in line 254 of PhoneTestService, if
> > that's a class you wrote.
>
> > On Nov 11, 1:20 am,dreamerBoy<[EMAIL PROTECTED]> wrote:
>
> > > Taking a hint from the source code, I tried to implement an
> > > Instrumentation class in the hopes that that was what Android was
> > > looking for -
>
> > > Added:
>
> > >  > > android:name=".PhoneTestInstrumentation">
>
> > > and
>
> > >  > > android:name="android.permission.RUN_INSTRUMENTATION"> > > permission>
>
> > > to the manifest.
>
> > > However, same error.
>
> > > On Nov 10, 2:22 pm,dreamerBoy<[EMAIL PROTECTED]> wrote:
>
> > > > Thanks for your reply - ha ha, wouldn't that be nice if it were that
> > > > simple.  Nope, I checked the return from the Uri.parse - not null.
>
> > > > I got a hold of the Android source code.  It is crashing here in
> > > > Activity.java:
>
> > > >      public void startActivityForResult(Intent intent, int
> > > > requestCode) {
> > > >          if (mParent == null) {
> > > >             Instrumentation.ActivityResult ar =
> > > > ->>>             mInstrumentation.execStartActivity(
> > > >                      this, mMainThread.getApplicationThread(), mToken,
> > > > th 
>
> > > >                      intent, requestCode);
>
> > > > Apparently, mInstrumentation is null.
> > > > mInstrumentation is set in a routine called attach in Activity.java.
>
> > > > I am trying to launch the Activity inside a Service - I don't see
> > > > anything that says that's illegal.  However, clearly, I'm not giving
> > > > Android something that it wants.
>
> > > > Still scratching my head on this one for the time being...
>
> > > > On Nov 7, 6:10 pm, Chris <[EMAIL PROTECTED]> wrote:
>
> > > > > You don't check if Uri.parse returns null, do you?
>
> > > > > On Fri, Nov 7, 2008 at 3:53 PM,dreamerBoy<[EMAIL PROTECTED]> wrote:
>
> > > > > > Hi,
>
> > > > > > I'm attempting to initiate an outgoing call from inside a Service.
>
> > > > > > In onStart(), I create an ACTION_CALL Intent, then attempt to start 
> > > > > > an
> > > > > > Activity
>
> > > > > >         myIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" +
> > > > > > phoneNumber));
>
> > > > > >         initiateCall.startActivityForResult(myIntent,
> > > > > > CALL_SETUP_ACTIVITY_ID);
>
> > > > > > However, when I run the code I get a NullPointerException.  Clearly,
> > > > > > the intent and activity are non-null, so I'm wondering what Android 
> > > > > > is
> > > > > > lacking here.
>
> > > > > > 11-07 13:24:19.801: INFO/PhoneTestService(1250): onCreate called
> > > > > > 11-07 13:24:19.801: INFO/PhoneTestService(1250): onStart called
> > > > > > 11-07 13:24:19.801: INFO/PhoneTestService(1250): doIt called
> > > > > > 11-07 13:24:19.811: DEBUG/PhoneTestService(1250): creating
> > > > > > initiateCall activity
> > > > > > 11-07 13:24:19.811: DEBUG/PhoneTestService(1250): initiateCall is 
> > > > > > NOT
> > > > > > NULL!
> > > > > > 11-07 13:24:19.820: INFO/PhoneTestService(1250): phone state is:
> > > > > > CALL_STATE_IDLE
> > > > > > 11-07 13:24:21.601: INFO/PhoneTestService(1250): starting to listen
> > > > > > Fri Nov 07 13:24:19 PST 2008
> > > > > > 11-07 13:24:21.622: INFO/PhoneTestService(1250): starting call 
> > > > > > intent.
> > > > > > 11-07 13:24:21.622: DEBUG/PhoneTestService(1250): myIntent is NOT
> > > > > > NULL!
> > > > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250): ERROR:
> > > > > > java.lang.NullPointerException
> > > > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):
> > > > > > java.lang.NullPointerException
> > > > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > > > android.app.Activity.startActivityForResult(Activity.java:2528)
> > > > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > > > test.phone.PhoneTestService.doIt(PhoneTestService.java:254)
> > > > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > > > test.phone.PhoneTestService.onStart(PhoneTestService.java:145)
> > > > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > > > android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2429)
> > > > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > > > android.app.ActivityThread.access$3100(ActivityThread.java:112)
> > > > > > 11-07 13:24:21.632: ERROR/PhoneTestService(1250):     at
> > > > > > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1640)

[android-developers] Re: Check for new version of applications

2008-11-11 Thread Peli

As far as I understand, Google plans something like this for the
future (maybe when paid apps start to become possible). For now the
developer is left by themselves.

We also initially copied an update checker routine in all of our OI
applications, but this has 2 major drawbacks:
1) It requires each application to have the INTERNET permission, even
though the app itself won't use it.
2) A lot of code is duplicated in the various applications.

We have been developing OI Update, an open source update checker,
which is ready to be released soon. We wrote it mainly for our own
applications, but it is written generally enough to allow other
applications to take advantage of it as well easily.

Your application only needs to include a small meta-data in your
manifest, and you need to keep a file on a server with update
information (which can be compatible to VeeCheck; AndAppStore.com can
generate that file on the fly). This inconvenience is necessary,
because the Market does not provide version information to 3rd party
applications (or at least I'm not aware of how to do it).

All the rest is handled by OI Update. It checks every couple of days
(as set by the user) for updates, and notifies the user. If the user
wishes they are then directly forwarded to the Market where they can
download the new version.

I hope this could clarify a couple of points.

Peli
www.openintents.org

On Nov 11, 3:48 pm, loty <[EMAIL PROTECTED]> wrote:
> I'm wondering about the same thing. All applications need to have a
> simple ability to notify users of new versions. For me 3rd party
> updaters/checkers is not an option - I can just as easily add simple
> check against my web site and download new APK file directly.
>
> A much cleaner solution is to query Android Market directly for new
> version.
> Can anyone illuminate me if this is possible or planned in the future.
>
> On Nov 10, 10:02 am, G <[EMAIL PROTECTED]> wrote:
>
> > So version checking needs to be done through an outside resource...
> > Is there anintentwe can use to launch theAndroidMarketApp
> > directly to the listing for our own app, for when an update is
> > available?
>
> > On Nov 10, 4:35 am, friedger <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > we have prepared a release version of the OI Updater. There is no need
> > > to send intents, but developers only need to add a meta-data node to
> > > the application manifest in order to be handled by the updater.
>
> > > Early feedback welcome!
>
> > > Description:http://www.openintents.org/en/node/136
> > > Download:http://openintents.googlecode.com/files/UpdateChecker-1.0.0.apk
>
> > > Cheers,
> > > Friedger
>
> > > On 6 Nov., 20:31, Guillaume Perrot <[EMAIL PROTECTED]> wrote:
>
> > > > Because we use a XMPP based application, we chosed Pubsub as a way to
> > > > notify new versions to the user. The main advantage is that it uses a
> > > > push model. The user is aware of a new version when he launches
> > > > the app or in real time if he's online while a new version has just
> > > > been released. No timer or service at all in the application code.
>
> > > > On Nov 5, 11:57 pm, friedger <[EMAIL PROTECTED]> wrote:
>
> > > > > Currently, relying on an external resource is the way to do updates,
> > > > > this is how it is described in the documentation.
>
> > > > > If someone is checking againstMarket, please let us know.
>
> > > > > Friedger
>
> > > > > On Nov 4, 8:49 pm, "Dan B." <[EMAIL PROTECTED]> wrote:
>
> > > > > > isn't there some way tocheckthe version against theMarketinstead
> > > > > > of having to host version information somewhere else? I know the app
> > > > > > Locale somehow knows when anupdateis available, it seems reasonable
> > > > > > to query theMarketrather than relying on outside sources :\
>
> > > > > > On Nov 1, 1:50 pm,friedger<[EMAIL PROTECTED]> wrote:
>
> > > > > > > I'd say the package name is the global identifier.
>
> > > > > > > Maybe you can just provide a VeeCheck url based on the package 
> > > > > > > name
> > > > > > > (as alternative to the app id). So I couldcheckthat url. If you
> > > > > > > don't host an app for the package name or if it is not unique you
> > > > > > > could return a HTTP 400.
>
> > > > > > >Friedger
>
> > > > > > > On 1 Nov., 17:37, Al Sutton <[EMAIL PROTECTED]> wrote:
>
> > > > > > > >Friedger,
>
> > > > > > > > How are you identifying the apps?, I'd happily add an extra 
> > > > > > > > field or two
> > > > > > > > to the AndAppStore.com data that you can search for if it would 
> > > > > > > > be useful.
>
> > > > > > > > Al.
>
> > > > > > > >friedgerwrote:
> > > > > > > > > The idea is that the Updater will also be ablecheckall 
> > > > > > > > > applications
> > > > > > > > > it knows about by a single button clicked or scheduled task. 
> > > > > > > > > So, once
> > > > > > > > > theintentfrom one application is processed by theUpdateit is
> > > > > > > > > possible to include this application to the periodicupdate.
>
> > > > > > > > > A more gener

[android-developers] Re: AlarmManager.RTC_WAKEUP Not Waking Device?

2008-11-11 Thread g1bb

Another question on this:

Have you seen the Stopwatch application developed by Tom Taylor? I
just downloaded it, and it keeps counting after the phone is put to
sleep entirely. Any ideas on how he's doing that? I'm looking for that
kind of functionality.

Thanks again.

On Nov 11, 3:51 am, hackbod <[EMAIL PROTECTED]> wrote:
> It does wake it up, but you are going to need to hold a wake lock to
> keep the device awake after your intent receiver returns.
>
> On Nov 10, 11:14 pm,g1bb<[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello,
>
> > I've been trying to use AlarmManager.RTC_WAKEUP to wake up my device
> > while it's sleeping, and then play some sounds. It seems like when
> > it's charging, this works fine, but when it's not, the service doesn't
> > start until I hit the menu button and am presented with the lock
> > screen.
>
> > Also, this seems to be working fine in the emulator, but not my real
> > phone.
>
> > Here's the alarm scheduling:
> >                   ntent intent = new Intent(Main.this, OneShotAlarm.class);
> >                   PendingIntent sender =
> > PendingIntent.getBroadcast(Main.this, 0, intent, 0);
>
> >                     // We want the alarm to go off 30 seconds from now.
> >                     Calendar calendar = Calendar.getInstance();
> >                     calendar.setTimeInMillis(System.currentTimeMillis());
> >                     calendar.add(Calendar.SECOND, 60);
>
> >                     // Schedule the alarm!
> >                     AlarmManager am =
> > (AlarmManager)getSystemService(ALARM_SERVICE);
> >                     am.set(AlarmManager.RTC_WAKEUP,
> > calendar.getTimeInMillis(), sender);
> > -
> > The OneShotAlarm BroadCastReceiver:
>
> > public class OneShotAlarm extends BroadcastReceiver
> > {
>
> >     @Override
> >     public void onReceive(Context context, Intent intent)
> >     {
> >         Toast.makeText(context, "OneShotAlarm Broadcast invoked",
> > 1000).show();
>
> >           intent = new Intent(context, ServiceClassToRun.class);
>
> >          context.startService(intent);
> >      }
> > -
> > The Service:
>
> > public class ServiceClassToRun extends Service {
> >         protected static final int Rnd = 0;
>
> >          public void onStart(Intent intent, int startId) {
> >          //do some business here
> >      }
> > -
> > And finally, my manifest:
>
> >  
> >  
>
> > Any ideas are greatly appreciated. Has anyone else experienced this as
> > well? Thanks in advance.- 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to send email programmatically?

2008-11-11 Thread Sunit Katkar
Suppose I have an Activity which has couple of text fields - one for the
subject and one for body text.
And there is a simple Button. When user clicks the button, I wish to send
the text in the textfields via email to a predetermined email address.
How can I achieve this?

Sorry for being lazy and not looking up the SDK docs :)

PS: I have configured the EMAIL app on G1 using the Email setup steps, so it
can receive and send email from my email account.

-- 
- Sunit Katkar
http://sunitkatkar.blogspot.com/ - Android OS Tutorials

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: disable home button

2008-11-11 Thread hackbod

It didn't, it is a huge hack where it restarts itself when the user
tries to leave it.  It's a cute hack for the toddler lock, but far
from something any normal application should do.  (And seriously, the
system -should- detect this and kill an app that is doing it.  I would
consider the fact that toddler lock can do this to be a bug in the
system.)

On Nov 11, 8:33 am, zl25drexel <[EMAIL PROTECTED]> wrote:
> anyone?
>
> On Nov 10, 9:53 pm, zl25drexel <[EMAIL PROTECTED]> wrote:
>
> > so how did the toddlers lock disable the home button?
>
> > On Nov 10, 9:41 pm, Romain Guy <[EMAIL PROTECTED]> wrote:
>
> > > Not if the app starts on boot. (You can always boot in safe mode but
> > > still... it's annoying.)
>
> > > The Home key is the best way for the user to go back to a familiar
> > > place. That's why pressing Home twice, no matter where you are, will
> > > always take you back to the center screen on Home's desktop.
>
> > > On Mon, Nov 10, 2008 at 6:26 PM, zl25drexel <[EMAIL PROTECTED]> wrote:
>
> > > > you only need to restart the phone.
>
> > > > On Nov 10, 8:51 pm, Mark Murphy <[EMAIL PROTECTED]> wrote:
> > > >> zl25drexel wrote:
> > > >> > why is making the screen lock actually lock evil?
>
> > > >> 1. If the app has a bug, and won't "unlock", the user is hosed
>
> > > >> 2. If the app is malicious, and won't "unlock", the user is hosed
>
> > > >> The Google team has tried to minimize any chance of a rogue application
> > > >> causing problems, particularly permanent ones. This approach has
> > > >> trade-offs; making it difficult to disable the home button is one of 
> > > >> those.
>
> > > >> --
> > > >> Mark Murphy (a Commons Guy)http://commonsware.com
>
> > > >> Android Training on the Ranch! -- Mar 16-20, 
> > > >> 2009http://www.bignerdranch.com/schedule.shtml
>
> > > --
> > > Romain Guywww.curious-creature.org
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Signing Apps for a external testing group

2008-11-11 Thread WampBier

Hi All,

I want to sign my application to let a group of tester install it to
there mobiles.
Is it possible to create certifications with limited time of use for
the test people.

Or can I use the existing signing method with a  validity period  from
60 days?

I need a new certification, or?

Is it possible to re-install a app with a different certification?

Or should I give them the app with the dev-certification?


Greetings
WampBier

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Two Notifications

2008-11-11 Thread Peli

Maybe this helps:

http://code.google.com/android/reference/android/app/Notification.html#number
"The number of events that this notification represents. For example,
if this is the new mail notification, this would be the number of
unread messages. This number is be superimposed over the icon in the
status bar. If the number is 0 or negative, it is not shown in the
status bar. "

The idea is to only show 1 notification, also when you slide down the
screen, leaving the user with only 1 choice.
But this 1 choice directs her to your application where you present a
list of possible options (the ones you wanted to show in separate
notifications in the first place).

Peli

On Nov 11, 3:34 pm, Christine <[EMAIL PROTECTED]> wrote:
> On Nov 11, 2:39 am, hackbod <[EMAIL PROTECTED]> wrote:
>
> > Perhaps think about doing something like the calendar app,
> > where selecting the notification brings you to a list of the
> > interesting things behind it.
>
> Well, that's kind of what I was hoping to achieve by having one icon
> pop up multiple notifications in the screen that slides down when you
> pull down the task bar icon. I can do that, but it shows two icons
> rather than one. My problem is not the notifications, my problem is
> that I get two icons for one Notificationmanager where I need one
> icon.
>
>
>
> > On Nov 10, 4:06 pm, Christine <[EMAIL PROTECTED]> wrote:
>
> > > Just got an email from a user who says "why can't the app just start
> > > right when you click the task bar icon". If that could be done, my app
> > > would have one icon per action. But the user gets these bars that come
> > > down, where you can put multiple notifications. So what you want is
> > > one icon, even if you have multiple notifications at the same time. I
> > > want to keep both of them, because they represent different user
> > > actions.
> > > What bothers me is that you have multiple bars appearing, but why do
> > > you get multiple icons also? It looks very cute, a whole series of
> > > tweeting birds in the task bar, but I don't think a user appreciates
> > > that, after an initial smile :-)
>
> > > On Nov 11, 12:27 am, Peli <[EMAIL PROTECTED]> wrote:
>
> > > > Can't you simply remove your existing notification before you add the
> > > > new one?
>
> > > > Peli
>
> > > > On Nov 10, 11:14 pm, Christine <[EMAIL PROTECTED]> wrote:
>
> > > > > How can I send two Notifications to one NotificationManager in a way
> > > > > that I get only one icon for that NotificationManager? What happens
> > > > > now is that you get a second icon for the second notification - and a
> > > > > third, fourth, etc.
> > > > > I've seen this question before, but I don't think it got answered?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] PacMan Game on Android

2008-11-11 Thread Salentinux

Is it possible to play namco pacman on the emulator? If yes, someone
could send me a copy? I'm in italy..here there aren't physical
devices!!! tnks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Check for new version of applications

2008-11-11 Thread loty

I'm wondering about the same thing. All applications need to have a
simple ability to notify users of new versions. For me 3rd party
updaters/checkers is not an option - I can just as easily add simple
check against my web site and download new APK file directly.

A much cleaner solution is to query Android Market directly for new
version.
Can anyone illuminate me if this is possible or planned in the future.


On Nov 10, 10:02 am, G <[EMAIL PROTECTED]> wrote:
> So version checking needs to be done through an outside resource...
> Is there anintentwe can use to launch theAndroidMarketApp
> directly to the listing for our own app, for when an update is
> available?
>
> On Nov 10, 4:35 am, friedger <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > we have prepared a release version of the OI Updater. There is no need
> > to send intents, but developers only need to add a meta-data node to
> > the application manifest in order to be handled by the updater.
>
> > Early feedback welcome!
>
> > Description:http://www.openintents.org/en/node/136
> > Download:http://openintents.googlecode.com/files/UpdateChecker-1.0.0.apk
>
> > Cheers,
> > Friedger
>
> > On 6 Nov., 20:31, Guillaume Perrot <[EMAIL PROTECTED]> wrote:
>
> > > Because we use a XMPP based application, we chosed Pubsub as a way to
> > > notify new versions to the user. The main advantage is that it uses a
> > > push model. The user is aware of a new version when he launches
> > > the app or in real time if he's online while a new version has just
> > > been released. No timer or service at all in the application code.
>
> > > On Nov 5, 11:57 pm, friedger <[EMAIL PROTECTED]> wrote:
>
> > > > Currently, relying on an external resource is the way to do updates,
> > > > this is how it is described in the documentation.
>
> > > > If someone is checking againstMarket, please let us know.
>
> > > > Friedger
>
> > > > On Nov 4, 8:49 pm, "Dan B." <[EMAIL PROTECTED]> wrote:
>
> > > > > isn't there some way tocheckthe version against theMarketinstead
> > > > > of having to host version information somewhere else? I know the app
> > > > > Locale somehow knows when anupdateis available, it seems reasonable
> > > > > to query theMarketrather than relying on outside sources :\
>
> > > > > On Nov 1, 1:50 pm,friedger<[EMAIL PROTECTED]> wrote:
>
> > > > > > I'd say the package name is the global identifier.
>
> > > > > > Maybe you can just provide a VeeCheck url based on the package name
> > > > > > (as alternative to the app id). So I couldcheckthat url. If you
> > > > > > don't host an app for the package name or if it is not unique you
> > > > > > could return a HTTP 400.
>
> > > > > >Friedger
>
> > > > > > On 1 Nov., 17:37, Al Sutton <[EMAIL PROTECTED]> wrote:
>
> > > > > > >Friedger,
>
> > > > > > > How are you identifying the apps?, I'd happily add an extra field 
> > > > > > > or two
> > > > > > > to the AndAppStore.com data that you can search for if it would 
> > > > > > > be useful.
>
> > > > > > > Al.
>
> > > > > > >friedgerwrote:
> > > > > > > > The idea is that the Updater will also be ablecheckall 
> > > > > > > > applications
> > > > > > > > it knows about by a single button clicked or scheduled task. 
> > > > > > > > So, once
> > > > > > > > theintentfrom one application is processed by theUpdateit is
> > > > > > > > possible to include this application to the periodicupdate.
>
> > > > > > > > A more general solution that includes all installed 
> > > > > > > > applications is
> > > > > > > > currently not possible as I can't determine the location of the
> > > > > > > >versioninfo file.
>
> > > > > > > > The apk mentioned above is provided for developers to test. In 
> > > > > > > > the
> > > > > > > > releaseversionthe interval between two checks will be at least 
> > > > > > > > 24
> > > > > > > > hours, so you can start the service as often as you like but 
> > > > > > > > thecheck
> > > > > > > > is only performed once every 24 hours. Furthermore, only the 
> > > > > > > > log cat
> > > > > > > > shows whether the installedversionis up-to-date or not. In both
> > > > > > > > cases the notification is show (this is to simplify the tests).
>
> > > > > > > > Would you like to have a different Notification text? Any ideas 
> > > > > > > > for
> > > > > > > > icons?
>
> > > > > > > >Friedger
>
> > > > > > > > On 1 Nov., 13:18, Al Sutton <[EMAIL PROTECTED]> wrote:
>
> > > > > > > >> HiFriedger,
>
> > > > > > > >> I've updated AndAppStore.com to provide a versionCode in 
> > > > > > > >> theupdate.xml
> > > > > > > >> as you requested.
>
> > > > > > > >> At the moment anyone with applications listed will find that 
> > > > > > > >> they can
> > > > > > > >> specify the versionCode in the details about a 
> > > > > > > >> releasedversion(not the
> > > > > > > >> application details page, the release details page).
>
> > > > > > > >> I am working on code to pull the information from the manifest 
> > > > > > > >> included
> > > > > > > >> in the apk, but this is a 

[android-developers] Re: Store audio in SQLite?

2008-11-11 Thread Marcelo Martim
Hi,

Only a suggestion.

If audio files are the reason of your database size increase, you could
store this kind of files
in simcard and use a string field in database to access this file.

Have fun...

Marcelo



On Tue, Nov 11, 2008 at 11:31 AM, g1ster <[EMAIL PROTECTED]> wrote:

>
> Does SQLite support mime type storage like an audio stream? What would
> be the column type? Any example SQL syntax reference would help.
>
> I know it is recommended to store those as files in external devices,
> but want to explore direct database storage option.
>
> 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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] WiFi within of emulator

2008-11-11 Thread Monic79

Hello,

I would like to know how to use a wireless connection of a laptop to
simulate WIFI connection in the Android emulator.
I would like to add a DLL or SO to the android emulator to use API
WIFI.
I have sources of android but, I do not understand where is the call
to the native library in  API java WIFI and I do not understand what
is the name of native library for wifi in android.

Someone can help me?

Thank you very mutch.

Monica

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Pay app support?

2008-11-11 Thread strazzere

Some applications have already implemented the expiration date and
have been cracked already. The Android Market seems to be rather
secure, the problem seems to be in the developers coding of protection
schemes in products...

A registration method with online check would probably be your best
bet.

On Nov 10, 8:18 pm, "Jesse Scherer" <[EMAIL PROTECTED]> wrote:
> If you absolutely must offer a trial, and the Market won't support it, you
> could offer a trial version of your app with some sort of kill switch (the
> application sets a flag and tells itself to stop working after 10 days) and
> a paid version that does not do this. It would not prevent a truly
> determined person from circumventing your terms, but given the nature of
> Android, why couldn't somebody just hack the Market app to ignore trial
> periods anyway?
> My 2c
>
> Jesse
>
> On Mon, Nov 10, 2008 at 7:10 PM, Christine <[EMAIL PROTECTED]>wrote:
>
>
>
> > Hopefully, they will allow a trial period. iPhone market doesn't allow
> > that, so you're forced to either charge for the first download, or
> > make the app free.
>
> > On Nov 10, 9:52 pm, Eric <[EMAIL PROTECTED]> wrote:
> > > It was announced that a 30% cut of the Market price will be paid to
> > > the carrier(s), and the remaining 70% will be paid to the developer.
>
> > > You can also sell apps through venues other than the Market, and avoid
> > > the 30% cut, but it seems likely that most phone owners will only look
> > > for apps in the Market.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Comment spam in android market :(

2008-11-11 Thread Robert Green

Agreed.  Something needs to be done.  I think google could allocate
one employee to scanning the comments for now and perhaps banning/
warning users who made inappropriate comments from commenting?

On Nov 11, 8:29 am, Al Sutton <[EMAIL PROTECTED]> wrote:
> Ratings are always a highly subjective thing which is why AndAppStore
> hasn't included them .
>
> My 2/5 might be your 3/5 for no other reason than I've seen better
> elsewhere that you haven't, your 4/5 may be my 2/5 just because you like
> a colour scheme that I don't. You can't say people can only rate lower
> than 3 if they type a long comment because you'll end up with junk
> comments just to pad the space, and if you're going to say 300
> characters for below 3, why not 300 characters for above 3 so people
> have to justify high rating to avoid attempts to bump apps to the top of
> the popular list.
>
> Al.
>
>
>
> Protocol-X wrote:
> > Yes it is rediculous,
> > There is swearing, racial slurs, comments about body parts, all
> > randomly out of nowhere.  Google needs to kill the comments from being
> > displayed so that only the app creator can see them and the rating
> > system is defunk as well because people are ratting 1;'s because they
> > dont understand apps or there is a german online book being rated ones
> > because people are commenting its stupud because its in german... what
> > do u expect even the descripion is German if u cannot see this was in
> > German dont rate it poorly.. these are all situations and issue that
> > need to be worked out.  or require atleast a 300 character comment
> > inorder to rate lower than a 3 so people are not just rated unfairly
> > because of immature people.
>
> > On Nov 11, 5:56 am, Al Sutton <[EMAIL PROTECTED]> wrote:
>
> >> I can see this as a good idea so I've comment ratings into
> >> AndAppStore.com, sorted the displayed comments by ranking, and show 5 at
> >> a time.
>
> >> It took me a couple of hours to put the code together, so I'd hope that
> >> the guys at google can do something similar for marketplace in the next
> >> few days.
>
> >> Al.
>
> >> plusminus wrote:
>
> >>> Comments with bad ratings get hidden and need to be expanded by the
> >>> user --> Almost no one will see them anymore
>
> >>> +1 for Comment-Rating-System
>
> >>> On 11 Nov., 00:10, zl25drexel <[EMAIL PROTECTED]> wrote:
>
>  well the ratings/comments now are just the same as the ratings/
>  comments on youtube. does any1 ever reads them?
>
>  On Nov 10, 4:29 pm, "Andrew Burgess" <[EMAIL PROTECTED]> wrote:
>
> > On Mon, Nov 10, 2008 at 4:18 PM, Disconnect <[EMAIL PROTECTED]> wrote:
>
> >> ..or just punt out users for ToS violations.
>
> >> On Sat, Nov 8, 2008 at 3:24 PM, ryaninc <[EMAIL PROTECTED]> wrote:
>
> >>> I wholeheartedly agree. The comments are invaluable for determining
> >>> how well an application works, but it's almost to the point where the
> >>> comments are worthless because there's so much spam and completely 
> >>> off-
> >>> topic discussion.
>
> >>> While I don't like comment moderation as a whole, there should be
> >>> automatic filtering at the very least. Maybe Google could implement a
> >>> filter that would delete comments with swear words, or even just turn
> >>> them into asterisks.
>
> >>> There really needs to be a solution to this, it's really getting
> >>> bad. :-(
>
> > Perhaps an implementation similar to many online retailers where users 
> > can
> > say whether a review was helpful.  Comments that others found helpful in
> > making their decision could be floated to the top (or at least supply a
> > sorting option/preference) so that it's easier to find more useful
> > information.  Similarly, a comment with enough bad feedback could be 
> > put up
> > for some sort of review, and if deemed acceptable, the offending user 
> > could
> > have comment privileges banned for some period of time.
>
> > --
> > Andrew Burgess
>
> >> --
> >> ==
> >> Funky Android Limited is registered in England & Wales with the
> >> company number  6741909. The registered head office is Kemp House,
> >> 152-160 City Road, London,  EC1V 2NX, UK.
>
> >> The views expressed in this email are those of the author and not
> >> necessarily those of Funky Android Limited, it's associates, or it's
> >> subsidiaries.- Hide quoted text -
>
> >> - Show quoted text -
>
> --
> ==
> Funky Android Limited is registered in England & Wales with the
> company number  6741909. The registered head office is Kemp House,
> 152-160 City Road, London,  EC1V 2NX, UK.
>
> The views expressed in this email are those of the author and not
> necessarily those of Funky Android Limited, it's associates, or it's
> subsidiaries.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to and

[android-developers] Re: no callback to onItemClick() on clicking my ListView

2008-11-11 Thread Romain Guy

AlarmClock does not select the whole row. It uses two different
widgets inside one list item. You can however give the highlight to
the entire row by using android:addStatesFromChildren (or something
similar, check the documentation of ViewGroup.)

On Tue, Nov 11, 2008 at 8:46 AM, Peli <[EMAIL PROTECTED]> wrote:
>
> I have a similar problem. I want to do something similar as the
> AlarmClock application does (with CheckBox to the right, and clickable
> area to the left). With the onClick listeners this works in touch
> mode. Still, using the trackball, the whole row is selected. How can I
> prevent that and have the clickable area and the checkbox be
> selectable by trackball?
>
> Peli
>
> On Nov 11, 3:02 am, Romain Guy <[EMAIL PROTECTED]> wrote:
>> Test trackball navigation then, it might not work.
>>
>>
>>
>> On Mon, Nov 10, 2008 at 5:24 PM, Nickname <[EMAIL PROTECTED]> wrote:
>>
>> > Hi, Romain and Sunit.
>>
>> > Thanks for replies from you both.
>>
>> > My app needs to get both callbacks from the Button as well as from
>> > "the other area" of a ListView item.
>>
>> > Right now, I use a onClick listener to the LinearLayout of every
>> > ListView item. It works so far :-)
>>
>> > On Nov 10, 8:34 am, Romain Guy <[EMAIL PROTECTED]> wrote:
>> >> If you put a focusable View inside a list item, then the list item
>> >> will not be clickable. You would have to set a click listener on the
>> >> button for instance.
>>
>> >> On Sun, Nov 9, 2008 at 10:18 PM, Nickname <[EMAIL PROTECTED]> wrote:
>>
>> >> > One of my ListView's has a Button view on every item's LinearLayout.
>>
>> >> > I just found that clicking on any item of the ListView does not
>> >> > callback its onItemClick(), which is set thru
>> >> > ListView.setOnItemClickListener().
>>
>> >> > If I remove the Button view from item layout, callback is ok then.
>>
>> >> > Can anybody advise me how I get the callback on the ListView with
>> >> > Button?
>>
>> >> > Thanks.
>>
>> >> --
>> >> Romain Guywww.curious-creature.org
>>
>> --
>> Romain Guywww.curious-creature.org
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: no callback to onItemClick() on clicking my ListView

2008-11-11 Thread Nickname

Hi Sunit,

To get the position/index of the item on which its button is clicked
is not hard. It is just equal to the final "position" parameter passed
to getView(). So placing the parameter in onClicked callback of the
button gets it done.

On Nov 11, 8:16 am, "Sunit Katkar" <[EMAIL PROTECTED]> wrote:
> Add some id or attribute to your Button which has the information about the
> List item - say the position or index of the list item. So when a button
> click is received, you not only get the button clicked but also the position
> in the list.
> Maybe this will help. I am not sure if Android allows event bubbling and
> capture like in Javascript.
>
> - Sunit
>
>
>
> On Mon, Nov 10, 2008 at 5:24 PM, Nickname <[EMAIL PROTECTED]> wrote:
>
> > Hi, Romain and Sunit.
>
> > Thanks for replies from you both.
>
> > My app needs to get both callbacks from the Button as well as from
> > "the other area" of a ListView item.
>
> > Right now, I use a onClick listener to the LinearLayout of every
> > ListView item. It works so far :-)
>
> > On Nov 10, 8:34 am, Romain Guy <[EMAIL PROTECTED]> wrote:
> > > If you put a focusable View inside a list item, then the list item
> > > will not be clickable. You would have to set a click listener on the
> > > button for instance.
>
> > > On Sun, Nov 9, 2008 at 10:18 PM, Nickname <[EMAIL PROTECTED]> wrote:
>
> > > > One of my ListView's has a Button view on every item's LinearLayout.
>
> > > > I just found that clicking on any item of the ListView does not
> > > > callback its onItemClick(), which is set thru
> > > > ListView.setOnItemClickListener().
>
> > > > If I remove the Button view from item layout, callback is ok then.
>
> > > > Can anybody advise me how I get the callback on the ListView with
> > > > Button?
>
> > > > Thanks.
>
> > > --
> > > Romain Guywww.curious-creature.org
>
> --
> - Sunit Katkarhttp://sunitkatkar.blogspot.com/- Android OS Tutorials
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Connect via USB resets prefs

2008-11-11 Thread Eric B

Now I'm not sure what clears my preferences.  I've tested the USB
connection theory and it is quite inconsistent.  Has anyone else
experienced a loss of preference state in their apps?

Thanks,
Eric
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



  1   2   >