Re: [android-developers] Re: integrate twitter in my app

2010-11-04 Thread Prajakta Shitole
Have you checked the below link??

http://www.mobisoftinfotech.com/blog/android/1089/

http://www.mobisoftinfotech.com/blog/android/1089/Thanks,
Prajakta

On Wed, Nov 3, 2010 at 10:55 PM, Babita kumari
babita.permeat...@gmail.comwrote:


   Anyone , please reply

   thanks

  Babita



  On Thu, Nov 4, 2010 at 9:39 AM, Babita kumari 
 babita.permeat...@gmail.com wrote:


 In my app , on Button click , I want to show twitter login page . Can any
 one tell me by posting some code snippets, how to do that ? I am using
 Twitter4J  as library for this.
 Its very urgent . Please any one reply soon...

 thanks

 Babita


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

Re: [android-developers] integrate twitter in my app

2010-11-04 Thread Nicholas Campion
On Thu, 2010-11-04 at 09:39 +0530, Babita kumari wrote:
 
 In my app , on Button click , I want to show twitter login page . Can
 any one tell me by posting some code snippets, how to do that ? 

I had to remove twitter4j from my app as Twitter recently moved to
forcing oAuth login.  You can read about oAuth authentication at
http://dev.twitter.com/pages/auth#at-twitter and you should be able to
simply use a webview beyond that.

This, of course, presumes you want to tweet for the user.  Otherwise,
you could simply use a webview.

Nick


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

2010-11-04 Thread Kumar Bibek
Go for Custom dialogs by extending the Dialog class. That should help you.

On Thu, Nov 4, 2010 at 4:02 AM, dashman erjdri...@gmail.com wrote:

 i've got an AlertDialog (here's a snippet)

 AlertDialog.Builder builder.setPositiveButton(OK, new
 DialogInterface.OnClickListener()
{
public void onClick(DialogInterface
 dialog, int id)
{
   ???.findViewById(R.id.code);
}
 }

 once the user clicks ok - i'd like to get a value of the control
 within
 the dialog (my layout)

 because of scoping i can't user builder or the alertdialog.

 how can i get the value of the control from within the onClick()




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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] CAN'T CONNECT MY ANDROID MOBILE PHONE TO MY MAC SYSTEM TO RUN MY APPLICATION.

2010-11-04 Thread Kumar Bibek
This is strange. Which device do you have?

On Wed, Nov 3, 2010 at 1:18 AM, Josiah umajos...@yahoo.co.uk wrote:

 Hello Developers,
 I would be glad if someone could help me by telling me how i can
 connect my android mobile phone to my mac system to debug and test my
 applications on my mobile device. I do have the debuggable set to true
 and my phone USB Debugging enabled, yet when i plug in my phone using
 the USB cable, my applications do not run on the phone, they still run
 on the emulator and when run ./ adb devices on the terminal, my device
 doesnt show up. I'm really worried about this, could anyone please
 tell me how to solve this problem, as i read that you do not need to
 install drivers for MAC OS. Thanks

 Josiah.

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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] Finding the View that has current focus

2010-11-04 Thread Kumar Bibek
At best, you can get notified when a view gains or loses focus. Every view
class has this focus changed listener.

On Thu, Nov 4, 2010 at 5:00 AM, Neilz neilhorn...@gmail.com wrote:

 As the topic says, I want to find a way of getting hold of the View
 that currently has focus. So this may be a TextView, if the user is
 typing something, or I suppose it may be nothing (if that's possible).

 Is there a way I can detect this?

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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] Issues with httppost: Authentication challenge is empty

2010-11-04 Thread Kumar Bibek
Well, your webservice docs should tell you how to authenticate. Once you are
sure of the mechanism, it should work.

On Wed, Nov 3, 2010 at 6:25 PM, Nick nacht...@gmail.com wrote:

 Hey everyone,

 I'm developing an Android app which needs to perform an HTTPPost to
 get a token back. Then use that token for subsequent calls.  When I
 perform the initial call to get the token, it throws an exception:

org.apache.http.auth.MalformedChallengeException: Authentication
 challenge is empty

 Here is my code:

DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.getCredentialsProvider().setCredentials(new
 AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT), new
 UsernamePasswordCredentials(username, password));

HttpPost httppost = new HttpPost(authenticationURL);
httppost.addHeader(app_key, app_key);

String strResponse = ;
try {
 HttpResponse response = httpclient.execute(httppost);  ---
 exception thrown here
 HttpEntity entity = response.getEntity();

 if (entity != null) {
  InputStream instream = entity.getContent();
  strResponse = convertStreamToString(instream);
  instream.close();
 }

 JSONObject jObject=new JSONObject(strResponse);
 wrapAccessToken = jObject.getString(wrap_access_token);
 } catch (ClientProtocolException e) {
   e.printStackTrace();
 } catch (IOException e) {
   e.printStackTrace();
 } catch (JSONException e) {
   e.printStackTrace();
 }

 I googled Authentication challenge is empty, and one this website:

 http://fmpwizard-scala.posterous.com/using-apache-httpclient-authentication-in-sca
 he had a similar problem.  He determined that his web server requires
 preemptive authentication.  Which I believe ours does too.  I tried
 implementing what he did, and still, no dice.

 I've hard coded the token in other requests, and I am able to perform
 HTTPGet calls.

 What am I doing wrong?   What is the Authentication Challenge that I'm
 missing?

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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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: Failure to connect to camera service.

2010-11-04 Thread shani
Did you ever figure this out? I can't and it's driving me crazy. Thanks,
shani


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


[android-developers] Problem with Playing sound in my cuckoo clock widget

2010-11-04 Thread tina lincon
Hi all,
I am currently trying to create a cuckoo clock widget in which I am
facing problem with updating the pendulum sound each secondMy
pendulum has to keep on ticking each second with sound effects
integrated.
I am doing update every second  and I am able to play the sound using

mPlay = MediaPlayer.create(context, R.raw.chime);
mPlay.start();


 But after about 30 seconds, the sound stops playing giving the log
error as follows:


E/AudioTrack( 2106): AudioFlinger could not create track, status: -12
E/AudioSink( 2106): Unable to create audio track
E/VorbisPlayer( 2106): mAudioSink open failed


Then again the same sound starts playing after a pause of  about 20
seconds instead of getting played each second.It continues in
this
fashion of playing the sound file for some seconds, then to the pause
state and then again playing from startThis problem doesnt come
into picture when I'm trying to update the sound on hourly basis for
my hourly chime because in that case only once every hour this sound
is played, same is the case for updation every minuteThis problem
arises only for updating the sound each second Wat is the reason
behind this delay??Can anyone please help me regarding this? Please do
help if anyone got an idea regarding this.Thanks in advance.
Regards,
Tina Lincon


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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 update my database with an xml hosted on a website?

2010-11-04 Thread Vitaliy Tarasenko
public void updateDatabase(){
XmlPullParser parser = Xml.newPullParser();
try{
InputStream stream = getInputStream();
parser.setInput(stream, null);
int eventType = parser.getEventType();
//parse xml
//write data to database

}catch(Exception e){
Log.e(omg,+e.getMessage());
}
}

private InputStream getInputStream() {
try {
final String xmlDataUrl=http://path/data.xml;;
URL feedUrl = new URL(xmlDataUrl);
return feedUrl.openConnection().getInputStream();
} catch (Exception e) {
Log.d(omg,+e.getMessage());
throw new RuntimeException(e);
}
}

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

2010-11-04 Thread Mark Murphy
On Wed, Nov 3, 2010 at 9:33 PM, Bret Foreman bret.fore...@gmail.com wrote:
 The background threads are in IntentServices

IntentService already has and uses a background thread and is not
designed to fork other threads.

 If I use createPendingResult in the
 calling Activity then I end up with a PendingIntent object, which does
 not fit into the startService method that kicks off the IntentService.

It is Parcelable. Put it in an Intent extra.

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

Android 2.2 Programming Books: http://commonsware.com/books

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


[android-developers] Re: What are some good Automated Unit And System Test Tools for Android?

2010-11-04 Thread Greg Giacovelli
Robotium is a black box test kit though. So while I am sure it's
useful, I find that things like selenium and UI blackbox testing
becomes rather hard to maintain on a changing live product where the
design of the UI is under constant iterations.

I think I have something that seems to be meeting my needs.
I have Hudson setup to build my test Project whenever any changes
happen in my repo.

It calls the coverage target on a modified ant build script that I
made from basically looking at how the sdk constructed it's build.xml
template. It's semi documented how to do this, but basically you end
up copy and pasting the entire contents of the appropriate template
into your build file and setting the flag import=false on the setup
tag included by default.

Then since you can make custom changes at this point, I swapped out
adb in the build script to use a custom adb wrapper wherever adb is
called. This wrapper simply execs adb and interprets the success or
failure of the command by reading stdout and returns a non 0
resultcode if it detects an error in the output. Then I found this,
https://github.com/jsankey/android-junit-report, which you can use
instead of the standard test runner and it will generate ant junit xml
reports on the device for you (Really freakin convenient). I stash the
resultcode of the test run, download the reports (emma, and junit xml)
and then interpret the resultcode.

Hudson later treats the emma report as a build artifact and publishes
the reports in a nice fashion integrated with the SCM. It seems to be
a pretty simple setup for running suites of unit tests through a
device. Much thanks to jsankey again for that tiny but awfully useful
bridge. I think I might extend this to include parsing out the
performance stuff (ddmlib seems to have some stuff for this as well)
and submit that back.

-Greg
On Nov 3, 1:33 pm, MarcoAndroid marco...@gmail.com wrote:
 This tool could be useful (integrates with Maven so should integrate
 with Hudson):http://code.google.com/p/robotium/
 I still have it on my list as to look into :)

 On 3 nov, 07:20, Greg Giacovelli miyamo...@gmail.com wrote:







  So I give in. I approached this problem as an oh hey that's not too
  bad, I can write a bunch of unit tests, and I have been keeping my
  suite green. However as things get more involved continuous
  integration and testing is a great great thing to have. And then I saw
  oh Android has emma integration as well awesome ... and then that's
  where it get's iffy.

  So I setup Hudson and have it call the coverage target of the ant
  build.xml that the android executable in the sdk can generate. And
  then it hits me.

  adb -s emulator shell am instrument -w ...

  will never return a result code that is not 0 ... because adb
  technically exited cleanly and usually will regardless of how the
  shell command that executed did.

  So again I say, Oh that's not too bad, I can just wrap adb with a
  parser that parses output for errors and return a non 0 resultcode to
  fail my build if a test fails. Problem is then I also want to see what
  tests fail. I know eclipse is doing something smarter so I dig deeper
  and find the extra switches you can pass am instrument including the -
  r flag.

  adb -s emulator shell am instrument -r -w ...

  Now this is starting to get complicated as the output gets more
  complex and this originally thought simple task is getting more
  intense. As this SDK is maturing more I have to think, someone has
  endured this pain and made a kickass way to automate and report on
  these sdk tools and output. Like something complete with performance
  test tracking, code coverage reporting etc. These outputs all exit in
  the SDK but they just have to be adapted to the tools used outside. I
  have to think after a year or two this adapter(s) has to have been
  written. However I have only been able to find blackbox testing
  frameworks and not anything along the lines of regression test suite
  automation of the whitebox sort.

  Any suggestions welcome.

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


[android-developers] Re: Overriding Back Button Action in Activity

2010-11-04 Thread tanmay....@gmail.com
Thanks for the suggestions.
But no result
Waiting for  a logic to implement it.

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


[android-developers] creating of explicit Accounts but with no Syncing involve

2010-11-04 Thread mikedroid
I need to create our own account and we do not need the syncing
attached to it , so is there a way to just create an explicit account
without the Sync service since i really don't need it we are going to
implement our own, in fact the contacts source is messed up in this
api . 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] ListView.setOnItemClickListener() fails to catch selection events for custom list items

2010-11-04 Thread Filip Havlicek
Hi Bob,

since you are using ListActivity, you can override onListItemClick instead
of creating new OnItemClickListener. More information here

http://developer.android.com/reference/android/app/ListActivity.html#onListItemClick(android.widget.ListView,
android.view.View, int, long)

That should fix your problem.

Best regards,
Filip Havlicek

