[android-developers] Re: Dialog box without title

2011-03-27 Thread Dixi
use this, this will definitely remove the TITLE from dialog box

dialog.requestWindowFeature(dialog.getWindow().FEATURE_NO_TITLE);

--
Regards
Dixit Wadhwani

On Mar 27, 12:32 am, Archit Jain dce.arc...@gmail.com wrote:
 Hi all,

 Is there a way, I can remove title from the default dialog box ?

 I am using following code :

 Dialog alertDialog = new Dialog(getApplicationContext());
 alertDialog.setContentView(R.layout.info);
 alertDialog.setCancelable(true);
 alertDialog.show();

 But it shows a titlebar with no text in it. How can I avoid that?

 Regards,
 Archit

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Dialog box without title

2011-03-27 Thread Doug
On Mar 26, 1:24 pm, TreKing treking...@gmail.com wrote:
 On Sat, Mar 26, 2011 at 2:32 PM, Archit Jain dce.arc...@gmail.com wrote:
  Dialog alertDialog = new Dialog(getApplicationContext());

 Never use getApplicationContext() - it's pointless and doesn't work for
 Dialogs. I'm surprised you're seeing anything.

It's not pointless, and please stop telling people that.  :-)

You just have to know when to use it.  Use it when you need to store a
context in an object that lives longer than an instance of an activity
or service, but don't want to leak that activity or service.  The
application context is perfect for that.

Doug

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Augmented Reality and Spherical 360º Views

2011-03-27 Thread Andreas
Hi miguel,

Keep the current transformation matrix in a history array (where
all(40-50) the past transformations are kept) and on each change add
all the past transformations with the current and divide by their
number..

Regards,

Andreas

On Mar 26, 10:01 pm, miguel miguelp...@gmail.com wrote:
 Hi, Im working on a AR framework to have the same functionality and
 behaviour as Layar or Wikitude does.
 Im working hard and now Im totally stuck and missing many hours trying
 to fix a problem: I cant get the screen objects to move smooth.

 Im trying to figure out how layar, wikitude, skymap or streetview does
 to have such a smooth moving overlays that follows the orientation
 changes of the devices. But I cant. (PLEASE: google free the skymap
 code)
 I dont even know if Im focusing the problem well so please, if someone
 could help me a bit It would be awesome.

 So here are some questions for someone who may answer it:

 - Any tip for the sensor noise removal? Low pass filter, threeshold?
 both? any value for that filters? I tried EVERYTHING but the smooth
 problem may not be just here (so sad)
 - Any useful tip to make the overlay views move smooth?

 Im using a framelayout witch has a camera overlay on it. Over it I
 paint everything else, the radar and its points, a frame, and the
 moving views so:
 - You think skymap or wikitude use a separated thread just for the
 painting?
 Should I include all the moving views on a surface or am I doing well?
 Do you think they are using openGL?

 Thank you very very much in advance. Any help would be appreciated.
 Im totally desperate and can go head without this issue solved. Sorry
 for my bad english and 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] Specifying textAppearance using a custom attribute

2011-03-27 Thread Mark Carter
If I specify the style directly, everything works fine:

TextView ... android:textAppearance=@style/MyTextAppearance /

where styles.xml has:

style name=MyTextAppearance parent=@android:style/TextAppearance
...
/style

However, I want to use a custom attribute so that the actual style used is 
specified by the theme. So in attrs.xml:

attr name=myTextAppearanceAttr format=reference /

and in styles.xml:

style name=MyTheme parent=@android:style/Theme.NoTitleBar
item name=myTextAppearanceAttr@style/MyTextAppearance/item
...
/style

and then use:

TextView ... android:textAppearance=?myTextAppearanceAttr /

but this does not work (i.e. as if the textAppearance attribute is being 
ignored).

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Bluetooth

2011-03-27 Thread ehpaul
Yes. You can use Bluecove API.

On Mar 26, 7:57 pm, Kristopher Micinski krismicin...@gmail.com
wrote:
 Nice find then, I hadn't known about that, but is it possible from Java?

 Kris







 On Sat, Mar 26, 2011 at 10:24 PM, ehpaul hansp...@gmail.com wrote:
  It looks a better way is to make a l2cap connection and look at the
  exception.

  On Mar 26, 2:47 am, ehpaul hansp...@gmail.com wrote:
   So basically I will have a background thread that periodically tried
   to connec and immediate disconnect?

   On Mar 25, 4:35 pm, Kristopher Micinski krismicin...@gmail.com
   wrote:

On Fri, Mar 25, 2011 at 4:53 AM, ehpaul hansp...@gmail.com wrote:
 Hello, I am writing an android program that I need to know when a
 bluetooth device (I know the Mac) is in range. The program also needs
 to be aware when the device is not in range. Is there any way to do
 this without establishing a connection?

Not that I've seen from the Bluetooth API exposed to the user. I don't
understand the underlying protocol horribly well, but you need to
  actually
scan for the uuid using SDP, which requires a call to the API.

 When the device is in range, I am able to call
 BluetoothAdapter.getRemoteDevice and retrieve the friendly name. But
 when I am not in range, it seems this information is cached. I was
 thinking if I can use the friendly name as an indicator whether the
 device is within range (i.e If friendly name is not null, then it's
  in
 range). I am certain there is better way to do this. But it seems the
 only way is to establishing a connection.

I don't think there is a better way, at least with the current API.
  Unless
by better way you mean a more elaborate synchronization mechanism or
something like that. But yes, I think at least from the API exposed by
  the
android system, you have to do polling.

(I wanted to do what you described too, I think it's a common thing,
  but
perhaps not the anticipated use of BT and / or the android API.)

Kris

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, 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] Re: How to capture key events from View subclass

2011-03-27 Thread Rich E
Thanks Pepijn,

I am overriding onCreateInputConnection (and onCheckIsTextEditor) although
neither of these give me per-keytap events - from what I have read,
onKeyDown/Up only give per-keytap event signals on hard keyboards, not soft.

I did find out about the TextWatcher class from
http://www.mail-archive.com/android-developers@googlegroups.com/msg10100.html.
You can attach it with the
addTextChangedListenerhttp://developer.android.com/reference/android/widget/TextView.html#addTextChangedListener(android.text.TextWatcher)
(TextWatcherhttp://developer.android.com/reference/android/text/TextWatcher.html
watcher)
method of TextView.  But I have yet a different problem with this;  I get
events per tap on the keyboard
when subclassing EditText, but not TextView (and the exact same code, just
changing what I subclass).  But, EditText brings alot of baggage that I
don't want, like the current position marker, etc.  Anyone know why this
would be?

On Thu, Mar 24, 2011 at 11:44 PM, Pepijn Van Eeckhoudt 
pep...@vaneeckhoudt.net wrote:

  I've never done this myself, but from reading the InputMethodManager
 documentation I get the impression you need to override
 View#onCreateInputConnection(EditorInfo) in order to directly interact with
 an IME.
 Might be worth a shot...

 Pepijn


 On 24/03/2011 13:26, Rich E wrote:


 On Tue, Mar 22, 2011 at 6:14 PM, harsh chandel harshdchan...@gmail.comwrote:

 try ontouch method
 get x and y coordinate   of the area clicked
 and do as you want on the clicked event


  harsh chandel, I am not sure that I understand you.. I am using
 onTouchEvent() to trigger the keyboard (imm.showSoftInput() code in my last
 post)... but I cannot get the pressed keys of the keyboard.  As it is not my
 keyboard (it is the system shared keyboard), I cannot re-implement any
 onTouchEvent method that it may hold, unless I am missing something in your
 suggestion.

  There must be some event that I need to listen to (onKeyUp for the soft
 keyboard keys..), but I don't yet know how.

  Thanks for the help,
 Rich
  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 to capture key events from View subclass

2011-03-27 Thread Rich E
Harsh, this doesn't make any sense.  You are suggesting that implementing
onKeyDown will cause onTouchEvent to receive touches from the keyboard? That
is not right. Also, the touches are not in my view, they are in the global
keyboard.

From what I have found in other posts, onKeyDown/Up does not fire when
pressing individual keys on the soft keyboard, only for the hard.  Why this
is so is unclear to me, but that is what I am experiencing.

The only solution I have found so far is not a favorable one, subclass
EditText and call
addTextChangedListenerhttp://developer.android.com/reference/android/widget/TextView.html#addTextChangedListener(android.text.TextWatcher)
with
my own TextWatcher.

On Thu, Mar 24, 2011 at 11:49 PM, harsh chandel harshdchan...@gmail.comwrote:

 ok you have to write the code for on key down
 and each time the key is pressed on soft keyboard you capture the event
 and do whatever you  want to do with on press event
 @Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
