[android-developers] Re: Development Patterns

2011-05-12 Thread Kacee
Please read little more from http://developer.android.com
Once you'll start writing Android code, these queries will go off

On May 11, 2:08 pm, Cory Kaufman allspirits...@gmail.com wrote:
 Hi,

 Has anyone started cataloging common design patterns that arise when
 developing Android apps?

 For example:

 It's worked out well for me to create a base class that extends
 Activity that all of my other activities extend, so I have a central
 place to put common functionality.
 When should strings be listed in values/strings.xml and when should
 they be hard coded?
 What kind of conventions should be used when giving views ids? Should
 there not be views in different layouts with the same name?

 Etc.

 Cory

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


[android-developers] holder.text.setText(Listdisplay.name[position]);

2011-05-12 Thread subha
Hi Android developer groups!

 Use the Typeface with holder means  properly get output, i mean here *
holder.text.setTypeface(tf);* ,
 but how can set the Typeface here * holder.text
.setText(Listdisplay.name[position]);*

i mean  how can use setTypeface with holder and setText? See below code

  public View getView(int position, View convertView, ViewGroup parent)
 {
View vi=convertView;
ViewHolder holder;
Typeface tf=Typeface.createFromAsset(context.getAssets(),
font.ttf);

if(convertView==null)
 {
  View vi;
  TextView text;
  vi = inflater.inflate(R.layout.item, null);
  holder.text=(TextView)vi.findViewById(R.id.text);
 * holder.text.setTypeface(tf);*
  vi.setTag(holder);
  }

 else

 holder=(ViewHolder)vi.getTag();
* holder.text.setText(Listdisplay.name[position]);*
 return vi;
}



Thanks,
suba

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

[android-developers] Re: NFC

2011-05-12 Thread nadam
The closest option currently available is NDEF push.
http://developer.android.com/guide/topics/nfc/index.html#p2p

Tag/card emulation is not included in Android yet.

On 10 Maj, 06:24, abe chivtim...@gmail.com wrote:
 Hi, I'm a new one in android development, I wonder if I want to use
 Nexus S 2.3.3 as tag  and scan it with NFC-Reader, what can I do? I
 try to search sample code but I couldn't get it yet, any one know
 please help ! thank in advance.

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


[android-developers] Re: disable scroll when activity loads

2011-05-12 Thread Hitendrasinh Gohil
hi,
is there anyone ?

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


Re: [android-developers] Re: disable scroll when activity loads

2011-05-12 Thread BHL
*My friend, I found a website to make big money online.
There is address:
 http://BigExtraCash.com/_6a6b7d72.htm

*

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

Re: [android-developers] NFC

2011-05-12 Thread BHL
*My friend, I found a website to make big money online.
There is address:
http://BigExtraCash.com/_6a6b7d72.htm*

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

[android-developers] R: Re: menu item disabled, but clickable

2011-05-12 Thread Zanarotti Michele
I haven't found anything like 'setClickable'. Where did you get it ?

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

[android-developers] Re: Android and JMX

2011-05-12 Thread Streets Of Boston
As far as i know, you can't do that. JMX (javax.management.**) is not 
supported by Android (not in android.jar) or by any third part library for 
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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: (2nd try) Segmentation fault when loading a certain class from an OSGi framework under Android 2.2 2.3

2011-05-12 Thread Streets Of Boston
i can't help you with your particular problem, but I'm wondering why you 
write your Android app under an OSGi framework. That looks like overkill to 
me. Couldn't you use just plain Java? 

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

[android-developers] Re: Programmatically add contact and start Dialer with some delay

2011-05-12 Thread viktor
Any ideas?

On 11 Тра, 17:23, viktor victor.scherb...@gmail.com wrote:
 Hi,

 My app create new contact, inserts it into DB, and with little
 delay(300 - 500 мс) Dialer  will start with number of new contact.

 At first try Dialer shows only a number on the Screen, after second
 try it shows Full name.

 This action repeats every time when phone was rebooted.

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


Re: [android-developers] On CRC32, LVL and tamper-proof app

2011-05-12 Thread Dianne Hackborn
On Wed, May 11, 2011 at 8:47 PM, Nikolay Elenkov
nikolay.elen...@gmail.comwrote:

 Does this work at all? The signature is different from the public key, so
 it
 shouldn't. Even if it did, if an attacker can repackage your application,
 they can replace the public key in the APK with their own. You have to
 either do this on a server, or take measures to make the public key in
 the apk really hard to get to.


Once they are to the point of modifying your application in order to pirate
it, it is just a matter of how difficult you are going to make it for them
to do this.  I was offering the public cert as another variable you can use
for obfuscation and hindrance.  Certainly though just having your public key
as a raw string in the code makes it fairly easy to find -- you probably
want to do something to obfuscate it.  You could also do things like using
bytes from the public cert to modify data being processed by the app in a
way that gets a correct result for something.

Again though we are at the point where a pirate needs to modify the app to
remove the anti-piracy code from it.  If we assume that the protection is
for client-side code (not relying on a server side component), this is all
just a game of deciding how much time it is worth you spending on making it
hard for others to pirate your app vs. how much you think that will actually
reduce piracy.

And a recent blog post I read that gives some good perspective to have on
this:

http://jeff-vogel.blogspot.com/2011/05/final-answer-for-what-to-do-to-prevent.html

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

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

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

Re: [android-developers] Re: Keep a service running continuously

2011-05-12 Thread Dianne Hackborn
Third party apps can not use android:persistent.

Service.startForeground() is the formal way to say you can not be killed.
 This means the user must be aware that you are running (currently by
posting a notification) so they can manage what is going on.

For the vast majority of NFC uses though I wouldn't think this is necessary
-- if your service is going to run for a minute or so there should be no
need to do this, except that it would force the system to keep your process
around when getting very low on memory even if it normally wouldn't want to.

On Wed, May 11, 2011 at 8:23 PM, perumal316 perumal...@gmail.com wrote:

 I am communicating with a NFC tag and sending commands to the tag. But
 the service gets cutoff and I could not complete the sending of
 commands. Increasing the timeout doesn't help too.

 That's why need looking for a way to continuously run the NFC service.

 On May 12, 11:12 am, dnkoutso dnkou...@gmail.com wrote:
  startForeground() basically helps you achieve keeping your service
 running
  as long as possible. However, the cost of doing this is that you must
  provide an ongoing notification so the user is aware that something is
  constantly running.
 
  What is it you are trying to achieve and you want the NFC service to run
  continuously?

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




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

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

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

[android-developers] Aw: Re: (2nd try) Segmentation fault when loading a certain class from an OSGi framework under Android 2.2 2.3

2011-05-12 Thread Jan Krueger
Hello, 

well, in a way you are correct - it may looks as if this is an overkill. The 
background is that we are working as part of an research project, in which 
OSGi acts as the base technology for all the software developments. In this 
context, one of our goals is to show the flexibility of the developed OSGi 
bundles; i.e., that identical bundles can be re-used independent from the 
underlying system (here of course beside from converting them into Dalvik) 
and in various contexts - you just take the bundles, deploy them into the 
appropriate OSGi framework, start the application which uses the services 
provided by the bundles, and it (should...) work. So using Java without OSGi 
isn't an option...


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

[android-developers] Re: Develop apps on-the-fly?

2011-05-12 Thread Ubuntu Explorer
I would recommend trying the appinventor.
It is the closest you can get to app. development without installing
an SDK.
You can develop using a browser.


On May 12, 12:45 pm, Peter Webb r.peter.w...@gmail.com wrote:
 You can't develop Android applications entirely on Android phones. The
 SDK runs on Windows, Linux and Mac but not the Android o/s.

 Don't hold your breath. I can't imagine that running Eclipse on a
 phone is going to work very well, even if it was feasible.

 OTOH, if you own a PC, you just run the SDK on that. Problem solved.

 On May 10, 8:21 am, keksinen keskinen.o...@gmail.com wrote:







  Hey there,

  I'm wondering whether I should move to developing android apps. As I
  know next to nothing on android, I'd like to know if there is a way to
  do the developing on an actual android device, or whether I'd be
  necessary to get a SDK on an external machine as it seems to be done.
  So again: is it possible or in any case convenient to do app
  developing on android itself?

  Cheers

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


[android-developers] Re: On CRC32, LVL and tamper-proof app

2011-05-12 Thread Shine
  Does this work at all? The signature is different from the public key, so
  it
  shouldn't.

Yes it works, I wrote MY_LONG_PUBLIC_KEY, but I meant signature.

thank you for replying Dianne, I knew it's a matter of time. Since the
app costs less than 3$, I hope the three implemented level of anti-
piracy will be enough..I agree I should obfuscate the cert, too, as I
did with the LICENSED constant (0x0)

I agree with the linked post, too. I really prefer to spend my time
making my app nicer, more usable and efficient rather than burdening
with key obfuscation and complex hashings. But the challenge of
protecting something I really feel mine is too great to leave it
easy to pirate. I would never have expected my app got cracked, for
the simple reason i didn't think it was interesting. Now that I know
it is, I like to make things more difficult to understand from a
reverse engineered point of view.

I'm learning a lot from this issue.

Alessandro


On 12 Mag, 09:46, Dianne Hackborn hack...@android.com wrote:
 On Wed, May 11, 2011 at 8:47 PM, Nikolay Elenkov
 nikolay.elen...@gmail.comwrote:

  Does this work at all? The signature is different from the public key, so
  it
  shouldn't. Even if it did, if an attacker can repackage your application,
  they can replace the public key in the APK with their own. You have to
  either do this on a server, or take measures to make the public key in
  the apk really hard to get to.

 Once they are to the point of modifying your application in order to pirate
 it, it is just a matter of how difficult you are going to make it for them
 to do this.  I was offering the public cert as another variable you can use
 for obfuscation and hindrance.  Certainly though just having your public key
 as a raw string in the code makes it fairly easy to find -- you probably
 want to do something to obfuscate it.  You could also do things like using
 bytes from the public cert to modify data being processed by the app in a
 way that gets a correct result for something.

 Again though we are at the point where a pirate needs to modify the app to
 remove the anti-piracy code from it.  If we assume that the protection is
 for client-side code (not relying on a server side component), this is all
 just a game of deciding how much time it is worth you spending on making it
 hard for others to pirate your app vs. how much you think that will actually
 reduce piracy.

 And a recent blog post I read that gives some good perspective to have on
 this:

 http://jeff-vogel.blogspot.com/2011/05/final-answer-for-what-to-do-to...

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

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

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


[android-developers] Re: Android Start up

2011-05-12 Thread Goodwin
Please check the console log.

On 5月9日, 下午6时19分, LiTTle littlep...@gmail.com wrote:
 Hi everyone,

 I am new in android development. I am coming from J2ME. I am trying to
 build my first Android application. The application is Hello World
 as it is described at Google's guidelines. I use Eclipse Editor to
 create the application and I followed the steps as Pro Android 2
 said. The preblems are the following:
 1). Android emulator starts with the delay of 7 minutes!!! I use my
 netbook to create the app. Is it normal this delay?
 2). Apart from this delay, after the emulator starts successfully my
 application is never executed!!!

 PS: The code sample I use is the example with the TextView (http://
 developer.android.com/resources/tutorials/hello-world.html)

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


[android-developers] Re: Android Start up

2011-05-12 Thread viktor
Did you declared your activity in the manifest file?

On 9 Тра, 13:19, LiTTle littlep...@gmail.com wrote:
 Hi everyone,

 I am new in android development. I am coming from J2ME. I am trying to
 build my first Android application. The application is Hello World
 as it is described at Google's guidelines. I use Eclipse Editor to
 create the application and I followed the steps as Pro Android 2
 said. The preblems are the following:
 1). Android emulator starts with the delay of 7 minutes!!! I use my
 netbook to create the app. Is it normal this delay?
 2). Apart from this delay, after the emulator starts successfully my
 application is never executed!!!

 PS: The code sample I use is the example with the TextView (http://
 developer.android.com/resources/tutorials/hello-world.html)

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


Re: [android-developers] ndk5 exception crash with third-party library

2011-05-12 Thread Marcin Orlowski
On 11 May 2011 09:35, wasabee18 wasabe...@gmail.com wrote:

 Hi everyone, that's my first post, please be nice :)


I beliee your problem shall be discussed on NDK list, not here (SDK).

Regards,
Marcin Orlowski

*Tray Agenda http://bit.ly/trayagenda* - keep you daily schedule handy...
*Date In Tray* http://bit.ly/dateintraypro - current date at glance...
WebnetMobile on *Facebook http://webnetmobile.com/fb/* and
*Twitterhttp://webnetmobile.com/twitter/
*

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

Re: [android-developers] Documentation

2011-05-12 Thread Marcin Orlowski
On 10 May 2011 19:34, Jorge Luis jorgelferr...@gmail.com wrote:

 Does anyone have any starting documentation for dummies like me that are
 used to structured language?


Get used to OO languages (namely Java) first. Tons of books/tutorial on the
subject.


Regards,
Marcin Orlowski

*Tray Agenda http://bit.ly/trayagenda* - keep you daily schedule handy...
*Date In Tray* http://bit.ly/dateintraypro - current date at glance...
WebnetMobile on *Facebook http://webnetmobile.com/fb/* and
*Twitterhttp://webnetmobile.com/twitter/
*

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