2010/11/4 FractalBob ruom...@gmail.com

 I thought I knew how to catch list selection events in Android and
 then I regained consciousness. In my situation, I have a ListView that
 I populate with a custom view, all of the same class (let's call it
 the NewsChannel() class). NewsChannel consists of a LinearLayout of
 ImageViews and TextViews. When the list is displayed, the user may
 select a NewsChannel item in the list; I want to find out which list
 item was selected.

 Also, I registered an onClickListener to one of the TextViews and that
 works fine: when the text is clicked on, an activity is launched which
 is looking for the position of the NewsChannel item in the list.

 So, here's what my code looks like:

 1. Registering the onClickListener in the ListActivity:

 public class NewsListActivity extends ListActivity
 {
.
.
.
public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
setContentView(R.layout.news_list_format);

ListView lv = getListView();

lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView? parent, View view,
int position, long id) {
  // When clicked, show a toast with the TextView text
item_index = position;
  Toast.makeText(getApplicationContext(), item clicked =
  + position, Toast.LENGTH_SHORT).show();
}
  });

.
.
.
 2. The layout for the ListView associated with NewsListActivity:

 ?xml version=1.0 encoding=UTF-8?
 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
 android
android:orientation=vertical
android:layout_width=fill_parent
android:layout_height=fill_parent
android:background=@drawable/wpaper_tile

ListView android:id=@id/android:list
android:layout_width=fill_parent
android:layout_height=fill_parent
android:layout_alignParentTop=true
android:dividerHeight=15dp
android:divider=@android:color/transparent
android:cacheColorHint=@android:color/transparent
android:scrollbars=none
/
FrameLayout
android:layout_width=fill_parent
android:layout_height=55dp
android:layout_centerHorizontal=true
android:layout_alignParentBottom=true
android:background=#8800
/
ImageView
android:layout_width=fill_parent
android:layout_height=wrap_content
android:layout_centerHorizontal=true
android:layout_alignParentBottom=true
android:src=@drawable/phonetop_bg
/
 /RelativeLayout

 3. The NewsChannel layout:

 ?xml version=1.0 encoding=UTF-8?
 RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
 android
android:layout_width=fill_parent
android:layout_height=wrap_content

include layout=@layout/news_heading_format
android:id=@+id/news_heading_header/

ImageView android:id=@+id/news_channel_image
android:layout_width=88dp
android:layout_height=66dp
android:layout_alignParentLeft=true
android:layout_below=@id/news_heading_header
android:padding=10dp /

TextView android:id=@+id/news_channel_text
android:lines=4
android:inputType=textMultiLine
android:layout_toRightOf=@id/news_channel_image
android:layout_below=@id/news_heading_header
android:layout_width=fill_parent
android:layout_height=wrap_content/
 /RelativeLayout

 When I run the app, the ItemClickListener is never called. However, if
 NewsChannel were of a simpler type, say, a single ImageView or
 TextView embedded in the layout, the callback does get called.

 Any idea what I'm doing wrong? My whole goal is simply to let the
 activity launched by NewsChannel (not shown) to find out which
 instance of NewsChannel it was launched from. 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.comandroid-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 

[android-developers] Re: Changelog in Market!

2010-11-04 Thread mort
On 3 Nov., 15:03, TreKing treking...@gmail.com wrote:
 If it were searchable, people would just use it as an extension to their app
 description to add more stuff people might search for to find their app.

Not only that, it might also confuse results. A changlog often
includes some internals which don't directly matter for the main
features, e.g. an improved contact selection in some SMS or social
network app doesn't make it a contact manager...

For better search results, the Market would rather need keywords
(where possible with internal thesaurus) and some more space for
descriptions. And of course better search possibilities at all, like
looking for something in a certain category and hiding the 325 apps
from that spammer...

 I'm pretty sure this is deliberate so people use it as intended - add a
 description of what changed for the people that care: your current users
 that don't need to find your app.

Exactly. As a new user, I won't like to read the entire changelog to
get an idea if the app's what I might desire.

  But what is it with 325 ? I'm sure that's not a power of 2 is it ?
 My guess: they hardcoded 325 in several thousand different place and now, if
 they use ANYTHING else, the world will implode.

Maybe it's some kind of internal joke, like 23 or 42... Or they just
didn't quite make it to 333 (half evil ;)).
I would've made it 640, because 640 should be enough for everybody,
right? ;)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: color banding. can't get over it :(

2010-11-04 Thread Hatch
Great

Your reply gives me hope :)

But can you provide me with more information on how to do it ?

I have a gradient alpha png.
I just use it in imageView inside an XML resource.
I don't set the dither option (although have tried both true and false
options with same result)
And I get the bands.

Do I need to draw the image by hand, and which API must I use in that
case ?

Regards,

Hatch


On Nov 4, 1:19 am, Adam Hammer adamhamm...@gmail.com wrote:
 It get's banded because Android automatically decodes images based on
 your screen, and not based on the actual image. Why decode a 2048x2048
 image when it's showing on a 800x480 screen. This I assume is to save
 cpu cycles and speed up image decoding where it normally will not have
 a issue.

 When you are doing compositing though it does make a difference, and
 you need to be specific as to how you want the image decoded.

 Like I said before, you need to manually define your options to ensure
 it uses ARGB_ when decoding the image, disable dithering and
 scaling.

 Do this and you will no longer have banding.

 Adam

 On Nov 2, 1:01 am,Hatchtomislav.hecimo...@gmail.com wrote:







  Yes, Thank you for your replies.

  I have read the article but it doesn't explain why alpha enabled
  resource get's banded :(

  Is there a way to know exactly which RGB is used in the png ?

  BTW the dither option didn't work in the XML nor in the code.

  On Oct 30, 2:04 am, Lance Nanek lna...@gmail.com wrote:

   I saw an interesting article on avoiding this the other 
   day:http://android.nakatome.net/2010/04/bitmap-basics.html

   On Oct 29, 7:01 pm,Hatchtomislav.hecimo...@gmail.com wrote:

Seems my original post (ugly pngs...) somehow disappeared :(
nvm.

I have a problem with a png resource that has gradient fade-out alpha.

The png looks great in the emulator, but displays an artefact known as
color banding (http://en.wikipedia.org/wiki/Colour_banding)

Has anyone surpassed this issue ?

My designer wants to trop a shadow behind his icons, and that's where
the bands appear.

What are my options ?

Thanks

   Hatch

BTW is there any way to see all my posts here on google groups ?

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


[android-developers] Device name ?

2010-11-04 Thread Hatch
Is there a way to get/set a generic device name ?

My app will offer the user an option to use the same app on several
devices and they will be aware of each other through server.

1) Is there anything in the APIs to allow me to fetch some kind of
friendly device name (cannot be OS/model since user might have the
same on both devices) ?

2) AFAICT the only option is to use Bluetooth name but how can I fetch
my device name in code ?
 (and it's a nag do explain the user to use bluetooth just to set the
name of the device)

Regards,

Hatch

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: ContextMenu/AlertDialog with footer view (to add checkbox for 'make default' option)

2010-11-04 Thread Mathias Lin
Adding an additional item with setCheckable(true) doesn't work, since
checking the checkbox also closes the dialog. Therefore the simplest
way I came up with is to use an AlertDialog and add a CheckedTextView
via alert.getListView().addFooterView(...); and overriding it's
onItemSelected method.

Would be great though if a standard context menu would also offer this
by default already.



On Nov 4, 1:48 pm, Mathias Lin m...@mathiaslin.com wrote:
 Is there a standard way to add a footer to a context menu, in which I
 can add a checkbox to make the selected option the default one? Similar
 to the context menu that comes up when choosing the default home screen
 for example.

 http://i.imgur.com/B2wvC.png

  From the Api docs for ContextMenu I see that you can set a header view,
 but not a footer view. Same for the AlertDialog, also only has a
 setCustomTitle() method, but nothing for the footer.

 Does this need to be done via a custom (alert) dialog? I would be
 wondering if nobody has yet developed such a component yet in case it's
 not possible through the standard SDK api. Any standalone open source
 component out there (beside the Android source code itself)?

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


[android-developers] iOS UI Patterns Bleeding into Android apps

2010-11-04 Thread Richard Leggett
Twitter for Android is an excellent app, but the lastest update shows
how a lot of iOS UI patterns are bleeding over to Android apps,
potentially confusing things.

To note a couple:

1. Pull down ListView (beyond top) to refresh.
2. Swipe finger across a ListView row to bring up actions/edit.

First of all, iOS has some extremely well thought at and sensible UI/
UX patterns, many of them designed to get around the limitation of
having one physical button (always needing a back button on screen, no
menu key and so on).

The danger here is that as Android developers we don't have this stuff
built into the SDK, if you've tried to implement iOS's overshoot/
elastic ScrollViews which are purported to be coming to Gingerbread,
you'll know how much extra work this can be, and potentially how
brittle that might make code, especially if this particular feature is
going to be built in.

In response to the numbered points above, what about Android's click
list view header to scroll to top, and what about the long-press for
bringing up actions/options for an item. TweetDeck is one of the best
examples of Android done right IMHO, fully embracing a lot of the
design and interaction guidelines that are beginning to emerge.

Are we going to confuse users by having an Android way to do things
mixed in with an iOS way to do things?

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

2010-11-04 Thread bagelboy
I'm considering which markets to sell my apps in and I would like to
get the opinions of other developers.

Other than the android market which markets do you sell your apps in
and which ones have you had success? Have you seen any changes to the
rate of sale in these other markets since the android market expanded
to other countries?

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

2010-11-04 Thread Mathias Lin
How do you know that onConfigurationChanged is never called? Are you
overriding it and logging something there? Can you post the code of
that. Did you make sure you're using the correct method signature /
using @Override ?


On Nov 4, 10:45 am, darrinps darri...@gmail.com wrote:
 I have an activity with onConfigurationChanged in it. I also have the
 manifest set up like this:

 activity android:name=.MySplashActivity
                           android:configChanges=orientation|keyboardHidden
                   android:label=@string/app_name
             intent-filter

 I thought that when the phone was rotated so that the landscape layout
 kicks in, that onConfigurationChanged would get called but it does
 not!

 I do see in the log though this:

 11-03 21:38:59.788: INFO/ActivityManager(2259): Config changed:
 { scale=1.0 imsi=310/410 loc=en_US touch=3 keys=1/1/2 nav=1/1 orien=2
 layout=34}

 I am certain that onConfigurationChanged is not getting called (have
 log statements and the debugger set...just never happens).

 So what am I doing wrong?

 Thanks!

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


[android-developers] Re: Device name ?

2010-11-04 Thread Mathias Lin
You could use the SubscriberId / IMSI, but it cannot be detected with
all SIM cards, depends on the SIM card. Or you can use the IMEI, the
device id:

TelephonyManager mTelephonyMgr = (TelephonyManager)
context.getSystemService(Context.TELEPHONY_SERVICE);
String imei = mTelephonyMgr.getDeviceId();

But it's just a number, nothing really 'user friendly'.


On Nov 4, 4:36 pm, Hatch tomislav.hecimo...@gmail.com wrote:
 Is there a way to get/set a generic device name ?

 My app will offer the user an option to use the same app on several
 devices and they will be aware of each other through server.

 1) Is there anything in the APIs to allow me to fetch some kind of
 friendly device name (cannot be OS/model since user might have the
 same on both devices) ?

 2) AFAICT the only option is to use Bluetooth name but how can I fetch
 my device name in code ?
  (and it's a nag do explain the user to use bluetooth just to set the
 name of the device)

 Regards,

 Hatch

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

2010-11-04 Thread Kostya Vasilyev
There are user-friendly strings in Build.OS, but they are not unique to a
particular device, only to all devices having the same make / model.

Perhaps you could let the user customize the name in your application, using
strings from Build.OS as a default / starting point.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

04.11.2010 12:26 пользователь Mathias Lin m...@mathiaslin.com написал:

You could use the SubscriberId / IMSI, but it cannot be detected with
all SIM cards, depends on the SIM card. Or you can use the IMEI, the
device id:

TelephonyManager mTelephonyMgr = (TelephonyManager)
context.getSystemService(Context.TELEPHONY_SERVICE);
String imei = mTelephonyMgr.getDeviceId();

But it's just a number, nothing really 'user friendly'.



On Nov 4, 4:36 pm, Hatch tomislav.hecimo...@gmail.com wrote:
 Is there a way to get/set a gener...

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