_active = false;
}

  this was what i was talking about


 On Thu, Mar 24, 2011 at 5:56 PM, Rich E reakina...@gmail.com wrote:


 On Tue, Mar 22, 2011 at 6:14 PM, harsh chandel 
 harshdchan...@gmail.comwrote:

 try ontouch method
 get x and y coordinate   of the area clicked
 and do as you want on the clicked event


 harsh chandel, I am not sure that I understand you.. I am using
 onTouchEvent() to trigger the keyboard (imm.showSoftInput() code in my last
 post)... but I cannot get the pressed keys of the keyboard.  As it is not my
 keyboard (it is the system shared keyboard), I cannot re-implement any
 onTouchEvent method that it may hold, unless I am missing something in your
 suggestion.

 There must be some event that I need to listen to (onKeyUp for the soft
 keyboard keys..), but I don't yet know how.

 Thanks for the help,
 Rich




-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Time Out on Insistent Notifications

2011-03-27 Thread Mark Murphy
On Sat, Mar 26, 2011 at 11:06 PM, Jake Colman col...@ppllc.com wrote:
 Is there an easy way to set a time limit on the insistent notification?

Not really, at least not for anything that I would consider easy.

 Or is there a way to manually clear the notification sound/vibrate/LED
 but without removing the text from the notification list?

Raise a Notification with the desired settings and the same unique ID.
The new Notification will replace the old one, assuming the old one is
still there.

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

Android Training in Oslo: http://bit.ly/fjBo24

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Augmented Reality and Spherical 360º Views

2011-03-27 Thread miguel
First of all, thank you all, thank you very much.
The kalman filter is something I have to test, I have read some about
this and might try.

@Andreas, you think that would give an smooth move to the layout
objects? It does work for you? If that could be a solution lets try
it. Isnt it a little bit slow?


On 27 mar, 09:35, Andreas andreasvour...@googlemail.com wrote:
 Hi miguel,

 Keep the current transformation matrix in a history array (where
 all(40-50) the past transformations are kept) and on each change add
 all the past transformations with the current and divide by their
 number..

 Regards,

 Andreas

 On Mar 26, 10:01 pm, miguel miguelp...@gmail.com wrote:

  Hi, Im working on a AR framework to have the same functionality and
  behaviour as Layar or Wikitude does.
  Im working hard and now Im totally stuck and missing many hours trying
  to fix a problem: I cant get the screen objects to move smooth.

  Im trying to figure out how layar, wikitude, skymap or streetview does
  to have such a smooth moving overlays that follows the orientation
  changes of the devices. But I cant. (PLEASE: google free the skymap
  code)
  I dont even know if Im focusing the problem well so please, if someone
  could help me a bit It would be awesome.

  So here are some questions for someone who may answer it:

  - Any tip for the sensor noise removal? Low pass filter, threeshold?
  both? any value for that filters? I tried EVERYTHING but the smooth
  problem may not be just here (so sad)
  - Any useful tip to make the overlay views move smooth?

  Im using a framelayout witch has a camera overlay on it. Over it I
  paint everything else, the radar and its points, a frame, and the
  moving views so:
  - You think skymap or wikitude use a separated thread just for the
  painting?
  Should I include all the moving views on a surface or am I doing well?
  Do you think they are using openGL?

  Thank you very very much in advance. Any help would be appreciated.
  Im totally desperate and can go head without this issue solved. Sorry
  for my bad english and 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: totally 2d

2011-03-27 Thread Nicholas Johnson
Bob,

I recently released a game (actually just this week, called Prism or 
Prism Light by Shadowpuppets), which doesn't use OpenGL at all. I just 
draw onto the canvas from my overrided onDraw method, and then invalidate 
only the part of the view which contains animation. I have determined that 
the drawing portion is the bottleneck for me (i.e. all the physics 
calculations and the rest of the game engine have no effect on the 
framerate). For your reference, I have an original Motorola Droid and I 
generally get around 60 frames per second of animation. During beta testing, 
other users with more advanced phones got upwards of 100 frames per second 
(I actually had to put a frame rate limiter in my game to keep it at 60 fps 
max).

*However!* This is my experience only and is unique to my game. If you 
download and play the free version, then you'll notice that my game board 
only takes up about 2/3 of the screen (and that is the *only* part of the 
screen which can be animated in my game). Furthermore, the performance 
increased drastically when I clipped the regions of the screen which didn't 
contain any animation. For example, my worst possible case scenario was 
needing to animation something in the top left corner and the bottom right 
corner at the same time. This causes the entire view to be redrawn and 
results in my worst frame rate scenario. In this case, the frame rate 
dropped to around 40 or 45 fps. At any other time, when the clipped region 
didn't take up the entire game board the frame rate increased upwards and 
past 60 fps (of note: even though the region was clipped, I still drew all 
the animations to the canvas, even if they were totally outside the clipped 
region. This didn't seem to affect the increased frame rate -- that is, it 
mostly depended on what actually gets pushed out to the screen buffers). So, 
it varies, but overall I got acceptable performance.

Also, depending on what devices you target, there are other options. For 
instance, if you're just targeting Honeycomb then you can enable hardware 
acceleration for your view with only the addition of 1 line of Java code 
(see the Developer's Guide recent Blog on the subject).

I haven't tried using OpenGL for my game, because overall I didn't need it. 
I was prepared to try, but I found that drawing my 2D animated game onto a 
view's canvas was sufficient for my purposes. I hope that this gives you the 
perspective you were looking for.

Nick

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 to capture key events from View subclass

2011-03-27 Thread Rich E
Harsh, it doesn't make sense that implementing onTouchEvent in a subclassed
View would return the soft keyboard's touch events (I want to know which key
is pressed on the soft keyboard, so I can draw it in my View).

Also, please email responses to the google group so other's can benefit from
this post.

On Thu, Mar 24, 2011 at 11:49 PM, harsh chandel harshdchan...@gmail.comwrote:

 ok you have to write the code for on key down
 and each time the key is pressed on soft keyboard you capture the event
 and do whatever you  want to do with on press event
 @Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
_active = false;
}

  this was what i was talking about


 On Thu, Mar 24, 2011 at 5:56 PM, Rich E reakina...@gmail.com wrote:


 On Tue, Mar 22, 2011 at 6:14 PM, harsh chandel 
 harshdchan...@gmail.comwrote:

 try ontouch method
 get x and y coordinate   of the area clicked
 and do as you want on the clicked event


 harsh chandel, I am not sure that I understand you.. I am using
 onTouchEvent() to trigger the keyboard (imm.showSoftInput() code in my last
 post)... but I cannot get the pressed keys of the keyboard.  As it is not my
 keyboard (it is the system shared keyboard), I cannot re-implement any
 onTouchEvent method that it may hold, unless I am missing something in your
 suggestion.

 There must be some event that I need to listen to (onKeyUp for the soft
 keyboard keys..), but I don't yet know how.

 Thanks for the help,
 Rich




-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Developing app to connect with websites

2011-03-27 Thread Wolf85
Thank you for your answer

On Mar 24, 10:43 pm, TreKing treking...@gmail.com wrote:
 On Wed, Mar 23, 2011 at 7:24 PM, Wolf85 msm...@gmail.com wrote:
  I would like to know if it is possible to develop an app that connects with
  a website(s)

 Yes, it's possible. You should probably make sure you're adhering to the
 site's terms of service, if there are any, about scraping their data without
 permission.

 -
 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


Re: [android-developers] Re: Developing app to connect with websites

2011-03-27 Thread Nasif Noorudeen
you have to call thier webservices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Scrollbar not working

2011-03-27 Thread New Developer
I have the following in the XML
TableLayout android:id=@+id/TableLayout01 
android:layout_width=fill_parent 
android:layout_height=fill_parent 
android:scrollbars=vertical
android:scrollbarSize=20dp
android:scrollbarAlwaysDrawVerticalTrack=true
android:stretchColumns=*
TableRow
  ListView
android:id=@+id/main_list 
android:layout_width=wrap_content 
android:layout_height=wrap_content
android:smoothScrollbar=true
android:fastScrollEnabled=true
android:scrollbars=vertical
android:scrollbarStyle=insideInset
android:scrollbarSize=20dip
android:textColor=#00ee00/ListView
/TableRow
  /TableLayout

I add the items dynamically from a database using

private ListView  listView = null;
listView = (ListView) findViewById(R.id.main_list);
listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

It shows a very narrow scrollbar.
But the list does not scroll and the scroll bar has no effect, which I click 
the scrollbar to move it
the scrollbar fades away.  any Ideas ?


Thanks in advance

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

Re: [android-developers] Re: findViewById returning NULL

2011-03-27 Thread New Developer
Thanks
It would appear I'm the same as Doug  and did as you requested

OS: Mac OS X 10.6.6
Eclipse: Helios SR2
ADT: 10.0.0

thanks again


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Augmented Reality and Spherical 360º Views

2011-03-27 Thread miguel

If it can help, what I have already implemented is something like
this:

I have a main activity. This activity instanciates 2 services that
feeds the main activity wih data. One is for the location and one is
for the sensors.
The main activity has a frame view holding the surface for the camera
preview and a customview that holds the radar, the bottom panels (and
its information) and the POIs.
For now, the first time the location service catchs a location, the
main activity gets it and unbinds the service.
Also, each time the sensor service feeds with data, I pass that
information down to the views of the hierarchy wich need to update its
own state.
I don use any thread and also, I call invalidate after the primary
onDraw method of the customview. The onDraw method of my customView
(Its actually called ARView) calls the onDraw method of all of the
child views.

I use a responsability chain for the POIs view and other for the radar
points.

My problem is that I dont know if I may have a surface holder, another
thread to paint the POIs and just them.
Also I dont know if I should use the timestamp of the sensor events to
smooth the movement as in the Accelerometer play sample.

So now Im tottally stuck, cannot continue.
The fact is that, for example, a 40 degrees AR visor in landscape mode
(ie. 480 px) has 8 px for each degree. That means when I move the
device one degree, the POI view jumps from 8 to 8 px so the movement
is not smooth.
So I started to use float instead of integers and got rid of the
layout() method, just call for the draw. It gets a bit finer but seems
to work bad as well.

The Kalman filter I use has:
p = 0.05f (tried from 0.5 to 0.05) and q = 1-p
p is for the recieved value and q is for the old state.

That still makes jumps and noise. If I move fast the device, ie 20
degrees, my POI view directly skips some of the px, just jumps from
one position to another. Dont know how to fix it. When the device move
is soft and slow the POI moves (not smooth) but at least does not
jump.
I also tried to put a kalman filter to the coordinates in the display
of the POI view but it doesnt behavie better at all.

So please, any kind of tip? I think that my main problem is that I
dont know how to apply the rotation matrix to a view.

Regards and thanks for your time. If someone wants the full code, just
ask.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] back button failure

2011-03-27 Thread chcat
Hello,
I have an application where MediaRecord activity is called from the
main activity:
application android:icon=@drawable/mzeal android:label=@string/
app_name android:debuggable=true
activity android:name=.Main
  android:label=@string/app_name
intent-filter
action android:name=android.intent.action.MAIN /
category
android:name=android.intent.category.LAUNCHER /
/intent-filter
/activity
activity
android:name=MediaRecord
/activity
...
When i try to press back button in MediaRecord to navigate back to
the Main screen application just fails with no exceptions in LogCat.
I do see following error messages in LogCat:

DEBUG/CameraInput(59): DoReset: E
DEBUG/CameraInput(59): DoReset: X
ERROR/CameraInput(59): Unsupported parameter(x-pvmf/media-input-node/
cap-config-interface;valtype=key_specific_value)
ERROR/CameraInput(59): VerifiyAndSetParameter failed on parameter #0

Can anyone advise: what those error messages mean and what may the
problem be?
Thank you,
-V

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Scrollbar not working

2011-03-27 Thread Mark Murphy
Android does not use scrollbars for more than a momentary display of
position. This is by design. The concept of a scrollbar as being the
mechanism for scrolling is for mouse-based UIs. Touchscreens scroll
via gestures sliding the whole thing up and down.

I strongly encourage you to use some touchscreen hardware -- whether
or not it is an Android phone -- before you start attempting to write
Android applications.

On Sun, Mar 27, 2011 at 8:11 AM, New Developer secur...@isscp.com wrote:
 I have the following in the XML
 TableLayout android:id=@+id/TableLayout01
     android:layout_width=fill_parent
     android:layout_height=fill_parent
     android:scrollbars=vertical
     android:scrollbarSize=20dp
     android:scrollbarAlwaysDrawVerticalTrack=true
     android:stretchColumns=*
     TableRow
       ListView
         android:id=@+id/main_list
         android:layout_width=wrap_content
         android:layout_height=wrap_content
         android:smoothScrollbar=true
         android:fastScrollEnabled=true
         android:scrollbars=vertical
         android:scrollbarStyle=insideInset
         android:scrollbarSize=20dip
         android:textColor=#00ee00/ListView
     /TableRow
   /TableLayout
 I add the items dynamically from a database using
 private ListView  listView = null;
 listView = (ListView) findViewById(R.id.main_list);
 listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
 It shows a very narrow scrollbar.
 But the list does not scroll and the scroll bar has no effect, which I click
 the scrollbar to move it
 the scrollbar fades away.  any Ideas ?

 Thanks in advance

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



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

Android Training in Oslo: http://bit.ly/fjBo24

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Getting a Google Account token to use for Google Reader calls?

2011-03-27 Thread Spiral123
Sounds obvious, but in my experience the most common reason for a 401
from the server with Google APIs is getting the service name wrong.
This is especially common when folks copy existing auth code fragments
to get something working - at least it did with me!

For reader I believe the service name should be 'reader'


On Mar 26, 5:16 pm, Chris Stewart cstewart...@gmail.com wrote:
 I've found various sources online trying to do this but every example I
 found hasn't worked for me.  Most simply return 401 errors from the server.

 I've gotten the auth token needed to make the calls from the local accounts
 on the phone and I've also tried making the ClientLogin call specifically
 with my username and password, and either way they're returning 401s.

 So, has anyone been successful in getting unread Google Reader posts?  Extra
 credit if you're doing it without having to handle a user's Google Account
 credentials first hand, but are doing it through allowed permissions.

 --
 Chris Stewarthttp://chriswstewart.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: Augmented Reality and Spherical 360º Views

2011-03-27 Thread Adam Ratana
Hi Miguel, I am working on something similar, although with less of a
focus on the camera, maybe we can combine forces a bit here.  I found
a very smooth filter in the open source code for Marine Compass --
check it out in the market, it's one of the smoothest filters out of
the various filtering approaches I have tried.  The source is at:

http://www.pierrox.net/cmsms/open-source/marine-compass-2.html

A search of the google group will also reveal some blog postings about
applying filters as I'm sure you may have seen, do a search for
orientation and you may find some more.  The above approach is the
smoothest that I've seen.

You may also find that there is some uncontrollable jitter using the
magnetometer + accelerometer as the pitch of the phone approaches 90
degrees, and it may also behave differently as yaw approaches 90 when
the phone is in landscape mode.  My approach is to hard limit the
pitch so that it does not go beyond a certain amount, but this is not
really ideal and I would love to really be able to get the skymap
type experience as well.  I went to a talk by the 2 skymap engineers a
year or 2 ago, and they mentioned difficulties with moving the phone
360 degrees, but unfortunately I cannot recall what they ultimately
wound up doing, and would also love to know.  IIRC one of the things
they said they did was plot data in excel to come up with a response
curve to apply, after taking the dot product of pitch + roll.  Don't
quote me on that though, my memory is hazy on it, and that was also
for 1.5, I'm sure it's been rewritten since..





On Mar 27, 8:20 am, miguel miguelp...@gmail.com wrote:
 If it can help, what I have already implemented is something like
 this:

 I have a main activity. This activity instanciates 2 services that
 feeds the main activity wih data. One is for the location and one is
 for the sensors.
 The main activity has a frame view holding the surface for the camera
 preview and a customview that holds the radar, the bottom panels (and
 its information) and the POIs.
 For now, the first time the location service catchs a location, the
 main activity gets it and unbinds the service.
 Also, each time the sensor service feeds with data, I pass that
 information down to the views of the hierarchy wich need to update its
 own state.
 I don use any thread and also, I call invalidate after the primary
 onDraw method of the customview. The onDraw method of my customView
 (Its actually called ARView) calls the onDraw method of all of the
 child views.

 I use a responsability chain for the POIs view and other for the radar
 points.

 My problem is that I dont know if I may have a surface holder, another
 thread to paint the POIs and just them.
 Also I dont know if I should use the timestamp of the sensor events to
 smooth the movement as in the Accelerometer play sample.

 So now Im tottally stuck, cannot continue.
 The fact is that, for example, a 40 degrees AR visor in landscape mode
 (ie. 480 px) has 8 px for each degree. That means when I move the
 device one degree, the POI view jumps from 8 to 8 px so the movement
 is not smooth.
 So I started to use float instead of integers and got rid of the
 layout() method, just call for the draw. It gets a bit finer but seems
 to work bad as well.

 The Kalman filter I use has:
 p = 0.05f (tried from 0.5 to 0.05) and q = 1-p
 p is for the recieved value and q is for the old state.

 That still makes jumps and noise. If I move fast the device, ie 20
 degrees, my POI view directly skips some of the px, just jumps from
 one position to another. Dont know how to fix it. When the device move
 is soft and slow the POI moves (not smooth) but at least does not
 jump.
 I also tried to put a kalman filter to the coordinates in the display
 of the POI view but it doesnt behavie better at all.

 So please, any kind of tip? I think that my main problem is that I
 dont know how to apply the rotation matrix to a view.

 Regards and thanks for your time. If someone wants the full code, just
 ask.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Starting An Android App From An Url

2011-03-27 Thread perumal subramaniam
Hi All,