[android-developers] Re: R: Re: menu item disabled, but clickable

2011-05-12 Thread Zsolt Vasvari
Sorry, I was probably thinking of views.

On May 12, 3:22 pm, Zanarotti Michele zanarotti.mich...@gmail.com
wrote:
 I haven't found anything like 'setClickable'. Where did you get it ?

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


Re: [android-developers] Setting the browser's user agent

2011-05-12 Thread Marcin Orlowski
On 10 May 2011 20:57, ZathrasOne ritter_br...@yahoo.com wrote:

 Is there an easy way to temporarily change the user agent of the
 browser (without modifying and recompiling the code)?


You mean existing Browser app? Then no. Check other browsers but while I
saw some allowing user agent change it was mostly Mobile vs Desktop
predefined values. No custom strings.

Regards,
Marcin Orlowski

*Tray Agenda http://bit.ly/trayagenda* - keep you daily schedule handy...
*Date In Tray* http://bit.ly/dateintraypro - current date at glance...
WebnetMobile on *Facebook http://webnetmobile.com/fb/* and
*Twitterhttp://webnetmobile.com/twitter/
*

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

Re: [android-developers] Debugging errors in Eclipse

2011-05-12 Thread Kostya Vasilyev
Nothing.

By default, Eclipse is not set up with Android sources for debugging. It's
usually not necessary - just click Resume a few times, so the process of
your application crashing is complete, and check the logcat for the error
message. In other words, your application appears to be crashing before it
gets to the breakpoints, and you should solve those crashes first.

-- Kostya

2011/5/12 cmt chrismt...@gmail.com


 I have a simple app that I'm trying to debug in Eclipse.  I debug the
 app and have inserted some breakpoints.  As I step into the
 breakpoints, I get errors, but the errors always seem meaningless to
 me saying stuff like this:

 Source not found

 The JAR file C:\android-sdk_r07\android-sdk-windows\platforms
 \android-11\android.jar has no source attachment.

 Any ideas of what I am doing wrong?

 Thanks!

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

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

Re: [android-developers] Aw: Re: (2nd try) Segmentation fault when loading a certain class from an OSGi framework under Android 2.2 2.3

2011-05-12 Thread Kostya Vasilyev
2011/5/12 Jan Krueger n...@chat-about.de

 Hello,

 well, in a way you are correct - it may looks as if this is an overkill.
 The background is that we are working as part of an research project, in
 which OSGi acts as the base technology for all the software developments. In
 this context, one of our goals is to show the flexibility of the developed
 OSGi bundles; i.e., that identical bundles can be re-used independent from
 the underlying system (here of course beside from converting them into
 Dalvik) and in various contexts


Well, so far you've only shown that it's exactly opposite :)

See this line from your log:

05-09 13:20:20.079: WARN/dalvikvm(13668): VFY: unable to find class
referenced in signature (Ljavax/security/auth/Subject;)

Android docs list javax.security.auth.Subject in the reference:

http://developer.android.com/reference/javax/security/auth/Subject.html

But I don't know what referenced in signature means. Perhaps that's a key
to solving this problem?

-- Kostya



 - you just take the bundles, deploy them into the appropriate OSGi
 framework, start the application which uses the services provided by the
 bundles, and it (should...) work. So using Java without OSGi isn't an
 option...



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


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

[android-developers] Rotate Image on bases of Velovity + GestureListener

2011-05-12 Thread shubham patni
Hello,

I m rotating Image in onFling(MotionEvent e1, MotionEvent e2, final
float velocityX, final float velocityY)  method using
RotateAnimation.Here I am using an fix angle to rotate image , pls
suggest me how can I rotate angle based on velocity pls.


Please suggest me how can handle it .

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


[android-developers] Re: bind service in another aplication

2011-05-12 Thread ivan harmady
Oh thanks, you saved me after all. I didn't know what for is intent-
filter, but now i fully understand it. thanks once more :))

On 25. Apr, 21:41 h., Mark Murphy mmur...@commonsware.com wrote:
 Your service needs to have an intent-filter, and your Intent needs
 to match that filter. For example:

 service android:name=.BshService
                         intent-filter
                                 action 
 android:name=com.commonsware.android.advservice.IScript /
                         /intent-filter
 /service

 new Intent(com.commonsware.android.advservice.IScript) would match
 that from a bindService() standpoint.









 On Sat, Apr 23, 2011 at 8:55 AM, ivanharmadyivan.harm...@gmail.com wrote:
  Hi, I'm trying to make bound service. Acording to tutorials at
  developer.android.com it is appropriate for me to implement bound
  service using messenger // there is written i should use it if i want
  to allow clients from different applications to access my service for
  IPC but i don't need to handle multithreading.
  if i want to bind service in the same application, there is no
  problem. BUT, my problem is to bind service which is in another
  application(/project) than my activity which i want to bind to it.

  in the activity which i want bind to service i call:
   bindService(new Intent(this, -- !!! -- ), myServiceConnection,
  Context.BIND_AUTO_CREATE);

  - BUT i don't know how to write path to the service.class which i
  have in another application(/project)

  how can i handle it? can somebody help me pls? i would be very
  thankfull. I spend too much time to solve it and nothing came :(((

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

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

 Android Training in London:http://bit.ly/smand1,http://bit.ly/smand2

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


[android-developers] Re: On CRC32, LVL and tamper-proof app

2011-05-12 Thread Zsolt Vasvari

 http://jeff-vogel.blogspot.com/2011/05/final-answer-for-what-to-do-to...

I totally agree with that blog post.  I believe the vast majority of
users, at least for non-trivial apps, resort to piracy not because
they are too cheap to pay for it, but because the app is not available
in the country they live in and have no choice but to pirate.

This is exactly the same reason why a lot of people download new-run
TV shows using torrents.  It has nothing to with being too cheap to
pay a buck for a show, but the simple fact is that they are not given
an option.  Hulu is not available outside of the US and the 6-12 month
delay is unacceptable to a lot of people.  But I digress...

I believe when the Android Market is finally made available in those
additional 99 (really?) countries, things will improve.

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


[android-developers] Does HTC Friend Stream has open API?

2011-05-12 Thread Xi Shen
Hi,

Not all social accounts can be integrated with the HTC Friend Stream
widget. I wonder if they have open API, so I can develop the integrate
feature myself.


-- 
Best Regards,
Xi Shen (David)

http://twitter.com/davidshen84/

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


[android-developers] Eclipse and Android source code

2011-05-12 Thread Jeje
Hi,
I would like to debug Android framework; that's why, I followed the
URL's steps : http://source.android.com/source/using-eclipse.html.
Meanwhile, after creating a new Java Project, Eclipse display 3
errors : some JAVA_LIBRARIES are missing (google-
common_intermediates, ...) then I delete these libraries in build
path.
These 3 errors disappear but 7500 new errors appear :ArrayListCursor
cannot be resolved to a type   , The import com.android.common cannot
be resolved, 
What is wrong ? I don't understand how I can have so much errors
because I followed the Using Eclipse tuto.

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


[android-developers] Re: good 2d physics engine

2011-05-12 Thread Jens
JBox2D is decent enough. If you're writing a game using the NDK you
should probably use the normal Box2D, it compiles readily on Android.

On 11 Maj, 20:28, bob b...@coolgroups.com wrote:
 Can anyone recommend a good 2d physics engine for 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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Message get disappeared when add SingleChoiceItems to alert dialog

2011-05-12 Thread ABS
Hi
   I am working on android app. but i stuck at one point when i
tried to add SingleChoiceItems to alert dialog the alert message  gets
disapear.,i dont know why this happens here is my  code snippet.


//builder.setMessage(alertMessage).setCancelable(false);
builder.setSingleChoiceItems(alertChoices , -1, new
DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface 
dialog, int which) {
// TODO Auto-generated method 
stub

}
 });

builder.setPositiveButton(Continue,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
dialogRunning = false;
dialog.cancel();
}
});
  I want to add both message and singlechoiceitems to  alert
dialog



thanks in advance

Regards

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


[android-developers] Re: hash functions

2011-05-12 Thread Bob Kerns
Ah, I see your confusion, and I should have been more careful to forestall 
it.

That's not what is meant here by a dictionary attack. What you describe is 
what is defended against by the iteration.

The dictionary attack defended by a salt is where a *pre-computed* 
dictionary of keys for likely passwords is constructed. What the salt does 
is explode the size of that dictionary, basically making it infeasible to 
pre-compute the hashes for entries in a dictionary. Otherwise, you could 
bypass the iteration cost, by distributing the cost over a large number of 
attacks. Then you just search your dictionary for a key that fits, and do no 
key construction at all during the attack.

Certainly iteration can be expensive! That's the whole point, and why it's 
not specified how many iterations are appropriate. You select the iteration 
count to determine how long the key computation should take.

But the vast majority of the cost of doing a rekey? That would either 
imply a huge iteration count, or a small amount of data to be re-encrypted. 
In the former case -- don't do that. In the latter case -- it doesn't 
matter. Actually, it probably doesn't matter anyway, as rekeying is 
generally an administrative operation, not part of the overall performance 
of the system. But since the key is derived on first use, the absolute 
(clock) time consumed will be relevant there. The default iteration count 
for SQLCipher is 4000, which is pretty typical. But on slow hardware, I 
suppose that could be too high. In which case -- set it to a lower value.

Typically, 100ms computation time after a user supplies a password is not 
going to be noticed, while 1000ms will. Balance that against the resources 
available to an attacker (which will vary by scenario and with the 
advancement of computing power).