2010-11-04 Thread Hatch
Yup,

Already investigated both approaches and none fit our model.

But now I know that there's nothing I can do.

Thank you for your replies.

On Nov 4, 10:39 am, Kostya Vasilyev kmans...@gmail.com wrote:
 There are user-friendly strings in Build.OS, but they are not unique to a
 particular device, only to all devices having the same make / model.

 Perhaps you could let the user customize the name in your application, using
 strings from Build.OS as a default / starting point.

 --
 Kostya Vasilyev --http://kmansoft.wordpress.com

 04.11.2010 12:26 пользователь Mathias Lin m...@mathiaslin.com написал:

 You could use the SubscriberId / IMSI, but it cannot be detected with
 all SIM cards, depends on the SIM card. Or you can use the IMEI, the
 device id:

 TelephonyManager mTelephonyMgr = (TelephonyManager)
 context.getSystemService(Context.TELEPHONY_SERVICE);
 String imei = mTelephonyMgr.getDeviceId();

 But it's just a number, nothing really 'user friendly'.

 On Nov 4, 4:36 pm, Hatch tomislav.hecimo...@gmail.com wrote:







  Is there a way to get/set a gener...

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


[android-developers] Adding table row by inflating does not take table's settings

2010-11-04 Thread Hatch
Hi all.

I have a table layout with a few predefined rows in it.
Each row has only two columns.

Now I need to dynamically add additional rows in it.

I have two problems:

1) When programmatically inflating, I cannot set the index of the
newly created row (I want it in place 'n')
2) After inflation, the inserted (actually appended) row doesn't
listen to parent table's stretch column property.

So here are my questions:

q1) Can I set the place where to insert the inflated row
programatically ?
q2) Why doesn't the new row inflate properly (the second column is not
shown because the first column doesn't contains a TextView with
fill_parent.

In the end I need the first column to occupy 80% of the screen width,
and the second column remaining 20%.

q3) is that doable with programmatic row insertions ?


Regards,

Hatch

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

2010-11-04 Thread Marcin Orlowski
 There is only a message saying that installation failed, no reason
 nothing.

Most common installation failure cases are: a) APK is corrupted, b)
app is already installed while you try to install it from new APK (so
you in fact upgrading) but upgrade is not signed with the same key.
Any of these 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] Setting the font of a WebView

2010-11-04 Thread Neilz
I have my own font TTF files, and want to use them in a WebView.

Is this possible?

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


Re: [android-developers] Setting the font of a WebView

2010-11-04 Thread Marcin Orlowski
On 4 November 2010 11:23, Neilz neilhorn...@gmail.com wrote:
 I have my own font TTF files, and want to use them in a WebView.
 Is this possible?

And what is the reason you did not checked that yourself in the
first place?

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

2010-11-04 Thread Pent
 looking for something in a certain category and hiding the 325 apps

Very good :-)

Pent

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

2010-11-04 Thread Neilz
I'm sorry, is that an answer?

On Nov 4, 10:26 am, Marcin Orlowski webnet.andr...@gmail.com wrote:
 On 4 November 2010 11:23, Neilz neilhorn...@gmail.com wrote:

  I have my own font TTF files, and want to use them in a WebView.
  Is this possible?

 And what is the reason you did not checked that yourself in the
 first place?

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


[android-developers] PreferenceActivity - Multiple preferences

2010-11-04 Thread Alex
Is it possible to use the PreferenceActivity and PreferenceScreen to
manage multiple instances of preferences fro a single app?  It seems
that they store preferences as default preferences only.

I would like to use a PreferenceScreen as my configure activity for an
AppWidget, but I need to be able to store distinct preferences for
each widget.

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

2010-11-04 Thread MarVel
Thanks a lot for the help and suggestions, which definitely guided me
to the solution of my VerifyError problem.
I just want to share the solution in case someone else encounters the
same problem, which appeared to be very simple - I only needed to move
the variables' definition outside of the method, i.e.,

**Original definition (when the VerifyError
occurred):**

public class PEModelOR extends BayesNet {
public PEModelOR() {
name = PEModelOR;
..
final DiscreteVariable DB =
new DiscreteVariable (DB,
DiscreteVariable.CHANCE,
new String[] { yes,no });
..

 /some functions calling the above variables/
   }
}

*Solution:**

public class PEModelOR extends BayesNet {

..
final DiscreteVariable DB =
new DiscreteVariable (DB,
DiscreteVariable.CHANCE,
new String[] { yes,no });
..

   public PEModelOR() {
name = PEModelOR;
 /some functions calling the above variables/
   }
}

In such a way, I was even able to extend my model, which now includes
112 variables and 112 functions, all defined before the method
PEModelOR().

Cheers, MarVel

On Oct 14, 12:13 am, fadden fad...@android.com wrote:
 On Oct 13, 9:42 am, MarVel marina.velik...@gmail.com wrote:

  10-12 16:50:15.291: WARN/dalvikvm(4848): VFY: arbitrarily rejecting
  large method (regs=134 count=17618)
  ...
  I saw that in a recent 
  discussionhttp://groups.google.com/group/android-developers/browse_thread/threa...
  Dirk has encountered the same problem but unfortunately I could not
  see any solution to that.

 This test is going away in a future release.

 The method has 17,618 instructions, and requires 134 registers.  Both
 of these are on the large side.  If you can find a way to break the
 method into pieces that should help.

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


[android-developers] Re: Off market sales and LVL

2010-11-04 Thread Alex
That's fine, but as the owning dev, I'd like to be able to manually
license an instance of my app, through the developer console for
example.

On Nov 3, 5:48 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 LVL relies on the Market app to work. This is actually an important security
 feature.

 --
 Kostya Vasilyev --http://kmansoft.wordpress.com

 03.11.2010 19:53 пользователь keyeslabs keyes...@gmail.com написал:

 Solving this very problem is going to be really important for Android
 Devs.  With multiple viable markets, each with their own DRM
 solutions, managing the builds for a smallish Android app is getting a
 bit ridiculous.  There's room for innovation here in the form of a
 layer above all of the different DRM offerings associated with the
 various markets.  Been down that road though, and it is a thankless
 job worth approximately $0.  :)

 On Nov 3, 10:20 am, Alex maroeb...@gmail.com wrote:



  If I sell a copy of a LVL controlled app ou...- Hide quoted text -

 - Show quoted text -

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


[android-developers] Re: Remembering Shared Preferences

2010-11-04 Thread sisko
Really sorry my message was not very detailed. I'm learning Androis
and so I confused about a number of things.

PLEASE - download my small sample app from here :
http://www.icerge.com/sites/default/files/TriviaQuiz.rar

When you start the app you will see the View Scores screen, hit the
menu button and select settings.
The settings activity is where the problem is.

Now, the nickname EditText is where the problem is. As I understand
it, when you enter text and hit return, the code is supposed to check
if
GAME_PREFERENCES_NICKNAME is set. If it isn't, it is set in the
SharedPreferences and if it was previously set output it into the
EditText box.

So, I enter a nickname and hit return but the text reverts to INPUT
NICKNAME which was the temporaying in EditText label.
Also, when I press menu and settings again, my previous entry is not
in the EditText box as I expect it to be.

The code is in QuizSettingsActivity.java, the SharedPrefernces
information is set in QuizActivity.java and the layout is
settings.xml.

I would really appreciate your help. I am a bit lost.

Thanks.


On Nov 2, 9:47 pm, TreKing treking...@gmail.com wrote:
 On Tue, Nov 2, 2010 at 4:34 PM, sisko adeod...@gmail.com wrote:
  The problem is, when I revisit the activity, the EditView never contains
  the text I input the last time.

 What do you mean when you revisit? What are the steps involved in the
 problem you're seeing?

  I actually contains the above TextView content and I can't then edit it.

 What TextView? Can't edit what? The EditText or this TextView?

   I know that's not really clear but does anyone have any ideas to help with
  seting and retrieving shared preferences properly ??

 Check to make sure your value exists somewhere else in your code and just
 write it out to the log to make sure.

 -
 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] sectionindexer is not updated when adapter's data is changed

2010-11-04 Thread manigault
Hi all , I have ListView with adapter class which extends ArrayAdapter
and implements SectionIndexer. The problem is section indexer is not
updated when adapter data is changed. Even if i add new elements the
section remain the same. I tried some options
setFaseScrollEnabled(false);
setFaseScrollEnabled(true);
but i got IndexOutOfBounds exception. So how can i update
sectionIndexer when adapter's data is changed.

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

2010-11-04 Thread William Ferguson
Dianne, have you stepped back from this position? I hope so.

While I understand and agree that #onTerminate is not an option,
Application#onCreate is very useful.
I typically use it to kick off async events that I want to to occur
each time the app is started.
By tying it to Application#onCreate instead of to an Activity, I'm not
twisted into knots by the Activity lifecycle.

An example is to fetch the latest updates for the app from some web
site.
Its not critical when or even how opften it occurs, it just needs to
occur and App#onCreate is the logical place.

On a side note the standard Java implemetation of the singleton
pattern (ie as a stateful static) has been on the outer for most of
the last decade.
IMO it was one of the reasons that made Spring dependency injection so
attractive (along with clear config). Objects need lifecycle, the
clearer and more dependable the better.

William


On Nov 1, 4:07 am, Dianne Hackborn hack...@android.com wrote:
 That said, my recommendation to everyone is to just not subclass
 Application.  This gives you *nothing* you can't do in other, better ways.
  In particular, a singleton directly represents what is really going on (it
 lives for the life of the process after the first need for it) and helps
 keep code more modular.

 I regret that the Application class was ever introduced; it was a compromise
 to make people more comfortable with there being some kind of traditional
 main application concept, but in fact it doesn't really fit in with how
 Android works so ends up just causing problems.

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


[android-developers] Re: listview selector based on item-type

2010-11-04 Thread Johannes De Smedt
I have looked, but I don't seem to see a solution. I have successfully
implemented a list with 2 types of items, but I can set the
listSelector only for the whole list. Not for each type of items...

On 3 nov, 17:42, Kumar Bibek coomar@gmail.com wrote:
 Yes you can. Look for examples where ListViews can show multiple view types.

 On Wed, Nov 3, 2010 at 10:10 PM, Johannes De Smedt 



 johannes.desm...@gmail.com wrote:
  Hi,

  In my application I have a list with 2 types of items. For the first
  type I can use the default selector drawn behind the content, but for
  the second type I would need another selector that is drawn in front
  of the content.

  Can this be done in android?

  The reason why I need another selector, is because the second type is
  an image that fills the whole cell. Therefore the default selector is
  not visible. When I draw the selector in front of the image, the
  images is not visible. Therefor I would like a transparent selector
  for those items, and keeping the default one for the other ones.

  Other suggestions are also welcome!

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

 --
 Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.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: Overriding Back Button Action in Activity

2010-11-04 Thread kernelpanic
http://developer.android.com/reference/android/app/Activity.html#onBackPressed()

?


On Nov 4, 2:33 am, tanmay@gmail.com tanmay@gmail.com
wrote:
 Thanks for the suggestions.
 But no result
 Waiting for  a logic to implement it.

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


[android-developers] Re: Can we catch android.intent.action.ACTION_UMS_CONNECTED event

2010-11-04 Thread karteek
Yes i registered receiver in the code instead of manifest file.
But problem is whenever if my activity is closed i need to unregister
it.
But  my requirement is it needs to be listen for that event.
Why it not working if we are declared in AndroidManifest file.
Any help.
Regards,
Karteek