Thanks for all the info. I specified my app's activity to be BROWSABLE in
the AndroidManifest file. I tried by using my own URI scheme. (e.g.
myownapp://dummy)

Then I wrote a sample html page, and specified a link which upon clicking
will start the app. Of course for this to work it must be assumed that the
app is already pre-installed in the device.

As I am testing with my own app and my own webpage, I think I need not stick
to using universal namespace. ( I hope i am correct but this method works!)

Thanks and Regards,
Perumal

On Sun, Mar 27, 2011 at 2:13 AM, Dianne Hackborn hack...@android.comwrote:

 If you are using WebView, you can do whatever you want by looking for
 clicks and using the platform APIs.

 If you are trying to do this from a web page the user is interacting with
 in the standard browser, you should use the mechanism I am suggesting.


 On Sat, Mar 26, 2011 at 9:40 AM, Lutz Bendlin l...@pocketgpsworld.comwrote:

 I didn't mean access, it was more about being able to launch the other
 activity. Surely you could craft a webpage with callbacks to your code that
 would then start the launcher intents ?



 *From:* Dianne Hackborn [mailto:hack...@android.com]
 *Sent:* Friday, March 25, 2011 10:02 PM
 *To:* android-developers@googlegroups.com
 *Cc:* Lutz Bendlin; perumal316
 *Subject:* Re: [android-developers] Re: Starting An Android App From An
 Url



 Yes it does.  The application uses the tags I showed to indicate it can
 handle a particular (or set of) http: URIs.



 Nothing gives you direct access to any application on the phone.  The
 application must at least opt in to being launched from the browser by
 supporting the BROWSABLE category for the activities it will allow to be
 launched.

 On Fri, Mar 25, 2011 at 5:37 PM, lbendlin l...@bendlin.us wrote:

 but http:// doesn't give you access to the local applications on the
 phone.  That was the OP's question (as I understand it). Do you need to do a
 binding from the webview back to the activity, and then a local translator
 to start the intent?




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




 --
 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: Starting An Android App From An Url

2011-03-27 Thread Kostya Vasilyev

27.03.2011 18:53, perumal subramaniam пишет:


As I am testing with my own app and my own webpage, I think I need not 
stick to using universal namespace. ( I hope i am correct but this 
method works!)


You still do.

If someone else uses myownapp:// (which is not really far-fetched), 
your applications will get mixed up.


Since it's your own site, just use its name to filter for 
http://perumal.subramaniam.com/myapp; or whatever.


--
Kostya Vasilyev -- http://kmansoft.wordpress.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


Re: [android-developers] Augmented Reality and Spherical 360º Views

2011-03-27 Thread Greg Donald
On Sat, Mar 26, 2011 at 9:01 PM, miguel miguelp...@gmail.com wrote:
 Do you think they are using openGL?

Have you had a look at how AndEngine does it's AR stuff?  I know the
Qualcom AR SDK uses OpenGL.


-- 
Greg Donald
destiney.com | gregdonald.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


Re: [android-developers] Re: Dialog box without title

2011-03-27 Thread TreKing
On Sun, Mar 27, 2011 at 2:25 AM, Doug beafd...@gmail.com wrote:

 It's not pointless, and please stop telling people that.  :-)

 You just have to know when to use it.  Use it when you need to store
 a context in an object that lives longer than an instance of an activity or
 service, but don't want to leak that activity or service.  The application
 context is perfect for that.


I suppose that is true. Though IMO a Context is not something that should be
stored in an object that outlives an Activity or Service. If you need a
Context, one is usually readily available wherever you happen to be and can
be passed as a parameter.

Do you have a good example of when storing a Context like this is a good
idea? I'm just curious.

-
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

Re: [android-developers] Re: Dialog box without title

2011-03-27 Thread Kostya Vasilyev

27.03.2011 19:05, TreKing пишет:
Do you have a good example of when storing a Context like this is a 
good idea? I'm just curious.


I do. Singletons.

Or, to use a more simple name, manager or utility classes that 
provide reusable functionality, which needs to be available to more than 
one Android application component.


--
Kostya Vasilyev -- http://kmansoft.wordpress.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: Devices not detected

2011-03-27 Thread SJ
Is they still detected as USB devices?

On Mar 25, 10:34 am, Kunju Vava android...@gmail.com wrote:
 hi

 You just tried to on/off the device
 or
 plse note

 Version of Android (2.1, 2.2)
  What version of Windows? 32-bit or 64-bit?
  Have you been able to only connect USB, WiFi, both or none of the above,

  i just give a clew ...i dont kow d details

 thanks
 Ratheesh

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Storing Context vs Passing As Parameter Where Needed

2011-03-27 Thread TreKing
Spawning off the Dialog box without title thread to discuss the pros and
cons of storing Context as a member vs passing a parameter. Here's the last
bit of the discussion from that thread:

On Mar 26, 1:24 pm, TreKing treking...@gmail.com wrote:
 On Sat, Mar 26, 2011 at 2:32 PM, Archit Jain dce.arc...@gmail.com wrote:
  Dialog alertDialog = new Dialog(getApplicationContext());

 Never use getApplicationContext() - it's pointless and doesn't work for
 Dialogs. I'm surprised you're seeing anything.

It's not pointless, and please stop telling people that.  :-)

You just have to know when to use it.  Use it when you need to store a
context in an object that lives longer than an instance of an activity
or service, but don't want to leak that activity or service.  The
application context is perfect for that.

On Sun, Mar 27, 2011 at 2:25 AM, Doug beafd...@gmail.com wrote:

 It's not pointless, and please stop telling people that.  :-)

 You just have to know when to use it.  Use it when you need to store
 a context in an object that lives longer than an instance of an activity or
 service, but don't want to leak that activity or service.  The application
 context is perfect for that.


I suppose that is true. Though IMO a Context is not something that should be
stored in an object that outlives an Activity or Service. If you need a
Context, one is usually readily available wherever you happen to be and can
be passed as a parameter.

Do you have a good example of when storing a Context like this is a good
idea? I'm just curious.

On Sun, Mar 27, 2011 at 10:16 AM, Kostya Vasilyev kmans...@gmail.com
 wrote:

 27.03.2011 19:05, TreKing пишет:

 Do you have a good example of when storing a Context like this is a good
 idea? I'm just curious.


 I do. Singletons.

 Or, to use a more simple name, manager or utility classes that provide
 reusable functionality, which needs to be available to more than one Android
 application component.


-
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] Simulation of user interaction.

2011-03-27 Thread SJ
Hallo

I'm interesting if there any way to simulate user activity on Android
device.

I'm interesting in softkeys, hwkeys, anything. Are there some
limitation?

Is it possible from user level (Java) or or kernel level (C), through
jailbreak or straight,

through BlueTooth or over Network or any special cable?

I'm not virus maker I need it for my project.

Thanks.
SJ

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Storing Context vs Passing As Parameter Where Needed

2011-03-27 Thread TreKing
On Sun, Mar 27, 2011 at 10:16 AM, Kostya Vasilyev kmans...@gmail.com
 wrote:

 27.03.2011 19:05, TreKing пишет:

  Do you have a good example of when storing a Context like this is a good
 idea? I'm just curious.

 I do. Singletons.


 Or, to use a more simple name, manager or utility classes that provide
 reusable functionality, which needs to be available to more than one Android
 application component.


Do you have something more concrete? :-)
Any Singleton, manager, or utility class can take Context as a parameter for
the functions it needs it for, making it clear to the user of the API that a
Context is needed for that functionality. In this case is seems storing the
Context is merely a convenience to avoid parameters in functions.

-
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

Re: [android-developers] Re: Dialog box without title

2011-03-27 Thread TreKing
On Sun, Mar 27, 2011 at 10:16 AM, Kostya Vasilyev kmans...@gmail.comwrote:

 27.03.2011 19:05, TreKing пишет:

  Do you have a good example of when storing a Context like this is a good
 idea? I'm just curious.


 I do. Singletons.

 Or, to use a more simple name, manager or utility classes that provide
 reusable functionality, which needs to be available to more than one Android
 application component.


I spawned a new thread off this one Storing Context vs Passing As Parameter
Where Needed to stop the derailment :-)

-
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

Re: [android-developers] Scrollbar not working

2011-03-27 Thread New Developer
Thanks

I have tried an android phone
Okay let me ask this  how then to you correctly test a ListView  with a scroll  
on the emulator ??
What is the correct method ?

Thanks again