On Wednesday, May 11, 2011 5:27:30 PM UTC-7, DanH wrote:

 Salt doesn't prevent dictionary attacks at all.  If I know that the 
 password is an 6-character alpha then I can try all combos of that, 
 dictionary or otherwise, regardless of how salted the encryption is. 

 I've seen iteration add considerable overhead.  In one SqlCipher 
 implementation iteration was the vast majority of the CPU costs of 
 doing a rekey. 

 On May 10, 11:13 pm, Bob Kerns r@acm.org wrote: 
  I think you missed part of what I was saying. It's important, so let me 
 try 
  to be more clear. 
  
  Each of the two components does a different job. 
  
  The salt prevents dictionary attacks, by expanding the space of 
 dictionaries 
  by the size of the salt (say, 2^128 or whatever you use.) 
  
  The protection against trial-and-error cracking is where the iteration 
 comes 
  in -- you make it take a long time to generate the final key from the 
  password. 
  
  The salt isn't (in this context) to prevent plaintext attacks, but 
  dictionary attacks, which are EXTREMELY relevant to this case. 
  
  Increasing the length of a weak password has surprisingly little effect 
 in 
  the real world. Some, definitely, but not on the scale you'd expect from 
  sheer length. And in a lot of contexts, you really can't force users to 
 use 
  such long passwords -- the password I'm forced to use on my phone for 
  corporate security reasons is very very close to to rendering my phone 
  unusable. 
  
  The overhead that the iteration adds to the normal path is generally 
  negligible, because it's done on the client side, once. You can tune the 
  iteration count to balance the performance requirements vs the security 
  requirements. If 100 ms is acceptable, then choose your iteration count 
  accordingly, and you will limit the attacker to 10 attempts per second 
 per 
  CPU, which certainly beats 1000 attempts per second per CPU. 
  
  On Tuesday, May 10, 2011 8:35:00 PM UTC-7, DanH wrote: 
  
   Of course, hashing a password, per se, doesn't really make it any 
   stronger.  And doing things like using a salt don't do much if the 
   concern is simple trial-and-error cracking of a single encrypted 
   message (unless you're relying on security by obscurity).  Salting 
   does help prevent known plaintext attacks and signature spoofing, but 
   those are not likely to be problems in low-volume messaging. 
   Iterating on an expensive hash can help discourage the trial-and-error 
   cracking attack, but it can add considerable overhead to the normal 
   path, and simply increasing the length of a weak password would be far 
   more effective. 
  
   On May 10, 5:34 pm, Bob Kerns r@acm.org wrote: 
The fundamental problem with starting with a human-managed password 
 is 
   that 
there is not a lot of entropy -- the possible values are not 
 distributed 
over a huge range, compared to what an attacker could try with 
trial-and-error. 
  
So just doing SHA1 or SHA256 for that matter, is not sufficient for a 

   strong 
key generation algorithm. 
  
The first thing you need to address are dictionary attacks, where the 

  

[android-developers] Re: Does HTC Friend Stream has open API?

2011-05-12 Thread Zsolt Vasvari
Have you asked them?

On May 12, 5:38 pm, Xi Shen davidshe...@googlemail.com wrote:
 Hi,

 Not all social accounts can be integrated with the HTC Friend Stream
 widget. I wonder if they have open API, so I can develop the integrate
 feature myself.

 --
 Best Regards,
 Xi Shen (David)

 http://twitter.com/davidshen84/

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


[android-developers] Re: Order Sample Code by Complexity, Please

2011-05-12 Thread Bob Kerns
I understand what you're asking, but I don't think you're going to get what 
you're looking for.

First, it's a lot of work. It's work that would be justified if you are 
teaching a course, but you'd probably do that with your own selection of 
examples.

But more importantly -- there is no single order. There are a variety of 
paths through the examples, and through the learning process. It's not the 
inherent complexity of the examples that is the issue -- it is how many NEW 
topics an example would expose you to, and that depends your choice of 
examples before.

Maybe someone will come up with an order for you -- and maybe you'll be 
happy with that result.

But I think a better approach is to decide what kind of application you want 
to program, identify what concepts and demos are most relevant, and within 
the examples, identify a few pre-requesites.

The API Demos example is a good starting point -- but it covers all kinds of 
topics. It's best thought of as one you come back to, whenever you need to 
use a new API.

Probably the majority of the others, you won't ever use, or at least not 
soon. Most people probably won't play with the USB interfaces, some people 
won't care about a contact-manager application, while others won't care 
about a lunar lander game.

So bottom line, my advice would be to play with the API demos, and look at 
the code for the ones you find interesting. Then go to the list, and play 
with whatever looks interesting. If you don't understand a specific API, go 
back to the API demos for help.

Then when you find you need to do something new, come back to the list and 
look for relevant demos.

If you're doing this for a course, rather than personal exploration, then I 
think you have to start from your course goals, and look for examples that 
support them.

Either way, I don't think a sorted list is going to be as helpful as you 
think.

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

[android-developers] Device Admin Wipe

2011-05-12 Thread nigel
Hello;
I am trying to use the Device Admin APIs to wipe the device. I have the code 
working but I hit a problem, so I went back to the original sample app in 
C:\android-sdk-windows\samples\android-8\ApiDemos. My target is Froyo.
The problem is that the wipe only seems to work some of the time. This is 
true of my app, the sample above and the Settings-Privacy-Factory data reset 
option. Which ever I use. Sometimes I get a full reset, sometimes I get a 
reboot.

Is this a known issue?
Are there any other requirements?
I assume the code is generally right because it works some of the time.

LogCat - If there is a usb cable attached, the reset does not work and gets 
stuck in the boot loader. But the problem seems to be that sometimes the 
reset does not seem to start properly. Here is what happens when it goes 
wrong

05-12 12:10:56.789: DEBUG/ShutdownThread(1383): Notifying thread to start 
radio shutdown
05-12 12:10:56.789: INFO/ShutdownThread(1383): just to make sure shutdown 
actually started
05-12 12:10:56.799: INFO/ActivityManager(1383): Starting activity: Intent { 
flg=0x1000 cmp=com.lge.poweroff/.PowerOff }
05-12 12:10:56.879: INFO/ShutdownThread(1383): Thread: state=NEW 
isAlive=false
05-12 12:10:56.889: INFO/ShutdownThread(1383): Sending shutdown broadcast...
05-12 12:10:56.899: INFO/ActivityManager(1383): Start proc com.lge.poweroff 
for activity com.lge.poweroff/.PowerOff: pid=2227 uid=10070 gids={}
05-12 12:10:56.909: WARN/SyncManager(1383): Writing sync state before 
shutdown...
05-12 12:10:56.969: WARN/Flex(1770): getString FLEX_OPERATOR_CODE TMO
05-12 12:10:56.969: DEBUG/Exchange(1770): Shutdown onReceive
05-12 12:10:56.979: INFO/ShutdownThread(1383): Shutting down activity 
manager...
05-12 12:10:57.019: WARN/UsageStats(1383): Writing usage stats before 
shutdown...
05-12 12:10:57.049: WARN/BatteryStats(1383): Writing battery stats before 
shutdown...
05-12 12:10:57.159: DEBUG/GpsLocationProvider(1383): mNavigating:true, 
mStatus: 1, mLastFixTime: 0time_diff:1305198657159
05-12 12:10:57.229: WARN/LGE_data(1383): Send to FUNC_MMI_REQ_DATA_POWEROFF 
from Shutdown thread 
05-12 12:10:57.269: DEBUG/LGE_data(1482): handleDataFuncbyMMI(type:325) is 
called
05-12 12:10:57.269: DEBUG/LGE_data(1482): FUNC_MMI_REQ_DATA_POWEROFF 
triggered by app:-1
05-12 12:10:57.269: DEBUG/LGE_data(1482): handleDataFuncByRIL(type:205) is 
called
05-12 12:10:57.269: DEBUG/LGE_data(1482): RIL::handleDataFuncByRIL(type:205) 
is called
05-12 12:10:57.269: WARN/ShutdownThread(1383): Turning off radio...
05-12 12:10:57.269: VERBOSE/LGE_data(1482): [handleDataFuncByRIL] 
FUNC_RIL_REQ_DATA_POWREOFF (data = -1
05-12 12:10:57.279: DEBUG/LGE_data(1482): GSMDataConnTrack handleMessage { 
what=34 when=120959 arg1=1 obj=radioTurnedOff }
05-12 12:10:57.279: DEBUG/LGE_data(1482): [GsmDataConnectionTracker] Clean 
up connection due to radioTurnedOff
05-12 12:10:57.279: DEBUG/LGE_data(1482): [GsmDataConnectionTracker] 
setState: DISCONNECTING
05-12 12:10:57.279: DEBUG/LGE_data(1482): [GsmDataConnectionTracker] 
cleanUpConnection: teardown, call conn.disconnect
05-12 12:10:57.279: INFO/ShutdownThread(1383): Waiting for Bluetooth and 
Radio...
05-12 12:10:57.279: DEBUG/LGE_data(1482): [DataConnection] Stop poll NetStat
05-12 12:10:57.279: DEBUG/LGE_data(1482): GSMDataConnTrack handleMessage { 
what=25 when=120965 obj=android.os.AsyncResult@451dacc0 }
05-12 12:10:57.279: DEBUG/LGE_data(1482): [GsmDataConnectionTracker] 
EVENT_DISCONNECT_DONE
05-12 12:10:57.279: DEBUG/LGE_data(1482): [GsmDataConnectionTracker] 
setState: IDLE
05-12 12:10:57.289: WARN/Flex(1383): getString FLEX_COUNTRY_CODE DE
05-12 12:10:57.289: WARN/Flex(1383): getString FLEX_OPERATOR_CODE TMO
05-12 12:10:57.299: DEBUG/MobileDataStateTracker(1383): hipri skipped as 
new= DISCONNECTED, old= DISCONNECTED, reason= radioTurnedOff, apnTypeList= 
default
05-12 12:10:57.299: DEBUG/MobileDataStateTracker(1383): dun skipped because 
is not unavailable to apnTypeList(default
05-12 12:10:57.299: DEBUG/MobileDataStateTracker(1383): supl skipped because 
is not unavailable to apnTypeList(default
05-12 12:10:57.319: DEBUG/MobileDataStateTracker(1383): mms skipped because 
is not unavailable to apnTypeList(default
05-12 12:10:57.319: DEBUG/MobileDataStateTracker(1383): default Received 
state= DISCONNECTED, old= DISCONNECTED, reason= radioTurnedOff, apnTypeList= 
default
05-12 12:10:57.319: DEBUG/PhoneApp(1482): mReceiver: 
ACTION_ANY_DATA_CONNECTION_STATE_CHANGED
05-12 12:10:57.319: DEBUG/PhoneApp(1482): - state: DISCONNECTED
05-12 12:10:57.319: DEBUG/PhoneApp(1482): - reason: radioTurnedOff
05-12 12:10:57.319: DEBUG/NotificationMgr(1482): 
hideDataDisconnectedRoaming()...
05-12 12:10:57.329: DEBUG/DMClientService(1627): updateNetworkState, 
statusWiFi : 4, statusCellularNetwork :0
05-12 12:10:57.329: DEBUG/DMClientService(1627): getNetworkStatus, 
serviceType : Operator
05-12 12:10:57.329: DEBUG/DMClientService(1627): updateNetworkState: 
NETWORK_STATE_DISCONNECTED 
05-12 

Re: [android-developers] Develop apps on-the-fly?

2011-05-12 Thread BHL
Every affiliate is provided with a *General affiliate link* upon signup.
Your link is: *
http://BigExtraCash.com/_6a6b7d72.htm*

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

[android-developers] Database corruption if I push apk again

2011-05-12 Thread CrazzyAndroidians
Hi,

I have a application which has a database. I pushed the apk to device
and it is working fine.
Now when I put the same apk again after some modification, database is
corrupted. I need to
manually, remove the database using
rm -r data/data/packagename/databases
Why my database is corrupting if i push again the apk

Thanks

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


Re: [android-developers] Android SDK Emulator setup

2011-05-12 Thread Aitor Mendaza Ormaza
http://tinyurl.com/3kb32vx

http://stackoverflow.com/questions/4756382/android-tablet-emulator

http://stackoverflow.com/questions/4756382/android-tablet-emulator
On Wed, May 11, 2011 at 4:36 PM, range...@gmail.com range...@gmail.comwrote:

 How can I setup the emulator that came with the SDK to act as a tablet
 instead of a phone?

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




-- 
---
http://aitorTheRed.blogspot.com
http://www.last.fm/user/aitorTheRed/

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

Re: [android-developers] android jsoup

2011-05-12 Thread BHL
Every affiliate is provided with a *General affiliate link* upon signup.
Your link is: *
http://BigExtraCash.com/_6a6b7d72.htm*

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

[android-developers] Implement captcha in android?

2011-05-12 Thread Mohamed
Hi all,

How to implement captcha in android like the following...

http://www.codeproject.com/KB/aspnet/Ca ... aImage.gif

Anybody help me ?

Thanks
Mubarak.


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


[android-developers] Change GPS configuration

2011-05-12 Thread dep
Hi,

I am developing a GPS application but I have realised that the NTP
server of the gps.conf file is not the correct one. I need to change
it (not in the application, just in my phone) in order to improve GPS
performance, but I can only read the file since I do not have root
permission to write.
I have seen some numerical codes to change it on Samsung phones but
none of them works on my Nexus One. Do you know any way to change the
GPS configuration?

Thank you very much

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


[android-developers] Calling an Activity when phone is locked by clicking two times on the END_CALL button

2011-05-12 Thread souissi haythem
Hi,

I need to call my Activity when user press two times on the END_CALL
button (it need to work when the phone is locked).

Is is that possible??



Thanks.

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


[android-developers] Calling an Activity when phone is locked by clicking two times on the END_CALL button

2011-05-12 Thread souissi haythem
Hi,

I need to call my Activity when user press two times on the END_CALL
button (it need to work when the phone is locked).

Is is that possible??



Thanks.

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


[android-developers] Ang.: Re: 2.3 Platform Google APIs missing Licensing Service..?

2011-05-12 Thread Jan Skarvall
Same error on level 12.

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

[android-developers] UI Framework Bug?

2011-05-12 Thread authorwjf
Hello Android UI Gurus,

I have been struggling for a few days now with an annoying UI issue.
I've whittled the project down to nothing but a small demonstration of
the problem.  I admit I'm pretty new to Android UI work, but at the
same time I'm an experienced, qualified engineer and I just can't seem
to figure this out.  I was hoping to get some feedback from some of
you out there who are more familiar with the internals and
idiosyncrasies  of the platform.  Any help would be greatly
appreciated!

The desired behavior:
I have a list view.  Each list view row consists of a text element,
and a hidden image.  When an item is selected from the list, I'd like
to make the image visible, and, start an animation on it.  Pretty
standard stuff here, we're talking basically about a loading
spinner.

The problem:
After selecting 2 or sometimes 3 items in the list, I see spinners
become visible and start animating for rows which were never
selected.  The two things that lead me to believe this is a bug with
the platform are:

A) Putting in a break point I can clearly see that the underlying data
source from the list does not have the isSpinning property set for
the items that begin animating in a seemingly random manner.

and

B) The only code that makes the image visible and begins the animation
for that row is inside of my custom data adapter.  Before it can start
the animation it changes the text field in that row as well.  The text
fields are not changed in the rows where my spinners seem to appear of
their own accord.

The code:
As I said when I started this post I've removed everything from the
project except the relevant UI code.  Here is what I have.

/res/layout
main.xml=
?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent 
TextView
android:layout_width=fill_parent
android:layout_height=wrap_content
android:text=@string/hello/
ListView
android:id=@+id/android:list
android:layout_width=fill_parent
android:layout_height=fill_parent
android:cacheColorHint=#
android:background=@android:color/transparent
android:dividerHeight=1dip/
/LinearLayout

list_view_row.xml=
?xml version=1.0 encoding=utf-8?
LinearLayout xmlns:android=http://schemas.android.com/apk/res/
android
android:layout_width=fill_parent
android:layout_height=?android:attr/listPreferredItemHeight
android:padding=6dip
LinearLayout
android:layout_width=fill_parent
android:layout_height=wrap_content
android:orientation=horizontal
TextView
android:id=@+id/label
android:textSize=11sp
android:padding=2dip
android:gravity=center_vertical|center
android:layout_gravity=center_vertical|center
android:layout_width=wrap_content
android:layout_height=wrap_content
android:textColor=#ff/
ImageView
android:id=@+id/spinner
android:padding=2dip
android:src=@drawable/loading
android:layout_width=wrap_content
android:layout_height=wrap_content/
/LinearLayout
/LinearLayout

/res/anim
rotate.xml=
?xml version=1.0 encoding=UTF-8?
rotate
xmlns:android=http://schemas.android.com/apk/res/android;
android:fromDegrees=0
android:toDegrees=360
android:pivotX=50%
android:pivotY=50%
android:repeatCount=infinite
android:interpolator=@android:anim/linear_interpolator
android:duration=1900 /

/res/drawable
spinner.png

/src
MyContainer.java=
public class MyContainer {
private String mText = ;
private Boolean mLoading = false;

public void setText(String mText) {
this.mText = mText;
}
public String getText() {
return mText;
}
public void setIsLoading(Boolean mLoading) {
this.mLoading = mLoading;
}
public Boolean isLoading() {
return mLoading;
}
}

CustomAdapter.java=
public class CustomAdapter extends ArrayAdapterMyContainer {

private ArrayListMyContainer items;
private Context c = null;

public CustomAdapter(Context context, int textViewResourceId,
ArrayListMyContainer items) {
   super(context, textViewResourceId, items);
   this.items = items;
   this.c = context;
   }

@Override
public View getView(int position, View convertView, ViewGroup
parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi =
(LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.list_view_row, null);
}

[android-developers] Error: Fragment already added

2011-05-12 Thread ku5ard
Hy all,

i have a problem with the Fragments, and i really dont know how to solve it. 
hopefully somebody can help me.

I have a layout for portrait mode: 
   
?xml version=1.0 encoding=utf-8?

RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android;

android:layout_width=match_parent android:layout_height=match_parent

fragment class=ch.kusar.dwr.layout.OverviewFragment

 android:id=@+id/overview android:layout_width=match_parent 
android:layout_gravity=bottom android:layout_height=match_parent/

/RelativeLayout


and a layout for landscape mode:
   
?xml version=1.0 encoding=utf-8?

RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android;

android:orientation=horizontal android:layout_width=match_parent

android:layout_height=match_parent

fragment class=ch.kusar.dwr.layout.OverviewFragment

 android:id=@+id/overview android:layout_width=fill_parent

 android:layout_height=60dp /

fragment class=ch.kusar.dwr.layout.ContentFragment

 android:id=@+id/content android:layout_width=fill_parent

 android:layout_height=fill_parent android:layout_below=@+id/overview /

/RelativeLayout



In the OverviewFragment, i have a method to show details.

   void showDetails(int index) {

 currentButton = index;


 if (mDualPane) {

 // We can display everything in-place with fragments, so update

 // the list to highlight the selected item and show the data.

 // getListView().setItemChecked(index, true);


  // Check what fragment is currently shown, replace if needed.

 ContentFragment cf = (ContentFragment) getFragmentManager()

  .findFragmentById(R.id.content); // /hereChanged

 // if (cf == null || (cf.getPressedButton() != index)) {

 if (cf == null

  || (prefs.getInt(ContentEnum.PRESSEDBUTTON.name(), 0) != index)) {

  // Make new fragment to show this selection.

  // cf = ContentFragment.newInstance(index);

  setPressedButton(index);

  // Execute a transaction, replacing any existing fragment

  // with this one inside the frame.

  FragmentTransaction ft = getFragmentManager()

   .beginTransaction();

  ft.replace(R.id.content, cf); // /hereChanged

  ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);

  ft.commit();

 }

 } else {

 // Otherwise we need to launch a new activity to display

 // the dialog fragment with selected text.

 Intent intent = new Intent();

 intent.setClass(getActivity(), ContentActivity.class);

 // intent.putExtra(button, index);

 setPressedButton(index);

 startActivity(intent);

 }

}


and the ContentFragment onCreateView looks like this:

   @Override

public View onCreateView(LayoutInflater inflater, ViewGroup container,

 Bundle savedInstanceState) {

 Log.e(ContentFragment.onCreateView, onCreateView);

 // TODO Auto-generated method stub

 if (container == null) {

 // // We have different layouts, and in one of them this

 // // fragment's containing frame doesn't exist. The fragment

 // // may still be created from its saved state, but there is

 // // no reason to try to create its view hierarchy because it

 // // won't be displayed. Note this is not needed -- we could

 // // just run the code below, where we would create and return

 // // the view hierarchy; it would just never be used.

 //return null;

 }

  if (prefs.getInt(ContentEnum.PRESSEDBUTTON.name(), 0) == ContentEnum.
REMOTE

  .ordinal()) {

 view = ContentRemote.getRemoteView(inflater, container,

  savedInstanceState);

 Preferences.setPreferences(getActivity());

 }

...

}


the if container == null, is always true. Why is this so?


and the other problem is, when i press a button, the showDetails is called. 
When im in portrait mode, it works fine.

But when im in landscape mode, the following error is shown when i press a 
button. 


Does anyone has an idea how can i solve this?


thank you for your support




https://lh5.googleusercontent.com/_7FGGBnFM_RE/TcvqTciA4jI/AB4/VC7DswkWj6g/screen-capture-2.png

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

[android-developers] need help with my Nexus S

2011-05-12 Thread GSDroid
Hello

I was trying to install over the air 2.3.4, suddenly I am unable to
boot the system.

Currently it is saying that /system/build.prop no such file or
directory.
Can some one please help me.

Thanks
Gopal

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


Re: [android-developers] need help with my Nexus S

2011-05-12 Thread Jorge Luis
Have you tried to start it into recovery mode?
With DEXT you have to turn the phone on holding the camera button, dunno is
is the same with Nexus.

Search 'bout recovery mode.


2011/5/12 GSDroid gsridh...@gmail.com

 Hello

 I was trying to install over the air 2.3.4, suddenly I am unable to
 boot the system.

 Currently it is saying that /system/build.prop no such file or
 directory.
 Can some one please help me.

 Thanks
 Gopal

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




-- 
Jorge Luis Ferrari Cé
Desenvolvedor / Web Designer
Siga @JLFerrari

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

Re: [android-developers] Ang.: Re: 2.3 Platform Google APIs missing Licensing Service..?

2011-05-12 Thread Nikolay Elenkov
On Thu, May 12, 2011 at 10:35 PM, Jan Skarvall jan.skarv...@telia.com wrote:
 Same error on level 12.


It's not part of the SDK, it's a separate library. You can download it using
the Android SDK manager.

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


[android-developers] Re: need help with my Nexus S

2011-05-12 Thread GSDroid
yes I have tried to recovery but it didn't help either

Thanks
Gopal


On May 12, 7:30 am, Jorge Luis jorgelferr...@gmail.com wrote:
 Have you tried to start it into recovery mode?
 With DEXT you have to turn the phone on holding the camera button, dunno is
 is the same with Nexus.

 Search 'bout recovery mode.

 2011/5/12 GSDroid gsridh...@gmail.com









  Hello

  I was trying to install over the air 2.3.4, suddenly I am unable to
  boot the system.

  Currently it is saying that /system/build.prop no such file or
  directory.
  Can some one please help me.

  Thanks
  Gopal

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

 --
 Jorge Luis Ferrari Cé
 Desenvolvedor / Web Designer
 Siga @JLFerrari

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


[android-developers] Re: UI Framework Bug?

2011-05-12 Thread Yahel
I believe you have a case of view reusing.

The ArrayAdapter will reuse row views whenever possible to preserve
memory. So if you set a Bitmap to visible that might be what carries
it as visible on usually the row X+5. So that you would need to reset
everything on the view that was dynamically changed in the GetView.

For example :

@Override
public View getView(int position, View convertView, ViewGroup
parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi =
(LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.list_view_row, null);
}
TextView label = (TextView) v.findViewById(R.id.label);
ImageView spinner = (ImageView) v.findViewById(R.id.spinner);
MyContainer item = (MyContainer) items.get(position);

label.setText(item.getText());
spinner.setVisibility(View.INVISIBLE);

if (item.isLoading()) {
label.setText(***+item.getText()+***);
spinner = (ImageView)v.findViewById(R.id.spinner);
spinner.setVisibility(View.VISIBLE);
Animation spinnerAnimation =
AnimationUtils.loadAnimation(getContext(),
R.anim.rotate);
spinner.startAnimation(spinnerAnimation);
}

return v;
}

Not sure though.

Good luck.

Yahel

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


[android-developers] Limit for number of strings in res/values/strings.xml

2011-05-12 Thread Oceanblue
As I am externalizing all possible user-prompt  error strings, the
strings file is becoming pretty big. The aim of course is to keep
future localization in mind.

Is there a limit or a best-practice standard to how many strings
should be put in resources? Will the performance degrade after a
certain number?

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


[android-developers] Re: UI Framework Bug?

2011-05-12 Thread authorwjf
I'm also including a few pics to illustrate the issue in case my text
isn't entirely clear.

[IMG]http://i53.tinypic.com/339oemx.png[/IMG]

(http://tinypic.com/r/339oemx/7)

[IMG]http://i53.tinypic.com/2qjhevo.png[/IMG]

(http://tinypic.com/r/2qjhevo/7)

[IMG]http://i56.tinypic.com/2s1agsp.png[/IMG]

(http://tinypic.com/r/2s1agsp/7)

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


[android-developers] Re: UI Framework Bug?

2011-05-12 Thread authorwjf
Thanks, Yahel.  I will give your suggestion a try this morning.

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


[android-developers] aapt.exe takes minutes to complete in eclipse build.

2011-05-12 Thread RickGillaspy
Since I've updated to api level 11, it seems that building is super
slow.

Sometimes when eclipse is building the project it hangs at 'android
library update' for minutes at a time, and process explorer shows
appt.exe pegging my CPU.

I've tried all the workarounds I could find by googling.
-- setting -Dosgi.requiredJavaVersion=1.6 for Helios
-- increasing the memory settings
-- switching to Gallileo


The only thing that seems to make it go away is changing the build
target to less that api 11, which causes my project to not compile,
but at least it gets past the 'library update' step.

How can I figure out what aapt is doing for so long so I can try and
mitigate this?

I didn't see anything in the eclipse logs that pointed to this.

What other options do I have to determine what's going 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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: UI Framework Bug?

2011-05-12 Thread authorwjf
Yahel's post got me to thinking.  I modified the getView method of my
data adapter to look like this:


@Override
public View getView(int position, View convertView, ViewGroup parent)
{
   LayoutInflater vi =
(LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
   View v = vi.inflate(R.layout.list_view_row, null);
   TextView label = (TextView) v.findViewById(R.id.label);
   ImageView spinner = (ImageView) v.findViewById(R.id.spinner);
   MyContainer item = (MyContainer) items.get(position);
   label.setText(item.getText());
   spinner.setVisibility(View.INVISIBLE);
   if (item.isLoading()) {
  label.setText(***+item.getText()+***);
  spinner = (ImageView)v.findViewById(R.id.spinner);
  spinner.setVisibility(View.VISIBLE);
  Animation spinnerAnimation =
AnimationUtils.loadAnimation(getContext(), R.anim.rotate);
  spinner.startAnimation(spinnerAnimation);
   }
   return v;
}


And the problem seems resolved!  Great news for me.  Though I wonder
if any of you can comment as to the performance hit / impact I might
expect to take reloading the view from the layout every single time
the adapter refreshes?  I'm not experiencing any issues with the demo
program, but the lists in my actual application can get rather long
and include several lines of text for each row.

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


[android-developers] In-app Billing Test

2011-05-12 Thread David Toledo
Hi All

I cannot execute the app the test dungeon test .
http://developer.android.com/intl/de/guide/market/billing/billing_testing.html#billing-testing-real

Appears the following error:
The market billing service is not available at this time. You can continue
to use this app but you won't be able to make purchases

I have the last version from market 2.3.6 and android 2.2 my handset is
Motorola A893, my country is Peru and my account is from the denmark, my
account is the developer account

What is the problem?

Thanks
David

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

[android-developers] Re: In-app Billing Test

2011-05-12 Thread David Toledo
from Today, is available the option In App Billing in Peru and 99 country
too. I can testing this functionality and I no appears the errors previous
in my handset
Thanks
David


2011/5/12 David Toledo dtole...@gmail.com


 Hi All

 I cannot execute the app the test dungeon test .

 http://developer.android.com/intl/de/guide/market/billing/billing_testing.html#billing-testing-real

 Appears the following error:
 The market billing service is not available at this time. You can continue
 to use this app but you won't be able to make purchases

  I have the last version from market 2.3.6 and android 2.2 my handset is
 Motorola A893, my country is Peru and my account is from the denmark, my
 account is the developer account

 What is the problem?

 Thanks
 David



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

[android-developers] Re: How is In App Billing?

2011-05-12 Thread Nathan
On May 9, 9:15 pm, Nikolay Elenkov nikolay.elen...@gmail.com wrote:
 On Tue, May 10, 2011 at 3:17 AM, Nathan critter...@crittermap.com wrote:

  I have looked at Urban Airship's solution.

 http://urbanairship.com/products/in-app-purchase/

 Using third party solutions might violate the Developer agreement,
 so you'd probably want to get legal advice if you decide to use it.

My understanding is that Urban Airship uses the Market solution, and
implements the server portion and downloading of resources. As far as
I know, there is no non-third party solution for these.

Nathan

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


[android-developers] Android: how to draw an ImageView with the same size regardless of device?

2011-05-12 Thread Ab
I want to put a toolbar in my application. The toolbar will use
ImageViews as application buttons. I would like the ImageViews to be
the exact same size regardless device; by same size I mean that,
when rendered to the screen, if I measure them with a ruler, the
dimensions will be the same. I would like this size to be ~10mm (the
width of my index finger).

I have been completely unsuccessful in accomplishing this.

I am testing on a MDPI, large screen Acer Iconia Tab and a HDPI medium
screen Samsung Galaxy Tab. If I set layout_width=50dip and
layout_height=50dip, the buttons render as ~10mm on the Samsung, and
~8mm on the Acer. If I set the buttons as layout_width=12mm and
layout_height=12mm, they render as 12mm on the Acer and ~9mm on the
Galaxy (confusing that 50dip renders bigger on the Galaxy than the
Acer, but 12 mm renders smaller on the Galaxy than on the Acer).

If I place a 32pix x 32pix icon in my drawable-mdpi folder (and no
equivalent in the drawable-hdpi folder), and set
layout_width=wrap_content and layout_height=wrap_content; the
results are similar to if set to 50dip, the Samsung is about 10mm, the
Acer about 8mm. If I add a 48pix x 48pix icon to my drawable-hdpi
folder, there is no change; presumably because the Acer still uses the
mdpi icon and the Samsung uses the bigger one, but scales it down by
50% because it knows its hdpi (if am confident that this surprising
scaling occurs because if I move the 48pix icon to the mdpi folder,
and have nothing in the hdpi folder, the icon shows very large on the
Samsung).

I then attempted to calculate the number of pixels necessary for 10mm
based on the values of xdpi and ydpi from DisplayMetrics: 10 mm in
pixels = xdpi * 10 / 25.4.  On the galaxy, this is  168.89 * 10 / 25.4
= 66.  However, when I set the layout_width to 66, the button measured
~8mm wide.  But, at 168.89 dpi, the dots per mm should be 6.64
(168.89/25.4), so 66pixels should be approximately 10mm.  So, how
could it measure 8mm?  The Galaxy must be scaling down the layout
parameters somehow. Is there any way to retrieve how much they are
scaling down by, so that I can adjust for it?

I am confused and could really use advice. How do I make my button
fingertip sized regardless of dpi and screen size?

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


Re: [android-developers] Android: how to draw an ImageView with the same size regardless of device?

2011-05-12 Thread Dianne Hackborn
Sorry as things are today you basically can't do this because many devices
are not reporting the correct true screen dpi.  If they did, the correct way
to do this would be to use a physical unit for your dimensions --- that is
10mm if you want 10mm.  But as I say, there are many devices out there
that are not configured with the correct physical screen dpi do these units
are at this point not usable.

On Thu, May 12, 2011 at 8:50 AM, Ab abe.oppenh...@gmail.com wrote:

 I want to put a toolbar in my application. The toolbar will use
 ImageViews as application buttons. I would like the ImageViews to be
 the exact same size regardless device; by same size I mean that,
 when rendered to the screen, if I measure them with a ruler, the
 dimensions will be the same. I would like this size to be ~10mm (the
 width of my index finger).

 I have been completely unsuccessful in accomplishing this.

 I am testing on a MDPI, large screen Acer Iconia Tab and a HDPI medium
 screen Samsung Galaxy Tab. If I set layout_width=50dip and
 layout_height=50dip, the buttons render as ~10mm on the Samsung, and
 ~8mm on the Acer. If I set the buttons as layout_width=12mm and
 layout_height=12mm, they render as 12mm on the Acer and ~9mm on the
 Galaxy (confusing that 50dip renders bigger on the Galaxy than the
 Acer, but 12 mm renders smaller on the Galaxy than on the Acer).

 If I place a 32pix x 32pix icon in my drawable-mdpi folder (and no
 equivalent in the drawable-hdpi folder), and set
 layout_width=wrap_content and layout_height=wrap_content; the
 results are similar to if set to 50dip, the Samsung is about 10mm, the
 Acer about 8mm. If I add a 48pix x 48pix icon to my drawable-hdpi
 folder, there is no change; presumably because the Acer still uses the
 mdpi icon and the Samsung uses the bigger one, but scales it down by
 50% because it knows its hdpi (if am confident that this surprising
 scaling occurs because if I move the 48pix icon to the mdpi folder,
 and have nothing in the hdpi folder, the icon shows very large on the
 Samsung).

 I then attempted to calculate the number of pixels necessary for 10mm
 based on the values of xdpi and ydpi from DisplayMetrics: 10 mm in
 pixels = xdpi * 10 / 25.4.  On the galaxy, this is  168.89 * 10 / 25.4
 = 66.  However, when I set the layout_width to 66, the button measured
 ~8mm wide.  But, at 168.89 dpi, the dots per mm should be 6.64
 (168.89/25.4), so 66pixels should be approximately 10mm.  So, how
 could it measure 8mm?  The Galaxy must be scaling down the layout
 parameters somehow. Is there any way to retrieve how much they are
 scaling down by, so that I can adjust for it?

 I am confused and could really use advice. How do I make my button
 fingertip sized regardless of dpi and screen size?

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




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

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

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

Re: [android-developers] Calling an Activity when phone is locked by clicking two times on the END_CALL button

2011-05-12 Thread Dianne Hackborn
Sorry you can't do this.

On Thu, May 12, 2011 at 5:44 AM, souissi haythem haythe...@gmail.comwrote:

 Hi,

 I need to call my Activity when user press two times on the END_CALL
 button (it need to work when the phone is locked).

 Is is that possible??



 Thanks.

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




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

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

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

Re: [android-developers] Re: UI Framework Bug?

2011-05-12 Thread Dianne Hackborn
Don't re-inflate each time.  Implement this correctly, where you re-use the
convertView if it is given.  Just make sure you have the states of the views
set up correctly before you return.

On Thu, May 12, 2011 at 8:14 AM, authorwjf wfran...@softlayer.com wrote:

 Yahel's post got me to thinking.  I modified the getView method of my
 data adapter to look like this:


 @Override
 public View getView(int position, View convertView, ViewGroup parent)
 {
LayoutInflater vi =
 (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = vi.inflate(R.layout.list_view_row, null);
TextView label = (TextView) v.findViewById(R.id.label);
   ImageView spinner = (ImageView) v.findViewById(R.id.spinner);
   MyContainer item = (MyContainer) items.get(position);
   label.setText(item.getText());
   spinner.setVisibility(View.INVISIBLE);
   if (item.isLoading()) {
  label.setText(***+item.getText()+***);
  spinner = (ImageView)v.findViewById(R.id.spinner);
  spinner.setVisibility(View.VISIBLE);
  Animation spinnerAnimation =
 AnimationUtils.loadAnimation(getContext(), R.anim.rotate);
  spinner.startAnimation(spinnerAnimation);
   }
   return v;
 }


 And the problem seems resolved!  Great news for me.  Though I wonder
 if any of you can comment as to the performance hit / impact I might
 expect to take reloading the view from the layout every single time
 the adapter refreshes?  I'm not experiencing any issues with the demo
 program, but the lists in my actual application can get rather long
 and include several lines of text for each row.

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




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

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

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

[android-developers] Re: UI Framework Bug?

2011-05-12 Thread Yahel
Your solution seems to simple not reuse the views. I don't think
you'll hit a performance issue speed-wise but you may want to check
memory-wise as I believe this is the main reason behind this design.

Especially if you have one bitmap per row, a long list of row could
trigger Bitmap exceeds VM budget memory exceptions.

Yahel

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


Re: [android-developers] Re: UI Framework Bug?

2011-05-12 Thread Dianne Hackborn
Not reusing views will most likely cause a noticeable performance impact for
things like scrolling through the list, since now every time a new item in
the list is shown a while new view hierarchy needs to be built for it.

Always always recycle views.

On Thu, May 12, 2011 at 9:15 AM, Yahel kaye...@gmail.com wrote:

 Your solution seems to simple not reuse the views. I don't think
 you'll hit a performance issue speed-wise but you may want to check
 memory-wise as I believe this is the main reason behind this design.

 Especially if you have one bitmap per row, a long list of row could
 trigger Bitmap exceeds VM budget memory exceptions.

 Yahel

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




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

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

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

[android-developers] Re: Android: how to draw an ImageView with the same size regardless of device?

2011-05-12 Thread Ab
Diane,

Thank you for your reply.  I have 2 quick follow up questions:

1. I seems that the fact that 66 pixels shows on my Galaxy as 8mm,
when it should be 10mm (based on provided dpi), is do to a false dpi
returned from DisplayMetrics.  The Galaxy screen measures 3.5 inches
wide, and the specs that its resolution is 1024 x 600.  So, 600/3.5 =
171.48.  Which is close enough to 168.89 that it doesn't explain the
2mm difference in button size.  Am I incorrect in my thought that
there is something else causing this discrepancy?

2. What is your recommendation to display a relatively consistently
sized button?  Possibly have different layouts for extra large
devices, set the button dimensions to 50dip on regular devices, and
75dip on extra large devices?

On May 12, 12:10 pm, Dianne Hackborn hack...@android.com wrote:
 Sorry as things are today you basically can't do this because many devices
 are not reporting the correct true screen dpi.  If they did, the correct way
 to do this would be to use a physical unit for your dimensions --- that is
 10mm if you want 10mm.  But as I say, there are many devices out there
 that are not configured with the correct physical screen dpi do these units
 are at this point not usable.









 On Thu, May 12, 2011 at 8:50 AM, Ab abe.oppenh...@gmail.com wrote:
  I want to put a toolbar in my application. The toolbar will use
  ImageViews as application buttons. I would like the ImageViews to be
  the exact same size regardless device; by same size I mean that,
  when rendered to the screen, if I measure them with a ruler, the
  dimensions will be the same. I would like this size to be ~10mm (the
  width of my index finger).

  I have been completely unsuccessful in accomplishing this.

  I am testing on a MDPI, large screen Acer Iconia Tab and a HDPI medium
  screen Samsung Galaxy Tab. If I set layout_width=50dip and
  layout_height=50dip, the buttons render as ~10mm on the Samsung, and
  ~8mm on the Acer. If I set the buttons as layout_width=12mm and
  layout_height=12mm, they render as 12mm on the Acer and ~9mm on the
  Galaxy (confusing that 50dip renders bigger on the Galaxy than the
  Acer, but 12 mm renders smaller on the Galaxy than on the Acer).

  If I place a 32pix x 32pix icon in my drawable-mdpi folder (and no
  equivalent in the drawable-hdpi folder), and set
  layout_width=wrap_content and layout_height=wrap_content; the
  results are similar to if set to 50dip, the Samsung is about 10mm, the
  Acer about 8mm. If I add a 48pix x 48pix icon to my drawable-hdpi
  folder, there is no change; presumably because the Acer still uses the
  mdpi icon and the Samsung uses the bigger one, but scales it down by
  50% because it knows its hdpi (if am confident that this surprising
  scaling occurs because if I move the 48pix icon to the mdpi folder,
  and have nothing in the hdpi folder, the icon shows very large on the
  Samsung).

  I then attempted to calculate the number of pixels necessary for 10mm
  based on the values of xdpi and ydpi from DisplayMetrics: 10 mm in
  pixels = xdpi * 10 / 25.4.  On the galaxy, this is  168.89 * 10 / 25.4
  = 66.  However, when I set the layout_width to 66, the button measured
  ~8mm wide.  But, at 168.89 dpi, the dots per mm should be 6.64
  (168.89/25.4), so 66pixels should be approximately 10mm.  So, how
  could it measure 8mm?  The Galaxy must be scaling down the layout
  parameters somehow. Is there any way to retrieve how much they are
  scaling down by, so that I can adjust for it?

  I am confused and could really use advice. How do I make my button
  fingertip sized regardless of dpi and screen size?

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

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

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

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


Re: [android-developers] Re: How is In App Billing?

2011-05-12 Thread Nikolay Elenkov
On Fri, May 13, 2011 at 12:58 AM, Nathan critter...@crittermap.com wrote:
 On May 9, 9:15 pm, Nikolay Elenkov nikolay.elen...@gmail.com wrote:
 On Tue, May 10, 2011 at 3:17 AM, Nathan critter...@crittermap.com wrote:

  I have looked at Urban Airship's solution.

 http://urbanairship.com/products/in-app-purchase/

 Using third party solutions might violate the Developer agreement,
 so you'd probably want to get legal advice if you decide to use it.

 My understanding is that Urban Airship uses the Market solution, and
 implements the server portion and downloading of resources. As far as
 I know, there is no non-third party solution for these.

If billing goes through the Android Market/Google Checkout, it is
probably OK. But it's not exactly clear what they do from the website
at least (I didn't read the blogs).

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


[android-developers] Re: Development Patterns

2011-05-12 Thread Cory Kaufman
I'm not sure what you mean... I've already developed a few apps and have 
been heavily using developer.android.com. 

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

[android-developers] Re: Usage Statistics

2011-05-12 Thread Edmund
Thank you both!

On May 11, 8:14 pm, Marc Lester Tan mail...@gmail.com wrote:
 Take a look at UsageStatsService.java

 http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...

 http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...It
 monitors all the application resume/pause state and logs into files.

 and check how the settings app is using it here:

 http://android.git.kernel.org/?p=platform/packages/apps/Settings.git;...

 Not sure though if you can use it in your app.









 On Thu, May 12, 2011 at 10:29 AM, TreKing treking...@gmail.com wrote:
  On Wed, May 11, 2011 at 8:01 PM, Edmund chang.edm...@gmail.com wrote:

  For example, if I wanted to know how many times a certain APK was
  launched. How long it was used for. And also, if I wanted to know details
  about how the APK was being used such as how many times they played a
  certain music track in a music player app or passed a certain level in a
  game, can I inject some code into the APK to register this data?

 http://code.google.com/mobile/analytics/docs/android/
 http://www.flurry.com/

  I was wondering about details like where can I retrieve this from and is it
  centralized.
  Like can one APK retrieve this data that is written by all other APKs.

  I'm not really sure what you're asking.

  -
  TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
  transit tracking app for Android-powered devices

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

 --
 Cheers,

 *Marc Lester Tan *

 http://www.appalert.cohttp://moonphase.pendukosoftware.comhttp://blogs.marctan.com

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


[android-developers] Re: Android: how to draw an ImageView with the same size regardless of device?

2011-05-12 Thread Ab
*Edit.  Sorry, first sentence after 1. should read:

IT seems that the fact that 66 pixels shows on my Galaxy as 8mm,
when it should be 10mm (based on provided dpi), ISN'T DUE to a false
dpi
returned from DisplayMetrics.

On May 12, 12:29 pm, Ab abe.oppenh...@gmail.com wrote:
 Diane,

 Thank you for your reply.  I have 2 quick follow up questions:

 1. I seems that the fact that 66 pixels shows on my Galaxy as 8mm,
 when it should be 10mm (based on provided dpi), is do to a false dpi
 returned from DisplayMetrics.  The Galaxy screen measures 3.5 inches
 wide, and the specs that its resolution is 1024 x 600.  So, 600/3.5 =
 171.48.  Which is close enough to 168.89 that it doesn't explain the
 2mm difference in button size.  Am I incorrect in my thought that
 there is something else causing this discrepancy?

 2. What is your recommendation to display a relatively consistently
 sized button?  Possibly have different layouts for extra large
 devices, set the button dimensions to 50dip on regular devices, and
 75dip on extra large devices?

 On May 12, 12:10 pm, Dianne Hackborn hack...@android.com wrote:







  Sorry as things are today you basically can't do this because many devices
  are not reporting the correct true screen dpi.  If they did, the correct way
  to do this would be to use a physical unit for your dimensions --- that is
  10mm if you want 10mm.  But as I say, there are many devices out there
  that are not configured with the correct physical screen dpi do these units
  are at this point not usable.

  On Thu, May 12, 2011 at 8:50 AM, Ab abe.oppenh...@gmail.com wrote:
   I want to put a toolbar in my application. The toolbar will use
   ImageViews as application buttons. I would like the ImageViews to be
   the exact same size regardless device; by same size I mean that,
   when rendered to the screen, if I measure them with a ruler, the
   dimensions will be the same. I would like this size to be ~10mm (the
   width of my index finger).

   I have been completely unsuccessful in accomplishing this.

   I am testing on a MDPI, large screen Acer Iconia Tab and a HDPI medium
   screen Samsung Galaxy Tab. If I set layout_width=50dip and
   layout_height=50dip, the buttons render as ~10mm on the Samsung, and
   ~8mm on the Acer. If I set the buttons as layout_width=12mm and
   layout_height=12mm, they render as 12mm on the Acer and ~9mm on the
   Galaxy (confusing that 50dip renders bigger on the Galaxy than the
   Acer, but 12 mm renders smaller on the Galaxy than on the Acer).

   If I place a 32pix x 32pix icon in my drawable-mdpi folder (and no
   equivalent in the drawable-hdpi folder), and set
   layout_width=wrap_content and layout_height=wrap_content; the
   results are similar to if set to 50dip, the Samsung is about 10mm, the
   Acer about 8mm. If I add a 48pix x 48pix icon to my drawable-hdpi
   folder, there is no change; presumably because the Acer still uses the
   mdpi icon and the Samsung uses the bigger one, but scales it down by
   50% because it knows its hdpi (if am confident that this surprising
   scaling occurs because if I move the 48pix icon to the mdpi folder,
   and have nothing in the hdpi folder, the icon shows very large on the
   Samsung).

   I then attempted to calculate the number of pixels necessary for 10mm
   based on the values of xdpi and ydpi from DisplayMetrics: 10 mm in
   pixels = xdpi * 10 / 25.4.  On the galaxy, this is  168.89 * 10 / 25.4
   = 66.  However, when I set the layout_width to 66, the button measured
   ~8mm wide.  But, at 168.89 dpi, the dots per mm should be 6.64
   (168.89/25.4), so 66pixels should be approximately 10mm.  So, how
   could it measure 8mm?  The Galaxy must be scaling down the layout
   parameters somehow. Is there any way to retrieve how much they are
   scaling down by, so that I can adjust for it?

   I am confused and could really use advice. How do I make my button
   fingertip sized regardless of dpi and screen size?

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

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

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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at

[android-developers] Re: good 2d physics engine

2011-05-12 Thread Eamonn Dunne
Box2d is a good idea, its what angry birds uses.

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

Re: [android-developers] Development Patterns

2011-05-12 Thread TreKing
On Wed, May 11, 2011 at 1:08 PM, Cory Kaufman allspirits...@gmail.comwrote:

 It's worked out well for me to create a base class that extends Activity
 that all of my other activities extend, so I have a central
 place to put common functionality.


What happens when you need a MapActivity? Or ListActivity? Or
ExpandableListActivity? Or ... ?


  When should strings be listed in values/strings.xml and when should they
 be hard coded?


Does it need to be localized? Yes - strings.xml. No? - Hard code or
(preferably) some configuration file.


 What kind of conventions should be used when giving views ids?


Whatever makes sense to you. I go with tv_name for TextViews, rb_name for
Radio Buttons, etc, etc. Makes them easy to find by what type you're looking
for.


 Should there not be views in different layouts with the same name?


Not if you're using those layouts together within the same parent(s). Then
you might run into issues.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

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

[android-developers] Re: Development Patterns

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/

On May 11, 11:08 am, Cory Kaufman allspirits...@gmail.com wrote:
 Hi,

 Has anyone started cataloging common design patterns that arise when
 developing Android apps?

 For example:

 It's worked out well for me to create a base class that extends
 Activity that all of my other activities extend, so I have a central
 place to put common functionality.
 When should strings be listed in values/strings.xml and when should
 they be hard coded?
 What kind of conventions should be used when giving views ids? Should
 there not be views in different layouts with the same name?

 Etc.

 Cory

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


[android-developers] Re: Development Patterns

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/

On May 11, 11:02 pm, Kacee komal...@gmail.com wrote:
 Please read little more fromhttp://developer.android.com
 Once you'll start writing Android code, these queries will go off

 On May 11, 2:08 pm, Cory Kaufman allspirits...@gmail.com wrote:







  Hi,

  Has anyone started cataloging common design patterns that arise when
  developing Android apps?

  For example:

  It's worked out well for me to create a base class that extends
  Activity that all of my other activities extend, so I have a central
  place to put common functionality.
  When should strings be listed in values/strings.xml and when should
  they be hard coded?
  What kind of conventions should be used when giving views ids? Should
  there not be views in different layouts with the same name?

  Etc.

  Cory

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


[android-developers] Re: Development Patterns

2011-05-12 Thread joseph bashkar

: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/
On May 12, 9:33 am, Cory Kaufman allspirits...@gmail.com wrote:
 I'm not sure what you mean... I've already developed a few apps and have
 been heavily using developer.android.com.

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


[android-developers] Re: Development Patterns

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/

On May 12, 10:06 am, TreKing treking...@gmail.com wrote:
 On Wed, May 11, 2011 at 1:08 PM, Cory Kaufman allspirits...@gmail.comwrote:

  It's worked out well for me to create a base class that extends Activity
  that all of my other activities extend, so I have a central
  place to put common functionality.

 What happens when you need a MapActivity? Or ListActivity? Or
 ExpandableListActivity? Or ... ?

   When should strings be listed in values/strings.xml and when should they
  be hard coded?

 Does it need to be localized? Yes - strings.xml. No? - Hard code or
 (preferably) some configuration file.

  What kind of conventions should be used when giving views ids?

 Whatever makes sense to you. I go with tv_name for TextViews, rb_name for
 Radio Buttons, etc, etc. Makes them easy to find by what type you're looking
 for.

  Should there not be views in different layouts with the same name?

 Not if you're using those layouts together within the same parent(s). Then
 you might run into issues.

 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

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


[android-developers] Re: good 2d physics engine

2011-05-12 Thread joseph bashkar

: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/
On May 11, 11:57 am, TreKing treking...@gmail.com wrote:
 On Wed, May 11, 2011 at 1:28 PM, bob b...@coolgroups.com wrote:
  Can anyone recommend a good 2d physics engine for Android?

 Always check the Google's first, as this type of question has usually
 already been asked (and answered) repeatedly.http://tinyurl.com/6cm8mwk

 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

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


[android-developers] Re: good 2d physics engine

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/

On May 11, 6:41 pm, TreKing treking...@gmail.com wrote:
 On Wed, May 11, 2011 at 7:26 PM, Kristopher Micinski krismicin...@gmail.com

  wrote:
  The problem with this is that inevitably whenever someone does this their
  thread appears as the first link soon after...

 Word. But if they Google'd for such common queries, then the post would
 never exist to show up on Google ...
 Also, Google usually returns more than one result ... ;-)

 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

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


[android-developers] Re: good 2d physics engine

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/

On May 12, 9:53 am, Eamonn Dunne eamonn.du...@gmail.com wrote:
 Box2d is a good idea, its what angry birds uses.

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


[android-developers] Re: good 2d physics engine

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/

On May 11, 11:28 am, bob b...@coolgroups.com wrote:
 Can anyone recommend a good 2d physics engine for 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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: good 2d physics engine

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/

On May 11, 11:57 am, TreKing treking...@gmail.com wrote:
 On Wed, May 11, 2011 at 1:28 PM, bob b...@coolgroups.com wrote:
  Can anyone recommend a good 2d physics engine for Android?

 Always check the Google's first, as this type of question has usually
 already been asked (and answered) repeatedly.http://tinyurl.com/6cm8mwk

 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

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


[android-developers] Re: good 2d physics engine

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/

On May 11, 6:41 pm, TreKing treking...@gmail.com wrote:
 On Wed, May 11, 2011 at 7:26 PM, Kristopher Micinski krismicin...@gmail.com

  wrote:
  The problem with this is that inevitably whenever someone does this their
  thread appears as the first link soon after...

 Word. But if they Google'd for such common queries, then the post would
 never exist to show up on Google ...
 Also, Google usually returns more than one result ... ;-)

 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

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


[android-developers] Re: good 2d physics engine

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/

On May 11, 11:28 am, bob b...@coolgroups.com wrote:
 Can anyone recommend a good 2d physics engine for 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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: good 2d physics engine

2011-05-12 Thread joseph bashkar

: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/
On May 12, 3:07 am, Jens dunkingbikk...@gmail.com wrote:
 JBox2D is decent enough. If you're writing a game using the NDK you
 should probably use the normal Box2D, it compiles readily on Android.

 On 11 Maj, 20:28, bob b...@coolgroups.com wrote:







  Can anyone recommend a good 2d physics engine for 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
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: good 2d physics engine

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/

On May 12, 9:53 am, Eamonn Dunne eamonn.du...@gmail.com wrote:
 Box2d is a good idea, its what angry birds uses.

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


[android-developers] Re: Usage Statistics

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/

On May 11, 6:01 pm, Edmund chang.edm...@gmail.com wrote:
 Hi,

 I was wondering what type of services exist to track usage and what
 type of usage data it has available. For example, if I wanted to know
 how many times a certain APK was launched. How long it was used for.
 And also, if I wanted to know details about how the APK was being used
 such as how many times they played a certain music track in a music
 player app or passed a certain level in a game, can I inject some code
 into the APK to register this data? I believe I saw an example of this
 at the Google I/O Extended 2011. However, I was wondering about
 details like where can I retrieve this from and is it centralized.
 Like can one APK retrieve this data that is written by all other
 APKs.

 Thanks,
 --Edmund Chang
 chang.edm...@gmail.com

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


[android-developers] Re: Usage Statistics

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/

On May 11, 7:29 pm, TreKing treking...@gmail.com wrote:
 On Wed, May 11, 2011 at 8:01 PM, Edmund chang.edm...@gmail.com wrote:
  For example, if I wanted to know how many times a certain APK was launched.
  How long it was used for. And also, if I wanted to know details about how
  the APK was being used such as how many times they played a certain music
  track in a music player app or passed a certain level in a game, can I
  inject some code into the APK to register this data?

 http://code.google.com/mobile/analytics/docs/android/http://www.flurry.com/

 I was wondering about details like where can I retrieve this from and is it

  centralized.
  Like can one APK retrieve this data that is written by all other APKs.

 I'm not really sure what you're asking.

 -
 TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
 transit tracking app for Android-powered devices

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


[android-developers] Re: Usage Statistics

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/

On May 11, 8:14 pm, Marc Lester Tan mail...@gmail.com wrote:
 Take a look at UsageStatsService.java

 http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...

 http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...It
 monitors all the application resume/pause state and logs into files.

 and check how the settings app is using it here:

 http://android.git.kernel.org/?p=platform/packages/apps/Settings.git;...

 Not sure though if you can use it in your app.









 On Thu, May 12, 2011 at 10:29 AM, TreKing treking...@gmail.com wrote:
  On Wed, May 11, 2011 at 8:01 PM, Edmund chang.edm...@gmail.com wrote:

  For example, if I wanted to know how many times a certain APK was
  launched. How long it was used for. And also, if I wanted to know details
  about how the APK was being used such as how many times they played a
  certain music track in a music player app or passed a certain level in a
  game, can I inject some code into the APK to register this data?

 http://code.google.com/mobile/analytics/docs/android/
 http://www.flurry.com/

  I was wondering about details like where can I retrieve this from and is it
  centralized.
  Like can one APK retrieve this data that is written by all other APKs.

  I'm not really sure what you're asking.

  -
  TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
  transit tracking app for Android-powered devices

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

 --
 Cheers,

 *Marc Lester Tan *

 http://www.appalert.cohttp://moonphase.pendukosoftware.comhttp://blogs.marctan.com

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


[android-developers] Re: Usage Statistics

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/

On May 12, 9:45 am, Edmund chang.edm...@gmail.com wrote:
 Thank you both!

 On May 11, 8:14 pm, Marc Lester Tan mail...@gmail.com wrote:







  Take a look at UsageStatsService.java

 http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...

  http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;...It
  monitors all the application resume/pause state and logs into files.

  and check how the settings app is using it here:

 http://android.git.kernel.org/?p=platform/packages/apps/Settings.git;...

  Not sure though if you can use it in your app.

  On Thu, May 12, 2011 at 10:29 AM, TreKing treking...@gmail.com wrote:
   On Wed, May 11, 2011 at 8:01 PM, Edmund chang.edm...@gmail.com wrote:

   For example, if I wanted to know how many times a certain APK was
   launched. How long it was used for. And also, if I wanted to know details
   about how the APK was being used such as how many times they played a
   certain music track in a music player app or passed a certain level in a
   game, can I inject some code into the APK to register this data?

  http://code.google.com/mobile/analytics/docs/android/
  http://www.flurry.com/

   I was wondering about details like where can I retrieve this from and is 
   it
   centralized.
   Like can one APK retrieve this data that is written by all other APKs.

   I'm not really sure what you're asking.

   -
   TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
   transit tracking app for Android-powered devices

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

  --
  Cheers,

  *Marc Lester Tan *

 http://www.appalert.cohttp://moonphase.pendukosoftware.comhttp://blog...

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


[android-developers] Re: Android: how to draw an ImageView with the same size regardless of device?

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/

On May 12, 9:10 am, Dianne Hackborn hack...@android.com wrote:
 Sorry as things are today you basically can't do this because many devices
 are not reporting the correct true screen dpi.  If they did, the correct way
 to do this would be to use a physical unit for your dimensions --- that is
 10mm if you want 10mm.  But as I say, there are many devices out there
 that are not configured with the correct physical screen dpi do these units
 are at this point not usable.









 On Thu, May 12, 2011 at 8:50 AM, Ab abe.oppenh...@gmail.com wrote:
  I want to put a toolbar in my application. The toolbar will use
  ImageViews as application buttons. I would like the ImageViews to be
  the exact same size regardless device; by same size I mean that,
  when rendered to the screen, if I measure them with a ruler, the
  dimensions will be the same. I would like this size to be ~10mm (the
  width of my index finger).

  I have been completely unsuccessful in accomplishing this.

  I am testing on a MDPI, large screen Acer Iconia Tab and a HDPI medium
  screen Samsung Galaxy Tab. If I set layout_width=50dip and
  layout_height=50dip, the buttons render as ~10mm on the Samsung, and
  ~8mm on the Acer. If I set the buttons as layout_width=12mm and
  layout_height=12mm, they render as 12mm on the Acer and ~9mm on the
  Galaxy (confusing that 50dip renders bigger on the Galaxy than the
  Acer, but 12 mm renders smaller on the Galaxy than on the Acer).

  If I place a 32pix x 32pix icon in my drawable-mdpi folder (and no
  equivalent in the drawable-hdpi folder), and set
  layout_width=wrap_content and layout_height=wrap_content; the
  results are similar to if set to 50dip, the Samsung is about 10mm, the
  Acer about 8mm. If I add a 48pix x 48pix icon to my drawable-hdpi
  folder, there is no change; presumably because the Acer still uses the
  mdpi icon and the Samsung uses the bigger one, but scales it down by
  50% because it knows its hdpi (if am confident that this surprising
  scaling occurs because if I move the 48pix icon to the mdpi folder,
  and have nothing in the hdpi folder, the icon shows very large on the
  Samsung).

  I then attempted to calculate the number of pixels necessary for 10mm
  based on the values of xdpi and ydpi from DisplayMetrics: 10 mm in
  pixels = xdpi * 10 / 25.4.  On the galaxy, this is  168.89 * 10 / 25.4
  = 66.  However, when I set the layout_width to 66, the button measured
  ~8mm wide.  But, at 168.89 dpi, the dots per mm should be 6.64
  (168.89/25.4), so 66pixels should be approximately 10mm.  So, how
  could it measure 8mm?  The Galaxy must be scaling down the layout
  parameters somehow. Is there any way to retrieve how much they are
  scaling down by, so that I can adjust for it?

  I am confused and could really use advice. How do I make my button
  fingertip sized regardless of dpi and screen size?

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

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

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

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


[android-developers] Re: Android: how to draw an ImageView with the same size regardless of device?

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/

On May 12, 9:41 am, Ab abe.oppenh...@gmail.com wrote:
 *Edit.  Sorry, first sentence after 1. should read:

 IT seems that the fact that 66 pixels shows on my Galaxy as 8mm,
 when it should be 10mm (based on provided dpi), ISN'T DUE to a false
 dpi
 returned from DisplayMetrics.

 On May 12, 12:29 pm, Ab abe.oppenh...@gmail.com wrote:







  Diane,

  Thank you for your reply.  I have 2 quick follow up questions:

  1. I seems that the fact that 66 pixels shows on my Galaxy as 8mm,
  when it should be 10mm (based on provided dpi), is do to a false dpi
  returned from DisplayMetrics.  The Galaxy screen measures 3.5 inches
  wide, and the specs that its resolution is 1024 x 600.  So, 600/3.5 =
  171.48.  Which is close enough to 168.89 that it doesn't explain the
  2mm difference in button size.  Am I incorrect in my thought that
  there is something else causing this discrepancy?

  2. What is your recommendation to display a relatively consistently
  sized button?  Possibly have different layouts for extra large
  devices, set the button dimensions to 50dip on regular devices, and
  75dip on extra large devices?

  On May 12, 12:10 pm, Dianne Hackborn hack...@android.com wrote:

   Sorry as things are today you basically can't do this because many devices
   are not reporting the correct true screen dpi.  If they did, the correct 
   way
   to do this would be to use a physical unit for your dimensions --- that is
   10mm if you want 10mm.  But as I say, there are many devices out there
   that are not configured with the correct physical screen dpi do these 
   units
   are at this point not usable.

   On Thu, May 12, 2011 at 8:50 AM, Ab abe.oppenh...@gmail.com wrote:
I want to put a toolbar in my application. The toolbar will use
ImageViews as application buttons. I would like the ImageViews to be
the exact same size regardless device; by same size I mean that,
when rendered to the screen, if I measure them with a ruler, the
dimensions will be the same. I would like this size to be ~10mm (the
width of my index finger).

I have been completely unsuccessful in accomplishing this.

I am testing on a MDPI, large screen Acer Iconia Tab and a HDPI medium
screen Samsung Galaxy Tab. If I set layout_width=50dip and
layout_height=50dip, the buttons render as ~10mm on the Samsung, and
~8mm on the Acer. If I set the buttons as layout_width=12mm and
layout_height=12mm, they render as 12mm on the Acer and ~9mm on the
Galaxy (confusing that 50dip renders bigger on the Galaxy than the
Acer, but 12 mm renders smaller on the Galaxy than on the Acer).

If I place a 32pix x 32pix icon in my drawable-mdpi folder (and no
equivalent in the drawable-hdpi folder), and set
layout_width=wrap_content and layout_height=wrap_content; the
results are similar to if set to 50dip, the Samsung is about 10mm, the
Acer about 8mm. If I add a 48pix x 48pix icon to my drawable-hdpi
folder, there is no change; presumably because the Acer still uses the
mdpi icon and the Samsung uses the bigger one, but scales it down by
50% because it knows its hdpi (if am confident that this surprising
scaling occurs because if I move the 48pix icon to the mdpi folder,
and have nothing in the hdpi folder, the icon shows very large on the
Samsung).

I then attempted to calculate the number of pixels necessary for 10mm
based on the values of xdpi and ydpi from DisplayMetrics: 10 mm in
pixels = xdpi * 10 / 25.4.  On the galaxy, this is  168.89 * 10 / 25.4
= 66.  However, when I set the layout_width to 66, the button measured
~8mm wide.  But, at 168.89 dpi, the dots per mm should be 6.64
(168.89/25.4), so 66pixels should be approximately 10mm.  So, how
could it measure 8mm?  The Galaxy must be scaling down the layout
parameters somehow. Is there any way to retrieve how much they are
scaling down by, so that I can adjust for it?

I am confused and could really use advice. How do I make my button
fingertip sized regardless of dpi and screen size?

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

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

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

-- 
You received this message because you are subscribed to the 

[android-developers] Re: UI Framework Bug?

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/

On May 12, 7:13 am, authorwjf wfran...@softlayer.com wrote:
 Hello Android UI Gurus,

 I have been struggling for a few days now with an annoying UI issue.
 I've whittled the project down to nothing but a small demonstration of
 the problem.  I admit I'm pretty new to Android UI work, but at the
 same time I'm an experienced, qualified engineer and I just can't seem
 to figure this out.  I was hoping to get some feedback from some of
 you out there who are more familiar with the internals and
 idiosyncrasies  of the platform.  Any help would be greatly
 appreciated!

 The desired behavior:
 I have a list view.  Each list view row consists of a text element,
 and a hidden image.  When an item is selected from the list, I'd like
 to make the image visible, and, start an animation on it.  Pretty
 standard stuff here, we're talking basically about a loading
 spinner.

 The problem:
 After selecting 2 or sometimes 3 items in the list, I see spinners
 become visible and start animating for rows which were never
 selected.  The two things that lead me to believe this is a bug with
 the platform are:

 A) Putting in a break point I can clearly see that the underlying data
 source from the list does not have the isSpinning property set for
 the items that begin animating in a seemingly random manner.

 and

 B) The only code that makes the image visible and begins the animation
 for that row is inside of my custom data adapter.  Before it can start
 the animation it changes the text field in that row as well.  The text
 fields are not changed in the rows where my spinners seem to appear of
 their own accord.

 The code:
 As I said when I started this post I've removed everything from the
 project except the relevant UI code.  Here is what I have.

 /res/layout
 main.xml=
 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
     android:orientation=vertical
     android:layout_width=fill_parent
     android:layout_height=fill_parent 
         TextView
             android:layout_width=fill_parent
             android:layout_height=wrap_content
             android:text=@string/hello/
         ListView
             android:id=@+id/android:list
             android:layout_width=fill_parent
             android:layout_height=fill_parent
             android:cacheColorHint=#
             android:background=@android:color/transparent
             android:dividerHeight=1dip/
 /LinearLayout

 list_view_row.xml=
 ?xml version=1.0 encoding=utf-8?
 LinearLayout xmlns:android=http://schemas.android.com/apk/res/
 android
     android:layout_width=fill_parent
     android:layout_height=?android:attr/listPreferredItemHeight
     android:padding=6dip
     LinearLayout
         android:layout_width=fill_parent
         android:layout_height=wrap_content
         android:orientation=horizontal
             TextView
                         android:id=@+id/label
                 android:textSize=11sp
                 android:padding=2dip
                 android:gravity=center_vertical|center
                 android:layout_gravity=center_vertical|center
                 android:layout_width=wrap_content
                 android:layout_height=wrap_content
                 android:textColor=#ff/
             ImageView
                 android:id=@+id/spinner
                 android:padding=2dip
                 android:src=@drawable/loading
                 android:layout_width=wrap_content
                 android:layout_height=wrap_content/
         /LinearLayout
 /LinearLayout

 /res/anim
 rotate.xml=
 ?xml version=1.0 encoding=UTF-8?
 rotate
     xmlns:android=http://schemas.android.com/apk/res/android;
     android:fromDegrees=0
     android:toDegrees=360
     android:pivotX=50%
     android:pivotY=50%
     android:repeatCount=infinite
     android:interpolator=@android:anim/linear_interpolator
     android:duration=1900 /

 /res/drawable
 spinner.png

 /src
 MyContainer.java=
 public class MyContainer {
         private String mText = ;
         private Boolean mLoading = false;

         public void setText(String mText) {
                 this.mText = mText;
         }
         public String getText() {
                 return mText;
         }
         public void setIsLoading(Boolean mLoading) {
                 this.mLoading = mLoading;
         }
         public Boolean isLoading() {
                 return mLoading;
         }

 }

 CustomAdapter.java=
 public class CustomAdapter extends ArrayAdapterMyContainer {

         private ArrayListMyContainer items;
         private Context c = null;

         public CustomAdapter(Context context, int textViewResourceId,
 ArrayListMyContainer items) {
        super(context, textViewResourceId, items);
        this.items = items;
        this.c = context;
    }

         @Override
     public View getView(int position, 

[android-developers] Re: Android: how to draw an ImageView with the same size regardless of device?

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/

On May 12, 8:50 am, Ab abe.oppenh...@gmail.com wrote:
 I want to put a toolbar in my application. The toolbar will use
 ImageViews as application buttons. I would like the ImageViews to be
 the exact same size regardless device; by same size I mean that,
 when rendered to the screen, if I measure them with a ruler, the
 dimensions will be the same. I would like this size to be ~10mm (the
 width of my index finger).

 I have been completely unsuccessful in accomplishing this.

 I am testing on a MDPI, large screen Acer Iconia Tab and a HDPI medium
 screen Samsung Galaxy Tab. If I set layout_width=50dip and
 layout_height=50dip, the buttons render as ~10mm on the Samsung, and
 ~8mm on the Acer. If I set the buttons as layout_width=12mm and
 layout_height=12mm, they render as 12mm on the Acer and ~9mm on the
 Galaxy (confusing that 50dip renders bigger on the Galaxy than the
 Acer, but 12 mm renders smaller on the Galaxy than on the Acer).

 If I place a 32pix x 32pix icon in my drawable-mdpi folder (and no
 equivalent in the drawable-hdpi folder), and set
 layout_width=wrap_content and layout_height=wrap_content; the
 results are similar to if set to 50dip, the Samsung is about 10mm, the
 Acer about 8mm. If I add a 48pix x 48pix icon to my drawable-hdpi
 folder, there is no change; presumably because the Acer still uses the
 mdpi icon and the Samsung uses the bigger one, but scales it down by
 50% because it knows its hdpi (if am confident that this surprising
 scaling occurs because if I move the 48pix icon to the mdpi folder,
 and have nothing in the hdpi folder, the icon shows very large on the
 Samsung).

 I then attempted to calculate the number of pixels necessary for 10mm
 based on the values of xdpi and ydpi from DisplayMetrics: 10 mm in
 pixels = xdpi * 10 / 25.4.  On the galaxy, this is  168.89 * 10 / 25.4
 = 66.  However, when I set the layout_width to 66, the button measured
 ~8mm wide.  But, at 168.89 dpi, the dots per mm should be 6.64
 (168.89/25.4), so 66pixels should be approximately 10mm.  So, how
 could it measure 8mm?  The Galaxy must be scaling down the layout
 parameters somehow. Is there any way to retrieve how much they are
 scaling down by, so that I can adjust for it?

 I am confused and could really use advice. How do I make my button
 fingertip sized regardless of dpi and screen size?

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


[android-developers] Re: UI Framework Bug?

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/

On May 12, 7:47 am, Yahel kaye...@gmail.com wrote:
 I believe you have a case of view reusing.

 The ArrayAdapter will reuse row views whenever possible to preserve
 memory. So if you set a Bitmap to visible that might be what carries
 it as visible on usually the row X+5. So that you would need to reset
 everything on the view that was dynamically changed in the GetView.

 For example :

 @Override
     public View getView(int position, View convertView, ViewGroup
 parent) {
                 View v = convertView;
         if (v == null) {
             LayoutInflater vi =
 (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
             v = vi.inflate(R.layout.list_view_row, null);
         }
         TextView label = (TextView) v.findViewById(R.id.label);
         ImageView spinner = (ImageView) v.findViewById(R.id.spinner);
         MyContainer item = (MyContainer) items.get(position);

         label.setText(item.getText());
         spinner.setVisibility(View.INVISIBLE);

         if (item.isLoading()) {
                 label.setText(***+item.getText()+***);
                 spinner = (ImageView)v.findViewById(R.id.spinner);
                 spinner.setVisibility(View.VISIBLE);
                 Animation spinnerAnimation =
                 AnimationUtils.loadAnimation(getContext(),
 R.anim.rotate);
                 spinner.startAnimation(spinnerAnimation);
         }

         return v;
         }

 Not sure though.

 Good luck.

 Yahel

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


[android-developers] Re: UI Framework Bug?

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/

On May 12, 8:02 am, authorwjf wfran...@softlayer.com wrote:
 I'm also including a few pics to illustrate the issue in case my text
 isn't entirely clear.

 [IMG]http://i53.tinypic.com/339oemx.png[/IMG]

 (http://tinypic.com/r/339oemx/7)

 [IMG]http://i53.tinypic.com/2qjhevo.png[/IMG]

 (http://tinypic.com/r/2qjhevo/7)

 [IMG]http://i56.tinypic.com/2s1agsp.png[/IMG]

 (http://tinypic.com/r/2s1agsp/7)

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


[android-developers] Re: UI Framework Bug?

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/

On May 12, 8:04 am, authorwjf wfran...@softlayer.com wrote:
 Thanks, Yahel.  I will give your suggestion a try this morning.

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


[android-developers] Re: UI Framework Bug?

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/

On May 12, 8:14 am, authorwjf wfran...@softlayer.com wrote:
 Yahel's post got me to thinking.  I modified the getView method of my
 data adapter to look like this:

 @Override
 public View getView(int position, View convertView, ViewGroup parent)
 {
    LayoutInflater vi =
 (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v = vi.inflate(R.layout.list_view_row, null);
    TextView label = (TextView) v.findViewById(R.id.label);
    ImageView spinner = (ImageView) v.findViewById(R.id.spinner);
    MyContainer item = (MyContainer) items.get(position);
    label.setText(item.getText());
    spinner.setVisibility(View.INVISIBLE);
    if (item.isLoading()) {
       label.setText(***+item.getText()+***);
       spinner = (ImageView)v.findViewById(R.id.spinner);
       spinner.setVisibility(View.VISIBLE);
       Animation spinnerAnimation =
 AnimationUtils.loadAnimation(getContext(), R.anim.rotate);
       spinner.startAnimation(spinnerAnimation);
    }
    return v;

 }

 And the problem seems resolved!  Great news for me.  Though I wonder
 if any of you can comment as to the performance hit / impact I might
 expect to take reloading the view from the layout every single time
 the adapter refreshes?  I'm not experiencing any issues with the demo
 program, but the lists in my actual application can get rather long
 and include several lines of text for each row.

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


[android-developers] Re: UI Framework Bug?

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/

On May 12, 9:12 am, Dianne Hackborn hack...@android.com wrote:
 Don't re-inflate each time.  Implement this correctly, where you re-use the
 convertView if it is given.  Just make sure you have the states of the views
 set up correctly before you return.









 On Thu, May 12, 2011 at 8:14 AM, authorwjf wfran...@softlayer.com wrote:
  Yahel's post got me to thinking.  I modified the getView method of my
  data adapter to look like this:

  @Override
  public View getView(int position, View convertView, ViewGroup parent)
  {
     LayoutInflater vi =
  (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
     View v = vi.inflate(R.layout.list_view_row, null);
     TextView label = (TextView) v.findViewById(R.id.label);
    ImageView spinner = (ImageView) v.findViewById(R.id.spinner);
    MyContainer item = (MyContainer) items.get(position);
    label.setText(item.getText());
    spinner.setVisibility(View.INVISIBLE);
    if (item.isLoading()) {
       label.setText(***+item.getText()+***);
       spinner = (ImageView)v.findViewById(R.id.spinner);
       spinner.setVisibility(View.VISIBLE);
       Animation spinnerAnimation =
  AnimationUtils.loadAnimation(getContext(), R.anim.rotate);
       spinner.startAnimation(spinnerAnimation);
    }
    return v;
  }

  And the problem seems resolved!  Great news for me.  Though I wonder
  if any of you can comment as to the performance hit / impact I might
  expect to take reloading the view from the layout every single time
  the adapter refreshes?  I'm not experiencing any issues with the demo
  program, but the lists in my actual application can get rather long
  and include several lines of text for each row.

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

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

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

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


[android-developers] Re: UI Framework Bug?

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/

On May 12, 9:15 am, Yahel kaye...@gmail.com wrote:
 Your solution seems to simple not reuse the views. I don't think
 you'll hit a performance issue speed-wise but you may want to check
 memory-wise as I believe this is the main reason behind this design.

 Especially if you have one bitmap per row, a long list of row could
 trigger Bitmap exceeds VM budget memory exceptions.

 Yahel

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


[android-developers] Re: UI Framework Bug?

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/:
http://123maza.com/65/rings780/: http://123maza.com/65/rings780/

On May 12, 9:28 am, Dianne Hackborn hack...@android.com wrote:
 Not reusing views will most likely cause a noticeable performance impact for
 things like scrolling through the list, since now every time a new item in
 the list is shown a while new view hierarchy needs to be built for it.

 Always always recycle views.









 On Thu, May 12, 2011 at 9:15 AM, Yahel kaye...@gmail.com wrote:
  Your solution seems to simple not reuse the views. I don't think
  you'll hit a performance issue speed-wise but you may want to check
  memory-wise as I believe this is the main reason behind this design.

  Especially if you have one bitmap per row, a long list of row could
  trigger Bitmap exceeds VM budget memory exceptions.

  Yahel

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

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

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

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


[android-developers] Re: Android: how to draw an ImageView with the same size regardless of device?

2011-05-12 Thread joseph bashkar
: http://123maza.com/65/rings780/: http://123maza.com/65/rings780/

On May 12, 9:29 am, Ab abe.oppenh...@gmail.com wrote:
 Diane,

 Thank you for your reply.  I have 2 quick follow up questions:

 1. I seems that the fact that 66 pixels shows on my Galaxy as 8mm,
 when it should be 10mm (based on provided dpi), is do to a false dpi
 returned from DisplayMetrics.  The Galaxy screen measures 3.5 inches
 wide, and the specs that its resolution is 1024 x 600.  So, 600/3.5 =
 171.48.  Which is close enough to 168.89 that it doesn't explain the
 2mm difference in button size.  Am I incorrect in my thought that
 there is something else causing this discrepancy?

 2. What is your recommendation to display a relatively consistently
 sized button?  Possibly have different layouts for extra large
 devices, set the button dimensions to 50dip on regular devices, and
 75dip on extra large devices?

 On May 12, 12:10 pm, Dianne Hackborn hack...@android.com wrote:







  Sorry as things are today you basically can't do this because many devices
  are not reporting the correct true screen dpi.  If they did, the correct way
  to do this would be to use a physical unit for your dimensions --- that is
  10mm if you want 10mm.  But as I say, there are many devices out there
  that are not configured with the correct physical screen dpi do these units
  are at this point not usable.

  On Thu, May 12, 2011 at 8:50 AM, Ab abe.oppenh...@gmail.com wrote:
   I want to put a toolbar in my application. The toolbar will use
   ImageViews as application buttons. I would like the ImageViews to be
   the exact same size regardless device; by same size I mean that,
   when rendered to the screen, if I measure them with a ruler, the
   dimensions will be the same. I would like this size to be ~10mm (the
   width of my index finger).

   I have been completely unsuccessful in accomplishing this.

   I am testing on a MDPI, large screen Acer Iconia Tab and a HDPI medium
   screen Samsung Galaxy Tab. If I set layout_width=50dip and
   layout_height=50dip, the buttons render as ~10mm on the Samsung, and
   ~8mm on the Acer. If I set the buttons as layout_width=12mm and
   layout_height=12mm, they render as 12mm on the Acer and ~9mm on the
   Galaxy (confusing that 50dip renders bigger on the Galaxy than the
   Acer, but 12 mm renders smaller on the Galaxy than on the Acer).

   If I place a 32pix x 32pix icon in my drawable-mdpi folder (and no
   equivalent in the drawable-hdpi folder), and set
   layout_width=wrap_content and layout_height=wrap_content; the
   results are similar to if set to 50dip, the Samsung is about 10mm, the
   Acer about 8mm. If I add a 48pix x 48pix icon to my drawable-hdpi
   folder, there is no change; presumably because the Acer still uses the
   mdpi icon and the Samsung uses the bigger one, but scales it down by
   50% because it knows its hdpi (if am confident that this surprising
   scaling occurs because if I move the 48pix icon to the mdpi folder,
   and have nothing in the hdpi folder, the icon shows very large on the
   Samsung).

   I then attempted to calculate the number of pixels necessary for 10mm
   based on the values of xdpi and ydpi from DisplayMetrics: 10 mm in
   pixels = xdpi * 10 / 25.4.  On the galaxy, this is  168.89 * 10 / 25.4
   = 66.  However, when I set the layout_width to 66, the button measured
   ~8mm wide.  But, at 168.89 dpi, the dots per mm should be 6.64
   (168.89/25.4), so 66pixels should be approximately 10mm.  So, how
   could it measure 8mm?  The Galaxy must be scaling down the layout
   parameters somehow. Is there any way to retrieve how much they are
   scaling down by, so that I can adjust for it?

   I am confused and could really use advice. How do I make my button
   fingertip sized regardless of dpi and screen size?

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

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

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

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


  1   2   3   >