On Nov 3, 6:36 pm, Pent tas...@dinglisch.net wrote:
  I want to show some notification when android phone is connected to system.
  I implemented BroadcastReceiver for listening to event
  android.intent.action.ACTION_UMS_CONNECTED  in my application
  But it is not working.
  Is it possible to capture this event

 Yes, though if I remember right some users have mentioned it doesn't
 work on some configurations.

 If you're using a manifest-declared receiver, maybe try creating one
 at runtime instead (that's what my app does).

 Pent

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

2010-11-04 Thread Marcin Orlowski
On 4 November 2010 11:35, Neilz neilhorn...@gmail.com wrote:
 I'm sorry, is that an answer?

No. The answer is laziness. Since WebView can understand CSS
and CSS have the way to set the fonts checking if that works
in this implementation would take much less than wasting the
time to write that mail.

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


[android-developers] Fwd: Not getting expected socket errors

2010-11-04 Thread Ram

We are still experiencing this issue in Ver 2.2. Is any one from the
Android Team comments on this issue?

-- Forwarded message --
From: gymshoe gyms...@bresnan.net
Date: Nov 2 2008, 10:55 am
Subject: Not getting expected socket errors
To: Android Developers


I think I have a closely related problem.

I launch one emulator running a server program (with appropriate port
redirections) and one emulator running a client. The client is able to
successfully  make connections to the server.
Then I end the server program on the emulator, but do not kill the
emulator.
The client continues making active connections to the server emulator
without the server program running!!!

When I end the server program, I have made sure to close the server
sockets and even verified that the server thread on the server
emulator was killed using .isAlive()=false.  I have also tried
programming this without using any threads, but rather executing the
server directly from the main activity (.onCreate()), and then finally
closing the sockets and calling this.finish() to kill the server
activity totally - again with no change in the problem. The client
continues to make connections to the emulator...

If I launch the client emulator alone, it does not make any
connections.  If I launch the client emulator in conjunction with a
second emulator which has had appropriate port redirection (i.e.
telnet localhost 5554; redir add tcp:5000:7000) but has not
executed the server android program, I do not get spurious
connections.  The problem occurs only when the server android program
has been run once.  Once the program has been run, it seems to stay
resident on the emulator until the emulator is killed.

Any insight into this bizarre behavior would be appreciated.
Jim

On Oct 30, 8:31 pm, cor...@gnu.org (James E. Blair) wrote:







 Normally in TCP socket programming, if the remote end closes the
 connection, the local program is notified by a return value (in C) or
 an exception (in Java).  But in Android, if I terminate the remote end
 of a socket connection while transmitting data, no exception is
 thrown, and no error reported.  Is this a bug, or is there something
 about socket programming in Android I'm missing?

 Here's some sample Android code to demonstrate.  If you run

     $ netcat -l -p 1234

 It will receive the test transmissions, but if you kill netcat, the
 Android app keeps running without printing a stack trace, indicating
 no exception has been thrown.

     Socket socket = null;
     OutputStream os = null;
     try {
         socket = new Socket(10.0.2.2, 1234);
         os = socket.getOutputStream();
     } catch (UnknownHostException e) {  
         e.printStackTrace();
     } catch (IOException e) {
         e.printStackTrace();
     }

     while (true) {
         try {
             Log.i(test, test);
             os.write(test\n.getBytes());
             os.flush();
         } catch (IOException e) {
             e.printStackTrace();
         }
     }

 And a standard Java app.  If you kill netcat while this is running,
 you'll receive the expected SocketException.

     public class SocketTest {
          private static Socket mSocket;
          private static OutputStream mOS;

          public static void main(String[] args) throws IOException {
              try {
                  mSocket = new Socket(127.0.0.1, 1234);
                  mOS = mSocket.getOutputStream();
              } catch (UnknownHostException e) {
                  e.printStackTrace();
              }

              while (true){
                  System.out.println(test);
                  mOS.write(test\n.getBytes());
                  mOS.flush();
              }
          }
     }

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Problem with turning off GPS updates when application goes into the background.

2010-11-04 Thread loweroctave
I was having a good deal of problems with the location listener
starting / not starting / restarting when I didn't want it too
(especially on Captivate phones) and it was further exacerbated by
having multiple activities in my application.  I ended up creating an
android service to control the GPS portion of things.  When you bind
to the service you can get all the GPS data you need from it.

You may want to try this method.

On Nov 3, 5:03 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
 Strange...
 When starting/stopping in onResume/onPause, it works well for me.
 Do you have, by chance any other location listeners registered?
 Try to make a bare-bones app with only one activity that just
 registers and unregisteres a location listener. See if that works.

 On Nov 3, 2:25 pm, Chirag Patel chi...@gmail.com wrote:







  Thanks for the response but it didn't help. Calling
  locationManager.removeUpdates(this);  causes the GPS icon to stop
  flashing so it does have some affect but it doesn't remove/stop it
  completely. When I put the application in the background and I leave
  it, I can see it's using up the cpu and battery due to the GPS being
  active. There are no other threads running in the app. This is very
  frustrating! Another problem which might be somehow related is that
  calling finish() on my Activity doesn't close it. If intercept the
  back button and call finish() the app goes into the background but the
  activity remains alive i.e when I go back to it, it doesn't start a
  new instance just resumes the old one. Any help on this would be much
  appreciated.. Thanks!

  On Nov 2, 10:45 pm, Streets Of Boston flyingdutc...@gmail.com wrote:

   Get the LocationManager in onCreate(). Store this in an instance-
   variable.
   Request location updates in onResume(), using the instance-variable.
   Remove location updates in onPause(), using the instance-variable.

   On Nov 2, 2:10 pm, Chirag Patel chi...@gmail.com wrote:

Hi I'm having a problem when trying to stop location updates when the
app goes into the background. In my onCreate() method I start request
updates like this:

                LocationManager locationManager =
(LocationManager)context.getSystemService(Context.LOCATION_SERVICE);

                
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
LOCATION_UPDATE_INTERVAL, LOCATION_UPDATE_DISTANCE, this);

locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,
LOCATION_UPDATE_INTERVAL, LOCATION_UPDATE_DISTANCE, this);

Then in my onPause() and onDestroy() methods I request to stop the
updates like this:

                LocationManager locationManager =
(LocationManager)context.getSystemService(Context.LOCATION_SERVICE);
                locationManager.removeUpdates(this);

However the GPS icon remains in the status bar and the only way to get
rid of it is to manually kill the application. Am I doing anything
wrong?

Cheers- Hide quoted text -

  - Show quoted text -

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


[android-developers] Re: VerifyError: arbitrarily rejecting large method

2010-11-04 Thread DanH
Yep, the Dalvik compiler attempts to assign a register to every
local variable in the method.  It should be able to handle that many,
but apparently can't.  By making them instance variables you remove
the compiler's need/desire to manage them (and also make the method
a fair amount smaller).

On Nov 4, 5:51 am, MarVel marina.velik...@gmail.com wrote:
 Thanks a lot for the help and suggestions, which definitely guided me
 to the solution of my VerifyError problem.
 I just want to share the solution in case someone else encounters the
 same problem, which appeared to be very simple - I only needed to move
 the variables' definition outside of the method, i.e.,

 **Original definition (when the VerifyError
 occurred):**

 public class PEModelOR extends BayesNet {
         public PEModelOR() {
         name = PEModelOR;
 ..
 final DiscreteVariable DB =
 new DiscreteVariable (DB,
 DiscreteVariable.CHANCE,
 new String[] { yes,no });
 ..

      /some functions calling the above variables/
    }

 }

 *Solution:**

 public class PEModelOR extends BayesNet {

 ..
 final DiscreteVariable DB =
 new DiscreteVariable (DB,
 DiscreteVariable.CHANCE,
 new String[] { yes,no });
 ..

    public PEModelOR() {
         name = PEModelOR;
      /some functions calling the above variables/
    }

 }

 In such a way, I was even able to extend my model, which now includes
 112 variables and 112 functions, all defined before the method
 PEModelOR().

 Cheers, MarVel

 On Oct 14, 12:13 am, fadden fad...@android.com wrote:

  On Oct 13, 9:42 am, MarVel marina.velik...@gmail.com wrote:

   10-12 16:50:15.291: WARN/dalvikvm(4848): VFY: arbitrarily rejecting
   large method (regs=134 count=17618)
   ...
   I saw that in a recent 
   discussionhttp://groups.google.com/group/android-developers/browse_thread/threa...
   Dirk has encountered the same problem but unfortunately I could not
   see any solution to that.

  This test is going away in a future release.

  The method has 17,618 instructions, and requires 134 registers.  Both
  of these are on the large side.  If you can find a way to break the
  method into pieces that should help.

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

2010-11-04 Thread Kumar Bibek
May be you can try settings selectors to individual list items then. Set the
selector to the background of the item's layouts.

On Thu, Nov 4, 2010 at 4:57 PM, Johannes De Smedt 
johannes.desm...@gmail.com wrote:

 I have looked, but I don't seem to see a solution. I have successfully
 implemented a list with 2 types of items, but I can set the
 listSelector only for the whole list. Not for each type of items...

 On 3 nov, 17:42, Kumar Bibek coomar@gmail.com wrote:
  Yes you can. Look for examples where ListViews can show multiple view
 types.
 
  On Wed, Nov 3, 2010 at 10:10 PM, Johannes De Smedt 
 
 
 
  johannes.desm...@gmail.com wrote:
   Hi,
 
   In my application I have a list with 2 types of items. For the first
   type I can use the default selector drawn behind the content, but for
   the second type I would need another selector that is drawn in front
   of the content.
 
   Can this be done in android?
 
   The reason why I need another selector, is because the second type is
   an image that fills the whole cell. Therefore the default selector is
   not visible. When I draw the selector in front of the image, the
   images is not visible. Therefor I would like a transparent selector
   for those items, and keeping the default one for the other ones.
 
   Other suggestions are also welcome!
 
   --
   You received this message because you are subscribed to the Google
   Groups Android Developers group.
   To post to this group, send email to
 android-developers@googlegroups.com
   To unsubscribe from this group, send email to
   android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@googlegroups.com
 
   For more options, visit this group at
  http://groups.google.com/group/android-developers?hl=en
 
  --
  Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] Changelog in Market!

2010-11-04 Thread YuviDroid
Yee! This is super cool! Now let's see what comes next...who knows...maybe
they'll add also a way to answer to user comments??? :D:D

On Wed, Nov 3, 2010 at 11:21 AM, String sterling.ud...@googlemail.comwrote:

 Got up this morning and went ahead with some planned releases to a
 couple of my apps. When I got into the app detail page on my Market
 Developer Console, I found a new section: Recent Changes! I pasted my
 changelog in, published my upgrade, and it's already appearing in the
 Market. Text in this box appears to just be appended to your
 description, under a heading of Recent changes:.

 More info from Google can be found here:
 http://market.android.com/support/bin/answer.py?answer=189724

 All I can say is, WOO HOO! It's about frackin' time!

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




-- 
YuviDroid
Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to
quickly access your favorite apps and contacts!)
http://android.yuvalsharon.net

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] How can I hide views when the soft keyboard is up?

2010-11-04 Thread paulb
Hello,

Maybe you want to add the attribute:

android:windowSoftInputMode=adjustPan

to your activity in the AndroidManifest

On Tue, Nov 2, 2010 at 7:43 AM, newobj new...@gmail.com wrote:
 I have a pretty standard search edit widget on top / search results
 list widget on bottom activity in my app. Below the results list
 widget I also have my view for ads. When the soft keyboard is brought
 up in this activity, I'd like to hide the view the ads are in because
 they consume too much screen space. I tried making that view
 android:isScrollContainer=true but that had no effect.

 So the question is, how can I ensure that certain views will be hidden
 when the soft keyboard is brought up?

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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: ListView.setOnItemClickListener() fails to catch selection events for custom list items

2010-11-04 Thread FractalBob
Thanks for your suggestion, Filip. I added the following to the
ListView:

public void onListItemClick (ListView l, View v, int position,
long id)
  {
  item_index = position;
  Toast.makeText(this, item clicked =  + position,
Toast.LENGTH_LONG).show();
  }
But it didn't get executed when I selected an item in the list (the
Toast never got displayed).