On Mar 27, 2011, at 8:28 AM, Mark Murphy wrote:

 Android does not use scrollbars for more than a momentary display of
 position. This is by design. The concept of a scrollbar as being the
 mechanism for scrolling is for mouse-based UIs. Touchscreens scroll
 via gestures sliding the whole thing up and down.
 
 I strongly encourage you to use some touchscreen hardware -- whether
 or not it is an Android phone -- before you start attempting to write
 Android applications.
 
 On Sun, Mar 27, 2011 at 8:11 AM, New Developer secur...@isscp.com wrote:
 I have the following in the XML
 TableLayout android:id=@+id/TableLayout01
 android:layout_width=fill_parent
 android:layout_height=fill_parent
 android:scrollbars=vertical
 android:scrollbarSize=20dp
 android:scrollbarAlwaysDrawVerticalTrack=true
 android:stretchColumns=*
 TableRow
   ListView
 android:id=@+id/main_list
 android:layout_width=wrap_content
 android:layout_height=wrap_content
 android:smoothScrollbar=true
 android:fastScrollEnabled=true
 android:scrollbars=vertical
 android:scrollbarStyle=insideInset
 android:scrollbarSize=20dip
 android:textColor=#00ee00/ListView
 /TableRow
   /TableLayout
 I add the items dynamically from a database using
 private ListView  listView = null;
 listView = (ListView) findViewById(R.id.main_list);
 listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
 It shows a very narrow scrollbar.
 But the list does not scroll and the scroll bar has no effect, which I click
 the scrollbar to move it
 the scrollbar fades away.  any Ideas ?
 
 Thanks in advance
 
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 
 
 
 -- 
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy
 
 Android Training in Oslo: http://bit.ly/fjBo24
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Re: Starting An Android App From An Url

2011-03-27 Thread Mark Murphy
On Sun, Mar 27, 2011 at 11:00 AM, Kostya Vasilyev kmans...@gmail.com wrote:
 Since it's your own site, just use its name to filter for
 http://perumal.subramaniam.com/myapp; or whatever.

As a bonus, you can even put a real Web page there, with instructions
to the user to go download your app. Barcode Scanner works this way,
IIRC.

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

Android Training in Oslo: http://bit.ly/fjBo24

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Scrollbar not working

2011-03-27 Thread Mark Murphy
Use your mouse to simulate a finger.

On Sun, Mar 27, 2011 at 11:43 AM, New Developer secur...@isscp.com wrote:
 Thanks

 I have tried an android phone
 Okay let me ask this  how then to you correctly test a ListView  with a 
 scroll  on the emulator ??
 What is the correct method ?

 Thanks again

 On Mar 27, 2011, at 8:28 AM, Mark Murphy wrote:

 Android does not use scrollbars for more than a momentary display of
 position. This is by design. The concept of a scrollbar as being the
 mechanism for scrolling is for mouse-based UIs. Touchscreens scroll
 via gestures sliding the whole thing up and down.

 I strongly encourage you to use some touchscreen hardware -- whether
 or not it is an Android phone -- before you start attempting to write
 Android applications.

 On Sun, Mar 27, 2011 at 8:11 AM, New Developer secur...@isscp.com wrote:
 I have the following in the XML
 TableLayout android:id=@+id/TableLayout01
     android:layout_width=fill_parent
     android:layout_height=fill_parent
     android:scrollbars=vertical
     android:scrollbarSize=20dp
     android:scrollbarAlwaysDrawVerticalTrack=true
     android:stretchColumns=*
     TableRow
       ListView
         android:id=@+id/main_list
         android:layout_width=wrap_content
         android:layout_height=wrap_content
         android:smoothScrollbar=true
         android:fastScrollEnabled=true
         android:scrollbars=vertical
         android:scrollbarStyle=insideInset
         android:scrollbarSize=20dip
         android:textColor=#00ee00/ListView
     /TableRow
   /TableLayout
 I add the items dynamically from a database using
 private ListView  listView = null;
 listView = (ListView) findViewById(R.id.main_list);
 listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
 It shows a very narrow scrollbar.
 But the list does not scroll and the scroll bar has no effect, which I click
 the scrollbar to move it
 the scrollbar fades away.  any Ideas ?

 Thanks in advance

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



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

 Android Training in Oslo: http://bit.ly/fjBo24

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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




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

Android Training in Oslo: http://bit.ly/fjBo24

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Two functions Button?

2011-03-27 Thread Gabriel
How I create a button with two functions?
For example, when I click it once it starts a sound, and if I click it
again it stops the sounds.

Or a Mute button, that when I click it mutes all the sounds and change
the imagebutton for a mute off image and if I click it again the
sound returns.

I appreciate any help. Thanks

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
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: Storing Context vs Passing As Parameter Where Needed

2011-03-27 Thread Kostya Vasilyev

27.03.2011 19:27, TreKing пишет:

Do you have something more concrete? :-)


I was already being quite specific.

Any Singleton, manager, or utility class can take Context as a 
parameter for the functions it needs it for, making it clear to the 
user of the API that a Context is needed for that functionality


Sure, that's another way. I prefer to not do this, but coding style is a 
personal thing.


However, there are cases where a true global context is required, and 
passing a local Context as a parameter causes a leak.


--
Kostya Vasilyev -- http://kmansoft.wordpress.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


Re: [android-developers] Two functions Button?

2011-03-27 Thread Kostya Vasilyev

Sounds like maybe one of these:

http://developer.android.com/reference/android/widget/ToggleButton.html

Or a CheckBox with application-specified drawables.

-- Kostya

27.03.2011 19:55, Gabriel пишет:

How I create a button with two functions?
For example, when I click it once it starts a sound, and if I click it
again it stops the sounds.

Or a Mute button, that when I click it mutes all the sounds and change
the imagebutton for a mute off image and if I click it again the
sound returns.

I appreciate any help. Thanks




--
Kostya Vasilyev -- http://kmansoft.wordpress.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


Re: [android-developers] What is best game engine for Android?

2011-03-27 Thread Justin Giles
For 2D, try Andengine (andengine.org).  There's also libgdx (
http://code.google.com/p/libgdx/)

For 3D, Unity has some tools (for a price).

On Sun, Mar 27, 2011 at 11:00 AM, Droid rod...@gmail.com wrote:

 I reckon that I might need to use game type of content soon,
 especially with Xoom.
 So which is the easiest to get started on? Is there one starting to
 stand out from the crowd?
 I prefer late adopting so that I get a viable game engine that I could
 use into the future.

 Not impressed with openGL in java - seems a bit clunky and hard to
 program

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Regarding screen resolution

2011-03-27 Thread Laxmi Verma
Hi ,

1) Can you please provide some idea on how to make the screens to support
multiple displays for e.g. hdpi, qvga, ldpi, etc.
  In HDPI screen my application is running perfectly.  But in qvga screen
display its not dispalying the screen properly.

2) I am downloading xml from net connection, when the internet speed is
slow, it automatically gives force close error.  How to avoid this.  The
downloading xml code i had written in seperate thread and also enclosing it
into try catch block.

Best wishes!!

Laxmi Verma

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Two functions Button?

2011-03-27 Thread Dixi
use the even-odd logic.. like

int i=1;
button.onclick()
{
   if(i%2==0)
 {
 ///operation...
 i++;
 }

else
   {
  //operation
  i++;
   }


}

i think u  got it...
i hope it works

-
Regards
Dixit Wadhwani

On Mar 27, 8:55 pm, Gabriel gab...@gmail.com wrote:
 How I create a button with two functions?
 For example, when I click it once it starts a sound, and if I click it
 again it stops the sounds.

 Or a Mute button, that when I click it mutes all the sounds and change
 the imagebutton for a mute off image and if I click it again the
 sound returns.

 I appreciate any help. Thanks

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
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: Storing Context vs Passing As Parameter Where Needed

2011-03-27 Thread Mark Murphy
On Sun, Mar 27, 2011 at 11:58 AM, Kostya Vasilyev kmans...@gmail.com wrote:
 Any Singleton, manager, or utility class can take Context as a parameter
 for the functions it needs it for, making it clear to the user of the API
 that a Context is needed for that functionality

 Sure, that's another way. I prefer to not do this, but coding style is a
 personal thing.

Singletons, manager, or utility classes should not be caching a
Context. At most, they should be caching an Application, to prevent
people from accidentally caching short-lived Contexts (e.g., Activity,
Service).

 However, there are cases where a true global context is required, and
 passing a local Context as a parameter causes a leak.

Agreed. That is covered by TreKing's Use it when you need to store a
context in an object that lives longer than an instance of an activity
or service, but don't want to leak that activity or service. A fine
example here is dealing with configuration changes in an activity that
needs to bind to a service:

http://commonsware.com/blog/2010/09/29/another-use-getapplicationcontext-binding-rotation.html

or trying to get to sticky broadcasts from a BroadcastReceiver:

http://commonsware.com/blog/2010/09/12/real-use-getapplicationcontext.html

I used to use lines like TreKing's Never use
getApplicationContext(), but I've tried to be a tad more nuanced in
recent months. That being said, there is no question in my mind that,
in a support board like this, getApplicationContext() is a major code
smell. Most times, it is not needed, and can sometimes give erroneous
results.

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

Android Training in Oslo: http://bit.ly/fjBo24

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] best way to save images files

2011-03-27 Thread Igor Nesralla Ribeiro
Hi,

 

I have this scenario : 

I have 50  images files of restaurants , that
restaurants(name,city,address,image name) i saved into a database..My
question is..how and where I saved this images files.and how I display this
images files into a imageview

 