On Nov 4, 1:03 am, Filip Havlicek havlicek.fi...@gmail.com wrote:
 Hi Bob,

 since you are using ListActivity, you can override onListItemClick instead
 of creating new OnItemClickListener. More information here

 http://developer.android.com/reference/android/app/ListActivity.html#...,
 android.view.View, int, long)

 That should fix your problem.

 Best regards,
 Filip Havlicek

 2010/11/4 FractalBob ruom...@gmail.com







  I thought I knew how to catch list selection events in Android and
  then I regained consciousness. In my situation, I have a ListView that
  I populate with a custom view, all of the same class (let's call it
  the NewsChannel() class). NewsChannel consists of a LinearLayout of
  ImageViews and TextViews. When the list is displayed, the user may
  select a NewsChannel item in the list; I want to find out which list
  item was selected.

  Also, I registered an onClickListener to one of the TextViews and that
  works fine: when the text is clicked on, an activity is launched which
  is looking for the position of the NewsChannel item in the list.

  So, here's what my code looks like:

  1. Registering the onClickListener in the ListActivity:

  public class NewsListActivity extends ListActivity
  {
                         .
                         .
                         .
     public void onCreate(Bundle icicle)
     {
         super.onCreate(icicle);
         setContentView(R.layout.news_list_format);

         ListView lv = getListView();

         lv.setOnItemClickListener(new OnItemClickListener() {
             public void onItemClick(AdapterView? parent, View view,
                 int position, long id) {
               // When clicked, show a toast with the TextView text
                 item_index = position;
               Toast.makeText(getApplicationContext(), item clicked =
   + position, Toast.LENGTH_SHORT).show();
             }
           });

                         .
                         .
                         .
  2. The layout for the ListView associated with NewsListActivity:

  ?xml version=1.0 encoding=UTF-8?
  RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
  android
     android:orientation=vertical
     android:layout_width=fill_parent
     android:layout_height=fill_parent
     android:background=@drawable/wpaper_tile

     ListView android:id=@id/android:list
         android:layout_width=fill_parent
         android:layout_height=fill_parent
         android:layout_alignParentTop=true
         android:dividerHeight=15dp
         android:divider=@android:color/transparent
                 android:cacheColorHint=@android:color/transparent
         android:scrollbars=none
         /
     FrameLayout
         android:layout_width=fill_parent
         android:layout_height=55dp
         android:layout_centerHorizontal=true
         android:layout_alignParentBottom=true
         android:background=#8800
         /
     ImageView
         android:layout_width=fill_parent
         android:layout_height=wrap_content
         android:layout_centerHorizontal=true
         android:layout_alignParentBottom=true
         android:src=@drawable/phonetop_bg
         /
  /RelativeLayout

  3. The NewsChannel layout:

  ?xml version=1.0 encoding=UTF-8?
  RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
  android
     android:layout_width=fill_parent
     android:layout_height=wrap_content

     include layout=@layout/news_heading_format
         android:id=@+id/news_heading_header/

     ImageView android:id=@+id/news_channel_image
         android:layout_width=88dp
         android:layout_height=66dp
         android:layout_alignParentLeft=true
         android:layout_below=@id/news_heading_header
         android:padding=10dp /

     TextView android:id=@+id/news_channel_text
         android:lines=4
         android:inputType=textMultiLine
         android:layout_toRightOf=@id/news_channel_image
         android:layout_below=@id/news_heading_header
         android:layout_width=fill_parent
         android:layout_height=wrap_content/
  /RelativeLayout

  When I run the app, the ItemClickListener is never called. However, if
  NewsChannel were of a simpler type, say, a single ImageView or
  TextView embedded in the layout, the callback does get called.

  Any idea what I'm doing wrong? My whole goal is simply to let the
  activity launched by NewsChannel (not shown) to find out which
  instance of NewsChannel it was launched from. Thanks, in advance!

  --
  You received this message because you are subscribed to the Google
  Groups Android 

Re: [android-developers] Re: color banding. can't get over it :(

2010-11-04 Thread YuviDroid
This might help:
http://stuffthathappens.com/blog/2010/06/04/android-color-banding/


YuviDroid

On Thu, Nov 4, 2010 at 9:33 AM, Hatch tomislav.hecimo...@gmail.com wrote:

 Great

 Your reply gives me hope :)

 But can you provide me with more information on how to do it ?

 I have a gradient alpha png.
 I just use it in imageView inside an XML resource.
 I don't set the dither option (although have tried both true and false
 options with same result)
 And I get the bands.

 Do I need to draw the image by hand, and which API must I use in that
 case ?

 Regards,

 Hatch


 On Nov 4, 1:19 am, Adam Hammer adamhamm...@gmail.com wrote:
  It get's banded because Android automatically decodes images based on
  your screen, and not based on the actual image. Why decode a 2048x2048
  image when it's showing on a 800x480 screen. This I assume is to save
  cpu cycles and speed up image decoding where it normally will not have
  a issue.
 
  When you are doing compositing though it does make a difference, and
  you need to be specific as to how you want the image decoded.
 
  Like I said before, you need to manually define your options to ensure
  it uses ARGB_ when decoding the image, disable dithering and
  scaling.
 
  Do this and you will no longer have banding.
 
  Adam
 
  On Nov 2, 1:01 am,Hatchtomislav.hecimo...@gmail.com wrote:
 
 
 
 
 
 
 
   Yes, Thank you for your replies.
 
   I have read the article but it doesn't explain why alpha enabled
   resource get's banded :(
 
   Is there a way to know exactly which RGB is used in the png ?
 
   BTW the dither option didn't work in the XML nor in the code.
 
   On Oct 30, 2:04 am, Lance Nanek lna...@gmail.com wrote:
 
I saw an interesting article on avoiding this the other day:
 http://android.nakatome.net/2010/04/bitmap-basics.html
 
On Oct 29, 7:01 pm,Hatchtomislav.hecimo...@gmail.com wrote:
 
 Seems my original post (ugly pngs...) somehow disappeared :(
 nvm.
 
 I have a problem with a png resource that has gradient fade-out
 alpha.
 
 The png looks great in the emulator, but displays an artefact known
 as
 color banding (http://en.wikipedia.org/wiki/Colour_banding)
 
 Has anyone surpassed this issue ?
 
 My designer wants to trop a shadow behind his icons, and that's
 where
 the bands appear.
 
 What are my options ?
 
 Thanks
 
Hatch
 
 BTW is there any way to see all my posts here on google groups ?

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




-- 
YuviDroid
Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to
quickly access your favorite apps and contacts!)
http://android.yuvalsharon.net

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

2010-11-04 Thread TreKing
On Thu, Nov 4, 2010 at 6:01 AM, sisko adeod...@gmail.com wrote:

 PLEASE - download my small sample app from here :
 http://www.icerge.com/sites/default/files/TriviaQuiz.rar


Sorry, I don't have time for that.

Are you stepping through the debugger to see what's going on?
Are you sure you want to set the text value when the user clicks the
EditText and not, say, when the Settings screen is first started?

-
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: color banding. can't get over it :(

2010-11-04 Thread Rob Truxler
Hatch,

I investigated this issue myself yesterday!  My solution was pretty ugly,
I'll have to admit, but what I figured was that there's a color depth issue
when an ImageView is rendered over top something else. I ended up changing
my code so that the ImageView's parent would actually load the bitmap in and
draw it manually (in onDraw). So I had my ImageView in a RelativeLayout, so
I created a new class like this:

class MyRelativeLayout extends RelativeLayout {
...
  public void onDraw(Canvas c) {
if(img == null) {
  // lazily load the image
  this.img =
(BitmapDrawable)getContext().getResources().getDrawable(R.drawable.image);
  this.p = new Paint();
}
c.drawImage(this.img.getImage(),0,0,p);
  }

}

In my layout xml file, I had basically this:
MyRelativeLayout android:width=yourImageWidth
android:height=yourImageHeight android:background=# /

For my purposes I had to keep it as a RelativeLayout because I added other
children to it.. but if you really only need a single image, it doesn't need
to be a RelativeLayout object.

Anyway, I'm guessing there's a better work-around for decent alpha blending
between Views.

On Thu, Nov 4, 2010 at 9:35 AM, YuviDroid yuvidr...@gmail.com wrote:

 This might help:
 http://stuffthathappens.com/blog/2010/06/04/android-color-banding/


 YuviDroid


 On Thu, Nov 4, 2010 at 9:33 AM, Hatch tomislav.hecimo...@gmail.comwrote:

 Great

 Your reply gives me hope :)

 But can you provide me with more information on how to do it ?

 I have a gradient alpha png.
 I just use it in imageView inside an XML resource.
 I don't set the dither option (although have tried both true and false
 options with same result)
 And I get the bands.

 Do I need to draw the image by hand, and which API must I use in that
 case ?

 Regards,

 Hatch


 On Nov 4, 1:19 am, Adam Hammer adamhamm...@gmail.com wrote:
  It get's banded because Android automatically decodes images based on
  your screen, and not based on the actual image. Why decode a 2048x2048
  image when it's showing on a 800x480 screen. This I assume is to save
  cpu cycles and speed up image decoding where it normally will not have
  a issue.
 
  When you are doing compositing though it does make a difference, and
  you need to be specific as to how you want the image decoded.
 
  Like I said before, you need to manually define your options to ensure
  it uses ARGB_ when decoding the image, disable dithering and
  scaling.
 
  Do this and you will no longer have banding.
 
  Adam
 
  On Nov 2, 1:01 am,Hatchtomislav.hecimo...@gmail.com wrote:
 
 
 
 
 
 
 
   Yes, Thank you for your replies.
 
   I have read the article but it doesn't explain why alpha enabled
   resource get's banded :(
 
   Is there a way to know exactly which RGB is used in the png ?
 
   BTW the dither option didn't work in the XML nor in the code.
 
   On Oct 30, 2:04 am, Lance Nanek lna...@gmail.com wrote:
 
I saw an interesting article on avoiding this the other day:
 http://android.nakatome.net/2010/04/bitmap-basics.html
 
On Oct 29, 7:01 pm,Hatchtomislav.hecimo...@gmail.com wrote:
 
 Seems my original post (ugly pngs...) somehow disappeared :(
 nvm.
 
 I have a problem with a png resource that has gradient fade-out
 alpha.
 
 The png looks great in the emulator, but displays an artefact
 known as
 color banding (http://en.wikipedia.org/wiki/Colour_banding)
 
 Has anyone surpassed this issue ?
 
 My designer wants to trop a shadow behind his icons, and that's
 where
 the bands appear.
 
 What are my options ?
 
 Thanks
 
Hatch
 
 BTW is there any way to see all my posts here on google groups ?

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




 --
 YuviDroid
 Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget
 to quickly access your favorite apps and contacts!)
 http://android.yuvalsharon.net

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

Re: [android-developers] Re: Remembering Shared Preferences

2010-11-04 Thread Kostya Vasilyev
It seems that the place where you are trying to restore the value from a
Settings object is not the right place.

You placed it into the edit text's click handler, whereas it should be
outside of that - presumably, your onCreate function.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

04.11.2010 16:58 пользователь TreKing treking...@gmail.com написал:

On Thu, Nov 4, 2010 at 6:01 AM, sisko adeod...@gmail.com wrote:

 PLEASE - download my small sam...
Sorry, I don't have time for that.

Are you stepping through the debugger to see what's going on?
Are you sure you want to set the text value when the user clicks the
EditText and not, say, when the Settings screen is first started?

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

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

[android-developers] Auto-Fill Field

2010-11-04 Thread perumal316
Hi All,

I am creating my own app which will load a website upon starting. Now
I want to auto-fill the fields that will appear on the website.

Is this possible? How to I call the field through my app to fill up
with pre-determined data?

Thanks In Advance,
Perumal

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


[android-developers] Is there an easier way than using x y for multitouch

2010-11-04 Thread ArcDroid
Hello, I would like to have a an app where I can play a bunch of
buttons all at the same time using multitouch.  The only way I have
gotten it to work is using the touch method and testing for a bunch of
x,y coordinates.  Please let me know if there is an easier/nicer way!
Thanks
ArcDroid
http://www.arcdroid.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] color banding. can't get over it :(

2010-11-04 Thread Daniel Drozdzewski
On Sat, Oct 30, 2010 at 12:01 AM, Hatch tomislav.hecimo...@gmail.com wrote:
 Seems my original post (ugly pngs...) somehow disappeared :(
 nvm.

 I have a problem with a png resource that has gradient fade-out alpha.

 The png looks great in the emulator, but displays an artefact known as
 color banding (http://en.wikipedia.org/wiki/Colour_banding)

 Has anyone surpassed this issue ?

 My designer wants to trop a shadow behind his icons, and that's where
 the bands appear.

 What are my options ?


 Thanks

 Hatch

Did you try GradientDrawable instead of using PNGs?

Daniel

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

2010-11-04 Thread Neilz
I think my question is perfectly valid. In my implementation I wish to
use a TTF font file, not CSS.

showRestraint/

On Nov 4, 12:03 pm, Marcin Orlowski webnet.andr...@gmail.com wrote:
 On 4 November 2010 11:35, Neilz neilhorn...@gmail.com wrote:

  I'm sorry, is that an answer?

 No. The answer is laziness. Since WebView can understand CSS
 and CSS have the way to set the fonts checking if that works
 in this implementation would take much less than wasting the
 time to write that mail.

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


[android-developers] Lock Screen

2010-11-04 Thread perumal316
Hi All,

I found this site containing code snippets on enabling/disabling phone
lock.

http://smartandroidians.blogspot.com/2010/03/enabling-and-disabling-lock-screen-in.html

Is it possible to enable outgoing calls from the lock screen in
Android?

Now only emergency calls are allowed from the native lock screen.
Similarly user can access the last called calls and is able to call
out these few numbers. Can this be done?

Thanks in Advance,
Perumal

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


[android-developers] Shop Stats Beta Testers

2010-11-04 Thread songs
Hi,

I'm an Android developer who used to spend an embarrassing amount of
time obsessively hitting refresh on my Checkout orders page in order
to track the action for the day.  In order to get back to writing
apps, I basically abandoned them for the last few months in order to
write up something to help me track my sales -- Shop Stats.

I figured this might be useful for other developers and I've got it to
a point where it's ready for a closed beta (i.e. not completely
embarrassing to show a few other people).  The main goals are:

1) Show useful sales information
2) Provide analysis and suggestions
3) Help developers figure out where they stand relative to the
aggregate 'other', and how Market is doing overall