Thanks in advance..

Igor

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Two functions Button?

2011-03-27 Thread Gabriel
It's not working Dixie. Can you put this code more clear?

On 27 mar, 13:09, Dixi dixitwadhw...@gmail.com wrote:
 use the even-odd logic.. like

 int i=1;
 button.onclick()
 {
        if(i%2==0)
          {
              ///operation...
              i++;
          }

         else
        {
               //operation
               i++;
        }

 }

 i think u  got it...
 i hope it works

 -
 Regards
 Dixit Wadhwani

 On Mar 27, 8:55 pm, Gabriel gab...@gmail.com wrote:







  How I create a button with two functions?
  For example, when I click it once it starts a sound, and if I click it
  again it stops the sounds.

  Or a Mute button, that when I click it mutes all the sounds and change
  the imagebutton for a mute off image and if I click it again the
  sound returns.

  I appreciate any help. Thanks

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


Re: [android-developers] best way to save images files

2011-03-27 Thread Kevin Anthony
I would think the best way to save them is cached on a server.  This way
they are always up to date and you don't use phone memory

Sent from a phone
On Mar 27, 2011 12:05 PM, Igor Nesralla Ribeiro nesra...@gmail.com
wrote:

 Hi,



 I have this scenario :

 I have 50  images files of restaurants , that
restaurants(name,city,address,image name) i saved into a database….My
question is….how and where I saved this images files…and how I display this
images files into a imageview



 Thanks in advance….

 Igor

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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] Re: Storing Context vs Passing As Parameter Where Needed

2011-03-27 Thread Kostya Vasilyev

27.03.2011 20:17, Mark Murphy пишет:

Singletons, manager, or utility classes should not be caching a
Context.


They can and should if needed or wanted. However ...


  At most, they should be caching an Application, to prevent
people from accidentally caching short-lived Contexts (e.g., Activity,
Service).


... I'd further qualify that as ... a cached Context (if needed) should 
be an Application object reference, rather than a local, short-lived 
Context.



I used to use lines like TreKing's Never use
getApplicationContext(), but I've tried to be a tad more nuanced in
recent months.


Good.

Broad statements like that always remind me that the difference between 
theory and practice is that, in theory, there is no difference.



That being said, there is no question in my mind that,
in a support board like this, getApplicationContext() is a major code
smell. Most times, it is not needed, and can sometimes give erroneous
results.


Right. Let's just not throw the baby out with the bath water :)

--
Kostya Vasilyev -- http://kmansoft.wordpress.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: Regarding screen resolution

2011-03-27 Thread Nicholas Johnson
Different screen resolutions started to get support in API Level 4 (1.6). 
So, I recommend using API Level 4 and then reading the documention on the 
Android Dev 
sitehttp://developer.android.com/guide/practices/screens_support.html. 
It's really good.
 
Nick

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

[android-developers] What is best game engine for Android?

2011-03-27 Thread Droid
I reckon that I might need to use game type of content soon,
especially with Xoom.
So which is the easiest to get started on? Is there one starting to
stand out from the crowd?
I prefer late adopting so that I get a viable game engine that I could
use into the future.

Not impressed with openGL in java - seems a bit clunky and hard to
program

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Storing Context vs Passing As Parameter Where Needed

2011-03-27 Thread Mark Murphy
On Sun, Mar 27, 2011 at 12:30 PM, Kostya Vasilyev kmans...@gmail.com wrote:
 27.03.2011 20:17, Mark Murphy пишет:

 Singletons, manager, or utility classes should not be caching a
 Context.

 They can and should if needed or wanted. However ...

  At most, they should be caching an Application, to prevent
 people from accidentally caching short-lived Contexts (e.g., Activity,
 Service).

 ... I'd further qualify that as ... a cached Context (if needed) should be
 an Application object reference, rather than a local, short-lived Context.

My point was that you should not have:

class MySingleton {
Context thisIsAReallyBadIdea;

MySingleton(Context ctxt) {
thisIsAReallyBadIdea=ctxt;
}

// rest of class here
}

Instead, you should have:

class MySingleton {
Application thisIsMildlyDisconcertingButProbablyOK;

MySingleton(Application ctxt) {
thisIsMildlyDisconcertingButProbablyOK=ctxt;
}

// rest of class here
}

In other words, use Java's type safety to ensure that you are caching
an object with the appropriate lifetime, and that you are using it as
the object with the appropriate lifetime.

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

Android Training in Oslo: http://bit.ly/fjBo24

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


Fwd: [android-developers] Re: Regarding screen resolution

2011-03-27 Thread Laxmi Verma
Hi,


I had make entry of support-screens tag in the AndroidManifest.xml, but
the header which i customized is stil not coming in proper format.

Please help!!
Thanks!!
-- Forwarded message --
From: Nicholas Johnson metthejohn...@gmail.com
Date: Sun, Mar 27, 2011 at 9:58 PM
Subject: [android-developers] Re: Regarding screen resolution
To: android-developers@googlegroups.com
Cc: Laxmi Verma laxmiverma.andr...@gmail.com


Different screen resolutions started to get support in API Level 4 (1.6).
So, I recommend using API Level 4 and then reading the documention on the
Android Dev 
sitehttp://developer.android.com/guide/practices/screens_support.html.
It's really good.

Nick

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] best way to save images files

2011-03-27 Thread Igor Nesralla Ribeiro
Kevin,

Did you have any reference to send me ?!?

 

Thanks

Igor

 

From: android-developers@googlegroups.com
[mailto:android-developers@googlegroups.com] On Behalf Of Kevin Anthony
Sent: domingo, 27 de março de 2011 13:27
To: android-developers@googlegroups.com
Subject: Re: [android-developers] best way to save images files

 

I would think the best way to save them is cached on a server.  This way
they are always up to date and you don't use phone memory 

Sent from a phone
On Mar 27, 2011 12:05 PM, Igor Nesralla Ribeiro nesra...@gmail.com
wrote:

 Hi,

  

 I have this scenario :

 I have 50  images files of restaurants , that
restaurants(name,city,address,image name) i saved into a database….My
question is….how and where I saved this images files…and how I display this
images files into a imageview

  

 Thanks in advance….

 Igor

 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
mailto:android-developers%2bunsubscr...@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

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Storing Context vs Passing As Parameter Where Needed

2011-03-27 Thread Kostya Vasilyev

We're in agreement then :)

I like how you use Application class in method signature to ensure 
correctness (although I tend to call getApplicationContext inside 
MySingleton).


-- Kostya

27.03.2011 20:36, Mark Murphy пишет:

My point was that you should not have:

class MySingleton {
 Context thisIsAReallyBadIdea;

 MySingleton(Context ctxt) {
 thisIsAReallyBadIdea=ctxt;
 }

 // rest of class here
}

Instead, you should have:

class MySingleton {
 Application thisIsMildlyDisconcertingButProbablyOK;

 MySingleton(Application ctxt) {
 thisIsMildlyDisconcertingButProbablyOK=ctxt;
 }

 // rest of class here
}

In other words, use Java's type safety to ensure that you are caching
an object with the appropriate lifetime, and that you are using it as
the object with the appropriate lifetime.



--
Kostya Vasilyev -- http://kmansoft.wordpress.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


Re: [android-developers] Re: Storing Context vs Passing As Parameter Where Needed

2011-03-27 Thread TreKing
On Sun, Mar 27, 2011 at 10:58 AM, Kostya Vasilyev kmans...@gmail.comwrote:

 Any Singleton, manager, or utility class can take Context as a parameter
 for the functions it needs it for, making it clear to the user of the API
 that a Context is needed for that functionality


 Sure, that's another way. I prefer to not do this, but coding style is a
 personal thing.


Word. I'm just curious to see if there are more practical reasons to use one
vs the other. In case I've been doing it wrong all along :-)

On Sun, Mar 27, 2011 at 11:17 AM, Mark Murphy mmur...@commonsware.com
 wrote:

  However, there are cases where a true global context is required, and
  passing a local Context as a parameter causes a leak.

 Agreed. That is covered by TreKing's Use it when you need to store
 a context in an object that lives longer than an instance of an activity or
 service, but don't want to leak that activity or service.


Just give credit where it's due, I was quoting Doug from the original
thread.


Thanks for the examples Mark.

-
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

Re: [android-developers] Re: Storing Context vs Passing As Parameter Where Needed

2011-03-27 Thread Kostya Vasilyev

27.03.2011 21:14, TreKing ?:
On Sun, Mar 27, 2011 at 10:58 AM, Kostya Vasilyev kmans...@gmail.com 
mailto:kmans...@gmail.com wrote:


Any Singleton, manager, or utility class can take Context as a
parameter for the functions it needs it for, making it clear
to the user of the API that a Context is needed for that
functionality


Sure, that's another way. I prefer to not do this, but coding
style is a personal thing.


Word. I'm just curious to see if there are more practical reasons to 
use one vs the other. In case I've been doing it wrong all along :-)