To highlight point 3, imagine something like the conversation on the
thread here happening across a wider section of sellers:
http://groups.google.com/group/android-developers/browse_thread/thread/f8d516e7301a0faf/b4a15d0e404c4a2a?q=sales+stats+lnk=ol;

If this interests you, go to http://shopstats.appspot.com to sign up
for a slot (it'll be http://www.shopstats.com after I get that domain
set up).  Beta user benefits include being more likely to have your
suggestions implemented.  :)

Thanks,
Steve

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

2010-11-04 Thread TreKing
On Wed, Nov 3, 2010 at 9:18 PM, acr acr...@gmail.com wrote:

 I'm just looking for the most efficient way to accomplish this. it only
 needs to be every second or so.


There are at least a couple of built-in Timer classes already, or you can do
the poor-man's timer and use a thread that sleeps. Play with it and see what
works best for you.

-
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] Auto-Fill Field

2010-11-04 Thread Kostya Vasilyev
There is a way to call application functions in Java from WebView's
JavaScript code. Application code needs to register an object with WebView,
which is then accessible from JavaScript.

--
Kostya Vasilyev -- http://kmansoft.wordpress.com

04.11.2010 17:27 пользователь perumal316 perumal...@gmail.com написал:

Hi All,

I am creating my own app which will load a website upon starting. Now
I want to auto-fill the fields that will appear on the website.

Is this possible? How to I call the field through my app to fill up
with pre-determined data?

Thanks In Advance,
Perumal

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

[android-developers] Re: Background music in android

2010-11-04 Thread songs
You can probably do what you want by wrapping your music start/stop
calls in a Service.

Regards,
Steve

On Nov 4, 2:31 pm, nena joy nenaj...@gmail.com wrote:
 Hi,

    I created an application.In that ,when one of the activity start
 background music too play.
 And when I go to next activity,sound playing not stopped.But when go to
 webview activity,music stopped.But I want to play it in that webview too.
 How it possible?

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

2010-11-04 Thread TreKing
On Wed, Nov 3, 2010 at 9:18 PM, acr acr...@gmail.com wrote:

 I'm just looking for the most efficient way to accomplish this. it only
 needs to be every second or so.


There are at least a couple of built-in Timer classes already, or you can do
the poor-man's timer and use a thread that sleeps. Play with it and see what
works best for you.

-
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] playing sound

2010-11-04 Thread TreKing
On Wed, Nov 3, 2010 at 11:08 PM, nena joy nenaj...@gmail.com wrote:

 Thanks for the help.


What help?


 But how create thread in background for playing sound?


Same way you create a thread in background for any other purpose. Check the
documentation and and use Google - there's a plethora of information on Java
threads.

-
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] getting control value from within a dialog

2010-11-04 Thread TreKing
On Thu, Nov 4, 2010 at 1:08 AM, Kumar Bibek coomar@gmail.com wrote:

 Go for Custom dialogs by extending the Dialog class.


This is overkill. You get the dialog object right in onClick, which you know
is an AlertDialog so you can cast it and call findViewById on that. No need
for a custom dialog.

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

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

[android-developers] Re: How different do the broadcast Intents need to be?

2010-11-04 Thread Bret Foreman
Dianne,

Let me back up and give more context. My Activity draws various
TextViews and other UI elements with data from a local SQLite
database. When it can't find the data it needs locally, it draws a
placeholder icon and generates a request to a web service for the
data. The interface to the web service is enclosed in an IntentService
which handles the background activity associated with the web service.
When the data comes back, the IntentService places it in the SQLite
database and generates a broadcast Intent back to the Activity, which
has registered a receiver to receive the Intent. The Intent includes a
tag so the Activity knows which UI element can now be drawn with local
data. This tag is held in an Extra Bundle inside the Intent.

This all works about 2/3 of the time. However, about 1/3 of the
messages are being lost somehow. No exceptions are being thrown and
there is no message in the logcat that seems associated with the
receiver dropping messages.

One added wrinkle is that my Activity encounters 10 UI elements where
local data is missing and so it generates 10 calls to the
IntentService in the space of a few milliseconds. 6 or 7 Intents are
returned and 3 or 4 are missing. The exact number returned varies
depending on the run. The entire process takes about 10 seconds.

My understanding from Mark Murphy is that this is expected behavior,
that Intents that look similar and arrive close by in time are
considered duplicates and one of them is dropped.

This behavior is not that hard to demonstrate in a test project so I
could generate a case in b.android.com if you think what's happening
is contrary to what should happen. It occurs to me that the Android
regression tests may not cover the case of multiple calls to the
IntentService spaced over a short period of time and sending back
multiple Intents. If you think the behavior I'm seeing is incorrect
then it sounds like there is a concurrency problem in the
sendBroadcast method of the IntentService. Maybe sendBroadcast is not
re-entrant?


On Nov 3, 8:15 pm, Dianne Hackborn hack...@android.com wrote:
 I can't even follow what you are doing.  First you were talking about
 broadcast receivers, now you are talking about Activity.createPendingResult.

 Could we back up and start with a high-level picture of what you are trying
 to accomplish?



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

2010-11-04 Thread Kumar Bibek
Well, It's definitely an overkill. But, if you look at it's extensibility,
it might suit you better.

Say, for example, here the value of the control we have is a number. The
layout might be a EditText, Slider or something else. If you do it thru the
Custom Dialog, you can easily change the Dialog's appearance, or extend it
later if you want, without changing your code all over.

But, again, it depends on your requirement. If you are sure that you would
not use this Dialog in more than one place, or you will not change the
implementation later, TreKing's method is the best solution.

On Thu, Nov 4, 2010 at 8:48 PM, TreKing treking...@gmail.com wrote:

 On Thu, Nov 4, 2010 at 1:08 AM, Kumar Bibek coomar@gmail.com wrote:

 Go for Custom dialogs by extending the Dialog class.


 This is overkill. You get the dialog object right in onClick, which you
 know is an AlertDialog so you can cast it and call findViewById on that. No
 need for a custom dialog.


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




-- 
Kumar Bibek
http://techdroid.kbeanie.com
http://www.kbeanie.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] iOS UI Patterns Bleeding into Android apps

2010-11-04 Thread TreKing
On Thu, Nov 4, 2010 at 4:03 AM, Richard Leggett
richard.legg...@gmail.comwrote:

 Are we going to confuse users by having an Android way to do things mixed
 in with an iOS way to do things?


No - we're going to confuse users by having 100,000 apps that look and do
things *slightly* differently.
I think you're reading too much into one app's update ...

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

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

[android-developers] Re: integrate twitter in my app

2010-11-04 Thread Brion Emde
I have a crappy example app that gives an approach to using OAUTH to
log into Twitter. It's open-source, on GitHub. The OAUTH part isn't
too bad. The rest of it is not something that you should rely on. It
lets you display your main timeline and post tweets. I've just never
gotten around to fixing up the app to make it better, but you should
find something in there that you can use.

You can find the source code here: https://github.com/brione/Brion-Learns-OAuth

Good luck!


On Nov 3, 9:09 pm, Babita kumari babita.permeat...@gmail.com wrote:
 In my app , on Button click , I want to show twitter login page . Can any
 one tell me by posting some code snippets, how to do that ? I am using
 Twitter4J  as library for this.
 Its very urgent . Please any one reply soon...

 thanks

 Babita

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

2010-11-04 Thread Bret Foreman
Tre,

If our primordial ancestors had stuck to the accepted design patterns
then we would still be living as slime on rocks. Variation is a good
thing, even if it breaks with standards. That's how evolution works.
If people create apps that are somehow more intuitive to use, they
will attract customers and the standards will change because, at the
end of the day, customers are the tail that wags this dog. Of course,
most pioneers get an arrow in the back but some find gold. We need to
make allowances for the mavericks if we want to make progress.

On Nov 4, 8:33 am, TreKing treking...@gmail.com wrote:
 On Thu, Nov 4, 2010 at 4:03 AM, Richard Leggett
 richard.legg...@gmail.comwrote:

  Are we going to confuse users by having an Android way to do things mixed
  in with an iOS way to do things?

 No - we're going to confuse users by having 100,000 apps that look and do
 things *slightly* differently.
 I think you're reading too much into one app's update ...

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

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


[android-developers] Re: best way to set up a timer for a game

2010-11-04 Thread acr
I ended up going the thread route and it is doing what I need, thanks
for the reply

On Nov 4, 10:59 am, TreKing treking...@gmail.com wrote:
 On Wed, Nov 3, 2010 at 9:18 PM, acr acr...@gmail.com wrote:
  I'm just looking for the most efficient way to accomplish this. it only
  needs to be every second or so.

 There are at least a couple of built-in Timer classes already, or you can do
 the poor-man's timer and use a thread that sleeps. Play with it and see what
 works best for you.

 -
 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: iOS UI Patterns Bleeding into Android apps

2010-11-04 Thread TreKing
On Thu, Nov 4, 2010 at 10:45 AM, Bret Foreman bret.fore...@gmail.comwrote:

 Variation is a good thing, even if it breaks with standards.


I agree. I was being mildly sarcastic :-)

-
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] Is it able to customize soft keyboard?

2010-11-04 Thread Bo Huang
Hi all,

   In my android application, I need number and letter  key in the same
view, not need number and letter switch key.
   for example let it looks like computer keyboard, Is it possible to do it?

Bo

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

2010-11-04 Thread TreKing
On Thu, Nov 4, 2010 at 5:46 AM, Alex maroeb...@gmail.com wrote:

 Is it possible to use the PreferenceActivity and PreferenceScreen to manage
 multiple instances of preferences fro a single app?  It seems that they
 store preferences as default preferences only.


http://developer.android.com/reference/android/preference/PreferenceManager.html#setSharedPreferencesName%28java.lang.String%29

Haven't used it, but seems promising.

-
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] Another back button question... soft keyboard related

2010-11-04 Thread Neilz
My app contains a page with a form, a long list of EditTexts.

If you're entering text and click the back button, the soft keyboard
is hidden. However different android versions behave in different
ways. My 2.2 device hides the keyboard, and that's it. My 1.5 device
hides the keyboard, and the 'back' onKeyDown/Up event is still
activated.

This is very tricky... for the 1.5 device I need to know if the
keyboard is being displayed when the back button is pressed, so that I
can capture the back event and stop it continuing (all I want is for
the keyboard to hide). But I've search all over this forum and there
doesn't appear to be a sure way of doing this.

Any suggestions?

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

2010-11-04 Thread YuviDroid
AFAIK, you cannot customize an existing soft keyboard...however you can
write your own.

On Thu, Nov 4, 2010 at 5:15 PM, Bo Huang huangbo...@gmail.com wrote:

 Hi all,

In my android application, I need number and letter  key in the same
 view, not need number and letter switch key.
for example let it looks like computer keyboard, Is it possible to do
 it?

 Bo

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




-- 
YuviDroid
Check out Launch-X http://android.yuvalsharon.net/launchx.php (a widget to
quickly access your favorite apps and contacts!)
http://android.yuvalsharon.net

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

2010-11-04 Thread dashman

i casted to Dialog - and works fine.

new problem - in the onClick() method if the value is invalid -
i don't want to close the dialog - but the dialog closes even
if i don't call dismiss().




On Nov 4, 11:26 am, Kumar Bibek coomar@gmail.com wrote:
 Well, It's definitely an overkill. But, if you look at it's extensibility,
 it might suit you better.

 Say, for example, here the value of the control we have is a number. The
 layout might be a EditText, Slider or something else. If you do it thru the
 Custom Dialog, you can easily change the Dialog's appearance, or extend it
 later if you want, without changing your code all over.

 But, again, it depends on your requirement. If you are sure that you would
 not use this Dialog in more than one place, or you will not change the
 implementation later, TreKing's method is the best solution.



 On Thu, Nov 4, 2010 at 8:48 PM, TreKing treking...@gmail.com wrote:
  On Thu, Nov 4, 2010 at 1:08 AM, Kumar Bibek coomar@gmail.com wrote:

  Go for Custom dialogs by extending the Dialog class.

  This is overkill. You get the dialog object right in onClick, which you
  know is an AlertDialog so you can cast it and call findViewById on that. No
  need for a custom dialog.

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

 --
 Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.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] touch highlight behavior in a ListView

2010-11-04 Thread Bret Foreman
The default touch highlight behavior in a ListView is that the text
starts as white on a black background and changes to white on an
orange background when a finger is placed on the item.

I'm using an ExpandableListView (ELV) which I've modified to include a
3rd level of list items. I see the expected touch highlight behavior
at the top level of the ELV, just as with a normal ListView. However,
I don't get any touch highlight behavior at the lower two levels.

I presume this behavior is supposed to happen in the OnTouchListener
for the selected View and that an ACTION_DOWN MotionEvent should
trigger the color change and an ACTION_UP should change it back.

It looks like I can call setBackgroundResource for the selected view
to set the orange background.

I have a few questions:

First, am I on the right track - changing the background in the
OnTouchListener?

Second, is there a pre-defined resource that matches the standard
orange color? If not, where can I find a Drawable that matches that
color?

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


[android-developers] image resolutions and scaling

2010-11-04 Thread ping
Hello,
In order to ensure that my app looks good on devices with different
screens I have to store my images (icons, etc,..) in the three folders
for ldpi, mdpi and hdpi so that android can scale the images, right?
Now how do i know which resolution the single pictures must have? For
example I have two images for a navigation bar. Now I store these
images for instance with size 60x60 in the hdpi folder which sizes
do i have to choose for the mdpi and the ldpi folder? how do I know
this?

greets

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


[android-developers] Fwd: Enlightenment needs NO ANNOUNCEMENT

2010-11-04 Thread Rocky
-- Forwarded message --
From: krishna kvskrishna2...@rediffmail.com
Date: Thu, Nov 4, 2010 at 10:16 PM
Subject: Enlightenment needs NO ANNOUNCEMENT
To: rkjhaw1...@gmail.com rkjhaw1...@gmail.com


*Enlightenment needs NO ANNOUNCEMENT* *Let cracking good times continue
without fire-crackers*

* *

*The SPIRIT of Diwali is to spread happiness and love to every one - Then
why are we making our **MOTHER EARTH** sad and polluted.*

* ***

*Meaningful Celebration of the festival of lights can be done:*

ü  *By lighting a lamp - to dispel the darkness*

ü  *By donating generously to the needy – instead of donating POLLUTION*

ü  *By distributing sweets and sharing happiness*

* *



*One day’s celebration burdens Mother Earth with Pollution,*

*that takes a generation to wipe out.*

* *

*Let's convince our family members, friends and neighbors to join us and say
'no' to crackers, We owe an obligation to present and future generations on
our deeds and conduct today.*



Go for *GREENER EARTH* say *NO to FIRE CRACKERS*

* *

*Let celebrate a clean and pollution-free **Diwali.*

* *

*This Campaign is the initiation of Advocates for **GREEN EARTH**,
Bangalore.** *

* *
*Contact us: greencov...@gmail.com*
http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline@middle?



-- 
Thanks  Regards

Rakesh Kumar Jha
Software Developer
Symphony Services Corp (India) Pvt Ltd
Bangalore
(O) +918030274295
(R) +919886336619

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

2010-11-04 Thread TreKing
On Thu, Nov 4, 2010 at 11:32 AM, dashman erjdri...@gmail.com wrote:

 i don't want to close the dialog - but the dialog closes even if i don't
 call dismiss().


This is the default behavior for dialogs - as soon as you click any button,
it closes, AFAIK.

Instead of using the built in setPostiveButton() function, add a layout that
has the buttons you need and handle the click on those. Then the dialog
won't auto-dismiss and you can leave it open as necessary.

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

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

[android-developers] Re: Another back button question... soft keyboard related

2010-11-04 Thread Neilz
Right, I've actually partially solved this by obtaining the build
version, and coding accordingly.

But it's frustrating that there doesn't seem to be a way of detecting
the soft keyboard...

On Nov 4, 4:16 pm, Neilz neilhorn...@gmail.com wrote:
 My app contains a page with a form, a long list of EditTexts.

 If you're entering text and click the back button, the soft keyboard
 is hidden. However different android versions behave in different
 ways. My 2.2 device hides the keyboard, and that's it. My 1.5 device
 hides the keyboard, and the 'back' onKeyDown/Up event is still
 activated.

 This is very tricky... for the 1.5 device I need to know if the
 keyboard is being displayed when the back button is pressed, so that I
 can capture the back event and stop it continuing (all I want is for
 the keyboard to hide). But I've search all over this forum and there
 doesn't appear to be a sure way of doing this.

 Any suggestions?

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

2010-11-04 Thread Kumar Bibek
For me, it's not clear what you are trying to do. Auto-fill fields
with what?

And for what Kostya has suggested, this link might help you.

http://techdroid.kbeanie.com/2010/10/android-webview-javascript-and-css.html


On Nov 4, 8:02 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 There is a way to call application functions in Java from WebView's
 JavaScript code. Application code needs to register an object with WebView,
 which is then accessible from JavaScript.

 --
 Kostya Vasilyev --http://kmansoft.wordpress.com

 04.11.2010 17:27 пользователь perumal316 perumal...@gmail.com написал:

 Hi All,

 I am creating my own app which will load a website upon starting. Now
 I want to auto-fill the fields that will appear on the website.

 Is this possible? How to I call the field through my app to fill up
 with pre-determined data?

 Thanks In Advance,
 Perumal

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group 
 athttp://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] image resolutions and scaling

2010-11-04 Thread Daniel Drozdzewski
From the following guideline:

http://developer.android.com/guide/practices/ui_guidelines/icon_design.html

relation between sizes are:

hdpi = 1.5 x mdpi
ldpi = 0.75 x mdpi


Daniel



On Thu, Nov 4, 2010 at 4:50 PM, ping bernd.warm...@gmail.com wrote:
 Hello,
 In order to ensure that my app looks good on devices with different
 screens I have to store my images (icons, etc,..) in the three folders
 for ldpi, mdpi and hdpi so that android can scale the images, right?
 Now how do i know which resolution the single pictures must have? For
 example I have two images for a navigation bar. Now I store these
 images for instance with size 60x60 in the hdpi folder which sizes
 do i have to choose for the mdpi and the ldpi folder? how do I know
 this?

 greets

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



-- 
Daniel Drozdzewski

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


[android-developers] Missing ACTION_UP

2010-11-04 Thread Bret Foreman
I've got a view where I override onTouchEvent to detect touching the
view with a finger and also to detect lifting the finger from the
view. I'm getting the ACTION_DOWN event but not the ACTION_UP event.
In fact, onTouchEvent isn't getting called when I life my finger.
Could it be that the finger-down and then finger-up is considered a
click event and so onTouchEvent is not called? If so, what use is
ACTION_UP?

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

2010-11-04 Thread Bret Foreman
So I set an onClickListener for the view and got the correct behavior.
I do the highlight background in the onTouchEvent and then remove the
background in the onClickListener. It's not pretty, but I don't see
any other way, since ACTION_UP never seems to occur.

However, this creates another problem. The view is swallowing the
click and I want it passed up to the parent for other processing. Is
there a method I can call in the onClickListener to cause the click to
be passed up the view stack rather than consumed?

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


[android-developers] sendBroadcast in IntentServicenot non-re-entrant?

2010-11-04 Thread Bret Foreman
I'm trying an experiment where an Activity makes a number of
consecutive calls to an IntentService. Each call kicks off some
background work that finishes in a few seconds. So there are multiple
concurrent instances of the IntentService running. All the instances
finish at around the same time and each one does a sendBroadcast to
return a message to the Activity that it's finished. When this
happens, about 30% of the broadcast intents never get back to the
Activity's registered receiver.

It looks as if there is some static state inside the IntentService
class that is in conflict when there are multiple invocations running
and they are all calling sendBroadcast at about the same time. In
other words, sendBroadcast appears to be non-re-entrant.

I'd like to package up this example for submission to b.android.com
but before I do, I'd like to find out a few things from this forum:

1) Is this a known bug?
2) Is this expected behavior (ie not a bug)?
3) Has anyone seen anything like this or another case where the
IntentService worked correctly when used in this way?

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


[android-developers] Re: ListView.setOnItemClickListener() fails to catch selection events for custom list items

2010-11-04 Thread FractalBob
I think the reason it's still not working is because I'm not sure what
interface onListItemClick implements, so I tried

public class NewsListActivity extends ListActivity implements
OnClickListener

and I implemented onClick, to no avail.

Anyone know what I should specify for implements?