One could argue that some singleton/manager/utility needing a Context to 
do its work is an implementation detail of that class, and therefore 
should be exposed as little as possible.


One could also argue that this style requires that for a new class of 
that kind, you either make all methods take a Context parameter right 
away, which may not be necessary, or add it only to those methods that 
need it, which may change over time, causing an unnecessary interface 
change, which in turn can possibly trigger more code changes, because 
callers now need to provide a context reference where they didn't before.


But I'm not going to make any such arguments, because they border on 
religious, worshiping The Mighty Gods of True Object Oriented 
Programming, whoever they are, and I'm just not very interested in that :)


--
Kostya Vasilyev -- http://kmansoft.wordpress.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] detect usb connected/disconnected event

2011-03-27 Thread Károly Holczhauser
Hi all!

 I had read in a lot of forum it is a problem to developers to write a
program witch can detect the connected / disconnected USB event. Here is my
solution:

Manifest.xml :

receiver android:name=.MyReceiver
intent-filter
action android:name=android.intent.action.ums_connected
/
/intent-filter
/receiver

Myreceiver:

public class MyReceiver extends BroadcastReceiver{
if (intent.getAction().equalsIgnoreCase(
android.intent.action.UMS_CONNECTED)) {...}
}


bye:Károly Holczhauser from Hungary

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

[android-developers] how create a video with byte array

2011-03-27 Thread Danilo Veras
I searched and not found how to do this. I do download a video and read the 
bytes through InputStream.

someone know or have any idea of how do ?


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 to capture key events from View subclass

2011-03-27 Thread Dianne Hackborn
Correct the IME does not send you raw keyboard events.  It may not even
*have* raw keyboard events.  Consider a handwriting IME, for example.  That
is why the interaction with it is through InputConnection.  Every
interaction you can have with the IME is basically through InputConnection.

Note that on a soft keyboard, it *will* make calls on to InputConnection for
each key pressed, to tell you about the text that should now be shown.

On Sun, Mar 27, 2011 at 2:24 AM, Rich E reakina...@gmail.com wrote:

 Harsh, this doesn't make any sense.  You are suggesting that implementing
 onKeyDown will cause onTouchEvent to receive touches from the keyboard? That
 is not right. Also, the touches are not in my view, they are in the global
 keyboard.

 From what I have found in other posts, onKeyDown/Up does not fire when
 pressing individual keys on the soft keyboard, only for the hard.  Why this
 is so is unclear to me, but that is what I am experiencing.

 The only solution I have found so far is not a favorable one, subclass
 EditText and call 
 addTextChangedListenerhttp://developer.android.com/reference/android/widget/TextView.html#addTextChangedListener(android.text.TextWatcher)
  with
 my own TextWatcher.

 On Thu, Mar 24, 2011 at 11:49 PM, harsh chandel 
 harshdchan...@gmail.comwrote:

 ok you have to write the code for on key down
 and each time the key is pressed on soft keyboard you capture the event
 and do whatever you  want to do with on press event
 @Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
_active = false;
}

  this was what i was talking about


 On Thu, Mar 24, 2011 at 5:56 PM, Rich E reakina...@gmail.com wrote:


 On Tue, Mar 22, 2011 at 6:14 PM, harsh chandel 
 harshdchan...@gmail.comwrote:

 try ontouch method
 get x and y coordinate   of the area clicked
 and do as you want on the clicked event


 harsh chandel, I am not sure that I understand you.. I am using
 onTouchEvent() to trigger the keyboard (imm.showSoftInput() code in my last
 post)... but I cannot get the pressed keys of the keyboard.  As it is not my
 keyboard (it is the system shared keyboard), I cannot re-implement any
 onTouchEvent method that it may hold, unless I am missing something in your
 suggestion.

 There must be some event that I need to listen to (onKeyUp for the soft
 keyboard keys..), but I don't yet know how.

 Thanks for the help,
 Rich



  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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: Two functions Button?

2011-03-27 Thread Dixi
package org.dixit.com

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;


public class ChangeTextValue extends Activity {
/** Called when the activity is first created. */
private int i = 1;
private TextView txt;
@Override

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

txt = (TextView)findViewById(R.id.TextView01);
Button btn = (Button)findViewById(R.id.Button01);

   btn.setOnClickListener(new View.OnClickListener()
{
public void onClick(View view)
{
if(i%2==0)
{
txt.setText(hello Dixit);
i++;
}

else
{
txt.setText(hello Gabriel);
i++;
}

}
});


}
}


hey buddy.. use this logic its working on my system. for this u run
this code and i hope its working on your system.


On Mar 27, 9:25 pm, Gabriel gab...@gmail.com wrote:
 It's not working Dixie. Can you put this code more clear?

 On 27 mar, 13:09, Dixi dixitwadhw...@gmail.com wrote:







  use the even-odd logic.. like

  int i=1;
  button.onclick()
  {
         if(i%2==0)
           {
               ///operation...
               i++;
           }

          else
         {
                //operation
                i++;
         }

  }

  i think u  got it...
  i hope it works

  -
  Regards
  Dixit Wadhwani

  On Mar 27, 8:55 pm, Gabriel gab...@gmail.com wrote:

   How I create a button with two functions?
   For example, when I click it once it starts a sound, and if I click it
   again it stops the sounds.

   Or a Mute button, that when I click it mutes all the sounds and change
   the imagebutton for a mute off image and if I click it again the
   sound returns.

   I appreciate any help. Thanks

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


Re: Fwd: [android-developers] Re: Regarding screen resolution

2011-03-27 Thread Nicholas Johnson
Please read the link I posted in my original comment. It'll tell you where 
to go from there.

Nick

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Fetching messages from a server

2011-03-27 Thread Kevin Anthony
Thanks, that did the trick

On Sat, Mar 26, 2011 at 12:32 PM, Mark Murphy mmur...@commonsware.com wrote:
 On Sat, Mar 26, 2011 at 12:24 PM, Kevin Anthony
 kevin.s.anth...@gmail.com wrote:
 I have an application that needs to fetch messages from a server,
 currently i do this via a service, running in the background.
 However, when my application is not in the foreground, it quickly gets
 pushed out of memory, and stops checking for messages.

 This is a good thing. An everlasting service like this is an
 anti-pattern and should be avoided wherever possible.

 I've been playing with AbstractThreadedSyncAdapter, but this seems a
 little heavy handed.

 Could be -- I haven't had a chance to mess with that yet.

 Is there some middle ground?  Something i should look into?

 Use AlarmManager and fetch the messages on a periodic basis, with the
 user controlling the polling frequency (including an option for
 manual-refresh-only) via a SharedPreference.

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://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



-- 
Thanks
Kevin Anthony
www.NoSideRacing.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: Specifying textAppearance using a custom attribute

2011-03-27 Thread Mark Carter
I found out the problem: The LayoutInflater had been retrieved from the 
Application context and not an Activity context and so the theme had not 
been applied...

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

[android-developers] custom dialog frame - how to get a pointy triangle edge

2011-03-27 Thread Nick Longinow
Like a balloon-style dialog, with one side of the dialog having a
triangle coming out of it so that the dialog appears to point to some
portion of the screen.  I've seen these in alot of apps - what is the
basic idea here?  Is it use of shapes and themes?  Any simple examples
out there?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: custom dialog frame - how to get a pointy triangle edge

2011-03-27 Thread Hari Edo

If you mean like the SMS app, you can do that with a .9.png
image file, also called a Nine Patch.

http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch

On Mar 27, 10:34 pm, Nick Longinow nicklongi...@gmail.com wrote:
 Like a balloon-style dialog, with one side of the dialog having a
 triangle coming out of it so that the dialog appears to point to some
 portion of the screen.  I've seen these in alot of apps - what is the
 basic idea here?  Is it use of shapes and themes?  Any simple examples
 out there?

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


[android-developers] How to make Secure SDCard

2011-03-27 Thread spurwa
Please help,

Anyone know how to make secure SDCard as Secure Element in Android ?
Can We use ADB Shell ?

thanks,
SGP

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


[android-developers] Re: How to access files in sdcard from the server running in android

2011-03-27 Thread SREEHARI

Hi,

Please help me on this. I am not getting any idea to resolve this.

Regards,
Sreehari.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: display image from net

2011-03-27 Thread Oscar
that's fine, Does the ssl use user/password?

On Mar 26, 3:49 am, Robin Talwar r.o.b.i.n.abhis...@gmail.com wrote:
 welll i have solved dis one now i am using following code

         Bitmap bitmap = null;
         InputStream in = null;
         try {

               URL url = new URL(URL);
               URLConnection conn = url.openConnection();
              /* HttpsURLConnection cone = url.*/
               conn.connect();
               in = conn.getInputStream();
             bitmap = BitmapFactory.decodeStream(in);
             in.close();
         } catch (IOException e1) {
             // TODO Auto-generated catch block
             e1.printStackTrace();
         }
         return bitmap;

 But the problem occuring is dat my url is https and it is giving me an ssl
 error

 On Sat, Mar 26, 2011 at 2:06 PM, Abhishek Talwar 







 r.o.b.i.n.abhis...@gmail.com wrote:
  this may be more like a java question

  I just want to display an image placed on server onto my imageView

  The following is the code which m using :--

         ImageView iv;
     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
         iv=(ImageView)findViewById(R.id.iv);
         String stringURL = https://graph.facebook.com/618306968/
  picture?access_token +
                 =103931556876|6ad1235e03c6472b20430aad-618306968|
  cDUe563_MNfHUeUiTpqqh8mB0o8;

         InputStream is = null;
         BufferedInputStream bis = null;
         Bitmap bmp = null;

          try {
              URL url = new URL(stringURL);
              URLConnection conn = url.openConnection();
              conn.connect();
              is = conn.getInputStream();
              bis = new BufferedInputStream(is);
              bmp = BitmapFactory.decodeStream(bis);

               } catch (MalformedURLException e) {

                 } catch (IOException e) {

                   }catch (Exception e) {

                      } finally {
     try {
         if( is != null )
             is.close();
         if( bis != null )
             bis.close();
     } catch (IOException e) {

     }
  }
  iv.setImageBitmap(bmp);

     }

  I am not getting any error but also my imageview is empty and is not
  showing anything

  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, 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] Re: Open GL texture is shown on emulator but not on the mobile

2011-03-27 Thread Oscar
Did you tried in another device, maybe could be some problem with this
device

On Mar 26, 2:54 am, MobileVisuals eyv...@astralvisuals.com wrote:
 My resources are in the res\drawable-nodpi directory. It is a PNG
 image with 256*256 size. Shouldn't that be enough?

 On Mar 25, 10:34 pm, String sterling.ud...@googlemail.com wrote:







  Make sure your textures are power of two dimensioned. The emulator doesn't 
  care, but most real devices do.

  String

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


Re: [android-developers] Re: Regarding screen resolution

2011-03-27 Thread Dianne Hackborn
I strongly recommend you use android:targetSdkVersion=4 (or higher), so
you don't need to do anything with supports-screens.  And consider just
making your android:minSdkVersion=4 -- there are few enough 1.5 devices
around these days to be worth worrying about for a new app.

On Sun, Mar 27, 2011 at 9:38 AM, Laxmi Verma
laxmiverma.andr...@gmail.comwrote:


 Hi,


 I had make entry of support-screens tag in the AndroidManifest.xml, but
 the header which i customized is stil not coming in proper format.

 Please help!!
 Thanks!!

 -- Forwarded message --
 From: Nicholas Johnson metthejohn...@gmail.com
 Date: Sun, Mar 27, 2011 at 9:58 PM
 Subject: [android-developers] Re: Regarding screen resolution
 To: android-developers@googlegroups.com
 Cc: Laxmi Verma laxmiverma.andr...@gmail.com


 Different screen resolutions started to get support in API Level 4 (1.6).
 So, I recommend using API Level 4 and then reading the documention on the
 Android Dev 
 sitehttp://developer.android.com/guide/practices/screens_support.html.
 It's really good.

 Nick

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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




-- 
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: display image from net

2011-03-27 Thread Robin Talwar
i dont think so i am just trying to show the user's facebook dp on my
application when he logs into facebook using dialog interface.

I have read the facebook sdk for android and i am able to fetch all data
from user profile

To get the image from the net i have to get the image from following link :-
https://graph.facebook.com/*USERID*/picture?

and this is where i am stuck

i dont think so that i require any username or password it is just something
in coding .


On Mon, Mar 28, 2011 at 9:57 AM, Oscar oscar...@gmail.com wrote:

 that's fine, Does the ssl use user/password?

 On Mar 26, 3:49 am, Robin Talwar r.o.b.i.n.abhis...@gmail.com wrote:
  welll i have solved dis one now i am using following code
 
  Bitmap bitmap = null;
  InputStream in = null;
  try {
 
URL url = new URL(URL);
URLConnection conn = url.openConnection();
   /* HttpsURLConnection cone = url.*/
conn.connect();
in = conn.getInputStream();
  bitmap = BitmapFactory.decodeStream(in);
  in.close();
  } catch (IOException e1) {
  // TODO Auto-generated catch block
  e1.printStackTrace();
  }
  return bitmap;
 
  But the problem occuring is dat my url is https and it is giving me an
 ssl
  error
 
  On Sat, Mar 26, 2011 at 2:06 PM, Abhishek Talwar 
 
 
 
 
 
 
 
  r.o.b.i.n.abhis...@gmail.com wrote:
   this may be more like a java question
 
   I just want to display an image placed on server onto my imageView
 
   The following is the code which m using :--
 
  ImageView iv;
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  iv=(ImageView)findViewById(R.id.iv);
  String stringURL = https://graph.facebook.com/618306968/
   picture?access_token +
  =103931556876|6ad1235e03c6472b20430aad-618306968|
   cDUe563_MNfHUeUiTpqqh8mB0o8;
 
  InputStream is = null;
  BufferedInputStream bis = null;
  Bitmap bmp = null;
 
   try {
   URL url = new URL(stringURL);
   URLConnection conn = url.openConnection();
   conn.connect();
   is = conn.getInputStream();
   bis = new BufferedInputStream(is);
   bmp = BitmapFactory.decodeStream(bis);
 
} catch (MalformedURLException e) {
 
  } catch (IOException e) {
 
}catch (Exception e) {
 
   } finally {
  try {
  if( is != null )
  is.close();
  if( bis != null )
  bis.close();
  } catch (IOException e) {
 
  }
   }
   iv.setImageBitmap(bmp);
 
  }
 
   I am not getting any error but also my imageview is empty and is not
   showing anything
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, 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


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: totally 2d

2011-03-27 Thread Dianne Hackborn
Something to be aware of -- if you are running on a Tegra 2 class device
like the Xoom, you will almost certainly need hardware accelerated drawing
for any kind of decent performance.  This is due to a combination of the
screen having many more pixels than most existing phones, and the Tegra 2
CPU lacking support for the NEON instruction set (which Android's software
drawing code can use to improve its rendering speed and is available on most
ARM CPUs Android had previously run on).

Now, you could try implementing your drawing code with Canvas so it can be
accelerated by Android 3.0.  This will require getting your hands on a real
Xoom or other upcoming tablet hardware to test on.  It also probably still
won't give you as good of performance as using OpenGL ES directly, though it
may be a lot easier to implement for 2d stuff.

(Some background -- the number of pixels on the screens of the devices
Android runs on has generally been growing significantly faster than the CPU
and bus speeds.  This has made the limitations of software rendering
increasingly noticeable.  The Tegra 2 tablets are basically the point where
this came to a head, and required that the 2d drawing API be hardware
accelerated in order to get acceptable performance.)

On Sun, Mar 27, 2011 at 4:09 AM, Nicholas Johnson
metthejohn...@gmail.comwrote:

 Bob,

 I recently released a game (actually just this week, called Prism or
 Prism Light by Shadowpuppets), which doesn't use OpenGL at all. I just
 draw onto the canvas from my overrided onDraw method, and then invalidate
 only the part of the view which contains animation. I have determined that
 the drawing portion is the bottleneck for me (i.e. all the physics
 calculations and the rest of the game engine have no effect on the
 framerate). For your reference, I have an original Motorola Droid and I
 generally get around 60 frames per second of animation. During beta testing,
 other users with more advanced phones got upwards of 100 frames per second
 (I actually had to put a frame rate limiter in my game to keep it at 60 fps
 max).

 *However!* This is my experience only and is unique to my game. If you
 download and play the free version, then you'll notice that my game board
 only takes up about 2/3 of the screen (and that is the *only* part of the
 screen which can be animated in my game). Furthermore, the performance
 increased drastically when I clipped the regions of the screen which didn't
 contain any animation. For example, my worst possible case scenario was
 needing to animation something in the top left corner and the bottom right
 corner at the same time. This causes the entire view to be redrawn and
 results in my worst frame rate scenario. In this case, the frame rate
 dropped to around 40 or 45 fps. At any other time, when the clipped region
 didn't take up the entire game board the frame rate increased upwards and
 past 60 fps (of note: even though the region was clipped, I still drew all
 the animations to the canvas, even if they were totally outside the clipped
 region. This didn't seem to affect the increased frame rate -- that is, it
 mostly depended on what actually gets pushed out to the screen buffers). So,
 it varies, but overall I got acceptable performance.

 Also, depending on what devices you target, there are other options. For
 instance, if you're just targeting Honeycomb then you can enable hardware
 acceleration for your view with only the addition of 1 line of Java code
 (see the Developer's Guide recent Blog on the subject).

 I haven't tried using OpenGL for my game, because overall I didn't need it.
 I was prepared to try, but I found that drawing my 2D animated game onto a
 view's canvas was sufficient for my purposes. I hope that this gives you the
 perspective you were looking for.

 Nick

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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