On Nov 4, 6:29 am, FractalBob ruom...@gmail.com wrote:
 Thanks for your suggestion, Filip. I added the following to the
 ListView:

     public void onListItemClick (ListView l, View v, int position,
 long id)
       {
       item_index = position;
       Toast.makeText(this, item clicked =  + position,
 Toast.LENGTH_LONG).show();
       }
 But it didn't get executed when I selected an item in the list (the
 Toast never got displayed).

 On Nov 4, 1:03 am, Filip Havlicek havlicek.fi...@gmail.com wrote:







  Hi Bob,

  since you are using ListActivity, you can override onListItemClick instead
  of creating new OnItemClickListener. More information here

 http://developer.android.com/reference/android/app/ListActivity.html#...,
  android.view.View, int, long)

  That should fix your problem.

  Best regards,
  Filip Havlicek

  2010/11/4 FractalBob ruom...@gmail.com

   I thought I knew how to catch list selection events in Android and
   then I regained consciousness. In my situation, I have a ListView that
   I populate with a custom view, all of the same class (let's call it
   the NewsChannel() class). NewsChannel consists of a LinearLayout of
   ImageViews and TextViews. When the list is displayed, the user may
   select a NewsChannel item in the list; I want to find out which list
   item was selected.

   Also, I registered an onClickListener to one of the TextViews and that
   works fine: when the text is clicked on, an activity is launched which
   is looking for the position of the NewsChannel item in the list.

   So, here's what my code looks like:

   1. Registering the onClickListener in the ListActivity:

   public class NewsListActivity extends ListActivity
   {
                          .
                          .
                          .
      public void onCreate(Bundle icicle)
      {
          super.onCreate(icicle);
          setContentView(R.layout.news_list_format);

          ListView lv = getListView();

          lv.setOnItemClickListener(new OnItemClickListener() {
              public void onItemClick(AdapterView? parent, View view,
                  int position, long id) {
                // When clicked, show a toast with the TextView text
                  item_index = position;
                Toast.makeText(getApplicationContext(), item clicked =
+ position, Toast.LENGTH_SHORT).show();
              }
            });

                          .
                          .
                          .
   2. The layout for the ListView associated with NewsListActivity:

   ?xml version=1.0 encoding=UTF-8?
   RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
   android
      android:orientation=vertical
      android:layout_width=fill_parent
      android:layout_height=fill_parent
      android:background=@drawable/wpaper_tile

      ListView android:id=@id/android:list
          android:layout_width=fill_parent
          android:layout_height=fill_parent
          android:layout_alignParentTop=true
          android:dividerHeight=15dp
          android:divider=@android:color/transparent
                  android:cacheColorHint=@android:color/transparent
          android:scrollbars=none
          /
      FrameLayout
          android:layout_width=fill_parent
          android:layout_height=55dp
          android:layout_centerHorizontal=true
          android:layout_alignParentBottom=true
          android:background=#8800
          /
      ImageView
          android:layout_width=fill_parent
          android:layout_height=wrap_content
          android:layout_centerHorizontal=true
          android:layout_alignParentBottom=true
          android:src=@drawable/phonetop_bg
          /
   /RelativeLayout

   3. The NewsChannel layout:

   ?xml version=1.0 encoding=UTF-8?
   RelativeLayout xmlns:android=http://schemas.android.com/apk/res/
   android
      android:layout_width=fill_parent
      android:layout_height=wrap_content

      include layout=@layout/news_heading_format
          android:id=@+id/news_heading_header/

      ImageView android:id=@+id/news_channel_image
          android:layout_width=88dp
          android:layout_height=66dp
          android:layout_alignParentLeft=true
          android:layout_below=@id/news_heading_header
          android:padding=10dp /

      TextView android:id=@+id/news_channel_text
          android:lines=4
          android:inputType=textMultiLine
          android:layout_toRightOf=@id/news_channel_image
          android:layout_below=@id/news_heading_header
          android:layout_width=fill_parent
          android:layout_height=wrap_content/
   /RelativeLayout

   When I run the app, the ItemClickListener is 

[android-developers] Re: Missing ACTION_UP

2010-11-04 Thread Bret Foreman
It's unfortunate that onClick and onTouch do not use the same
approach, where the method returns a true if it handled the event and
the parent shouldn't get the event a false if the parent should get
the event.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ListView.setOnItemClickListener() fails to catch selection events for custom list items

2010-11-04 Thread Kumar Bibek
Have you set your list items to be focussable? Mean are some of your views
in your item layout focussable?

On 04-Nov-2010 11:35 PM, FractalBob ruom...@gmail.com wrote:

I think the reason it's still not working is because I'm not sure what
interface onListItemClick implements, so I tried

public class NewsListActivity extends ListActivity implements
OnClickListener

and I implemented onClick, to no avail.

Anyone know what I should specify for implements?




On Nov 4, 6:29 am, FractalBob ruom...@gmail.com wrote:
 Thanks for your suggestion, Filip. I a...

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

2010-11-04 Thread Kumar Bibek
Well, if the docs say it clearly, its fine I guess.

On 04-Nov-2010 11:38 PM, Bret Foreman bret.fore...@gmail.com wrote:

It's unfortunate that onClick and onTouch do not use the same
approach, where the method returns a true if it handled the event and
the parent shouldn't get the event a false if the parent should get
the event.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers ...

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

2010-11-04 Thread Bret Foreman
True, except the inconsistency results in an incompleteness. The
onClick documentation doesn't state what mechanism has been created in
the onClick case to produce the same effect as returning a false in
the onTouch case.

On Nov 4, 11:10 am, Kumar Bibek coomar@gmail.com wrote:
 Well, if the docs say it clearly, its fine I guess.

 On 04-Nov-2010 11:38 PM, Bret Foreman bret.fore...@gmail.com wrote:

 It's unfortunate that onClick and onTouch do not use the same
 approach, where the method returns a true if it handled the event and
 the parent shouldn't get the event a false if the parent should get
 the event.

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers ...

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

2010-11-04 Thread Bret Foreman
It occurs to me that this may be a consequence of the _kind_ of view
I'm using. In this case, it's a TextView. I notice that the only
onTouch event that the default TextView passes to my onTouch method is
ACTION_DOWN. I'm guessing I need to set some flags elsewhere to get
other events for this type of view.

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

2010-11-04 Thread Bret Foreman
Scanning through the TextView docs did not reveal any flags that I
think would effect whether or not the ACTION_UP event was passed to
onTouch.

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


[android-developers] Return to my application when back key is pressed from native dialer

2010-11-04 Thread ar
This is what I'm trying to support. Can this be done?

a) User is an Activity A in my app.
b) The user is taken to the native dialer when he chooses a particular
action in my Activity
c) User presses the back key
d) Taken to homescreen

Is there a way I can change it, so the back key press returns him to
my app, instead of native homescreen?

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

2010-11-04 Thread Bret Foreman
Now here's an AMAZING thing. When I change onTouch to return true
(indicating that the event is handled) then the ACTION_UP event _is_
passed to onTouch. So returning false as a result of the ACTION_DOWN
somehow tells the stack to pass the subsequent ACTION_UP to onTouch.
This is not a fix, however, since I need to pass the event to the
upper view layers for other processing.

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


[android-developers] Using ListView in AlertDialog

2010-11-04 Thread intbt
I am trying to add 2 listviews to an alertdialog to select 2 separate
items.

I am getting the following error


11-04 18:52:29.094: WARN/WindowManager(584): Attempted to add window
with non-application token WindowToken{436ad8b0 token=null}.
Aborting.

11-04 18:52:29.113: DEBUG/AndroidRuntime(896): Shutting down VM
11-04 18:52:29.125: WARN/dalvikvm(896): threadid=3: thread exiting
with uncaught exception (group=0x4000fe70)

11-04 18:52:29.153: ERROR/AndroidRuntime(896): Uncaught handler:
thread main exiting due to uncaught exception

11-04 18:52:29.263: ERROR/AndroidRuntime(896):
android.view.WindowManager$BadTokenException: Unable to add window --
token null is not for an application


Code to generate Dialog is below:

protected Dialog onCreateDialog(int id) {

 switch(id){
  case ROOT_SELECT:
/*
  AlertDialog.Builder builder = new AlertDialog.Builder(Scales.this);
builder.setTitle(Select Key);
builder.setItems(rootNote, new DialogInterface.OnClickListener()
{public void onClick(DialogInterface dialog, int item)
{

tv.setText(Root Note: +rootNote[item]);
Note = rootNote[item];

}
});
AlertDialog alertDialog = builder.create();
  */

  AlertDialog.Builder builder;
  AlertDialog alertDialog;
  Context mContext = getApplicationContext();
  LayoutInflater inflater = (LayoutInflater)
mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
  View layout = inflater.inflate(R.layout.select_dialog, (ViewGroup)
findViewById(R.id.selnoteacc));

  builder = new AlertDialog.Builder(mContext);
  builder.setView(layout);

  ListView noteList = (ListView) layout.findViewById(R.id.notesel);
  ListView accList = (ListView) layout.findViewById(R.id.accsel);

  ArrayAdapter adapter1 = new ArrayAdapter(this, R.layout.list_item,
rootNote);

  noteList.setAdapter(adapter1);

  ArrayAdapter adapter2 = new ArrayAdapter(this, R.layout.list_item,
accs);
  accList.setAdapter(adapter2);


  noteList.setOnItemClickListener(new ListView.OnItemClickListener(){

@Override
public void onItemClick(AdapterView? arg0, View arg1,int
position, long arg3) {

NoteSelected = rootNote[position];
}
});

  accList.setOnItemClickListener(new ListView.OnItemClickListener(){

@Override
public void onItemClick(AdapterView? arg0, View arg1,int
position, long arg3) {

AccSelected = accs[position];
}
});


  alertDialog = builder.create();

   return alertDialog;

Code crashes on return of alertDialog.
Any ideas as to what the adding window with non-application token
means?

intbt

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

2010-11-04 Thread Bret Foreman
It looks like the only workaround is brute force. I can extend
TextView to add a myParentView variable and then call the
myParentView.onTouchEvent. Of course I'll also return true from
onTouch so that I will successfully receive the ACTION_UP event. But
what a hack!

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: Are 3rd party app stores a good idea for free apps?

2010-11-04 Thread songs
I'm interested in hearing if anyone else has experience selling on
third-party sites as well (handster.com in particular).  Wondering if
it's worth the effort to manage across multiple markets.

On the one hand, uploading a file to another revenue channel seems
easy enough.  On the other hand, there could be all sorts of problems
from getting paid to customer support if their purchase/download
doesn't work well.

-Steve

On Nov 2, 9:26 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 I submitted my free application to two sites a while back. Download
 numbers are far, far below what the application gets on Android Market.

 With the recently expanded list of countries that can sell / buy paid
 applications, I don't see these stores being significant.

 One possible exception is Amazon's, but that's another story (what if
 the next version of Kindle runs Android, but has their app store instead
 of Android Market?)

 -- Kostya

 02.11.2010 15:16, JRock пишет:

  After publishing a free app to Android Market I have received numerous
  solicitations from 3rd party app stores to publish my app such as
 handster.com and mobango.com. To date, I have not pursued that and my
  app is only available on Android Market.

  I would love to hear some developer opinions about this: Is it better
  to stick to Android Market only, or does it make sense to publish your
  free apps in as many stores as you can? What do you think are the pros
  and cons to each approach?

 --
 Kostya Vasilyev -- WiFi Manager + pretty widget 
 --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: How can I hide views when the soft keyboard is up?

2010-11-04 Thread newobj
It's not really what I want. I want an adjustResize behavior, however,
I also want to completely hide certain views. It's really a more
specific version of the question how do I do things when the keyboard
appears/disappears - a question to which I've never found a
satisfactory answer that works across all the phones I test on. Do you
know of an answer to that question?

Thanks,
Brian

On Nov 4, 6:00 am, paulb pbizan...@gmail.com wrote:
 Hello,

 Maybe you want to add the attribute:

     android:windowSoftInputMode=adjustPan

 to your activity in the AndroidManifest







 On Tue, Nov 2, 2010 at 7:43 AM, newobj new...@gmail.com wrote:
  I have a pretty standard search edit widget on top / search results
  list widget on bottom activity in my app. Below the results list
  widget I also have my view for ads. When the soft keyboard is brought
  up in this activity, I'd like to hide the view the ads are in because
  they consume too much screen space. I tried making that view
  android:isScrollContainer=true but that had no effect.

  So the question is, how can I ensure that certain views will be hidden
  when the soft keyboard is brought up?

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

2010-11-04 Thread TreKing
On Thu, Nov 4, 2010 at 2:00 PM, intbt in...@tacberry.com wrote:

 Any ideas as to what the adding window with non-application token means?


Here we go again ...

This most likely means that you're using getApplicationContext() instead of
an Activity to show a Dialog. Don't use that function - like ever. Just use
*this* or whatever your most local Context (that is an Activity) is.

I can't believe this is STILL not fixed in the documentation ...

-
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] sendBroadcast in IntentServicenot non-re-entrant?

2010-11-04 Thread Kostya Vasilyev

Bret,

You saying that there are multiple concurrent instances of the 
IntentService running is not entirely accurate.


If you actually defined multiple services in Java / the manifest, my 
apologies.


If you only defined one service, then there is only one instance of the 
service, and any intents it receives are queued up to a thread-safe 
queue as soon as they are received. The worker thread (there is only 
one, AFAIK) then de-queues intents from this queue and processes them 
one by one.


So no synchronization issues there.

However, it's not out of the question that calling sendBroadcast, with 
it being a framework function, is only allowed from the UI thread, just 
like many other framework functions in Android.


Since you are able to consistently reproduce this problem in your 
application, I think it wouldn't hurt to run a simple experiment.


Change calls to sendBroadcast so they are made from the UI thread (e.g. 
obtain a Handler in your service's onCreate, then post a runnable 
containing the intent to be broadcast to the Handler).


Also: for the case you described, you could use a lighter-weight 
notification mechanism, such as ResultReceiver or Message.


-- Kostya

04.11.2010 20:54, Bret Foreman пишет:

I'm trying an experiment where an Activity makes a number of
consecutive calls to an IntentService. Each call kicks off some
background work that finishes in a few seconds. So there are multiple
concurrent instances of the IntentService running. All the instances
finish at around the same time and each one does a sendBroadcast to
return a message to the Activity that it's finished. When this
happens, about 30% of the broadcast intents never get back to the
Activity's registered receiver.

It looks as if there is some static state inside the IntentService
class that is in conflict when there are multiple invocations running
and they are all calling sendBroadcast at about the same time. In
other words, sendBroadcast appears to be non-re-entrant.

I'd like to package up this example for submission to b.android.com
but before I do, I'd like to find out a few things from this forum:

1) Is this a known bug?
2) Is this expected behavior (ie not a bug)?
3) Has anyone seen anything like this or another case where the
IntentService worked correctly when used in this way?




--
Kostya Vasilyev -- WiFi Manager + pretty widget -- 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


  1   2   >