[android-developers] http live stream

2011-06-19 Thread Károly Holczhauser
Hi girls and boys!

 I had read some blog in this topic, but I don't got an unique
answser, so I have to ask it from you. Is Http Live stream -ing
possible on android ?!

 Thanks: Károly

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

2011-06-19 Thread Romain Guy
It is supported as of Android 3.0.

On Sat, Jun 18, 2011 at 11:07 PM, Károly Holczhauser
holczhau...@gmail.com wrote:
 Hi girls and boys!

  I had read some blog in this topic, but I don't got an unique
 answser, so I have to ask it from you. Is Http Live stream -ing
 possible on android ?!

  Thanks: Károly

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




-- 
Romain Guy
Android framework engineer
romain...@android.com

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

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


[android-developers] Re: Is there something wrong?

2011-06-19 Thread Chris
Yes there is something wrong.  You're querying a database in a UI thread.

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

2011-06-19 Thread Károly Holczhauser
Hi!
 3.0 is avalible only for tablest, right ?

On jún. 19, 08:08, Romain Guy romain...@android.com wrote:
 It is supported as of Android 3.0.

 On Sat, Jun 18, 2011 at 11:07 PM, Károly Holczhauser









 holczhau...@gmail.com wrote:
  Hi girls and boys!

   I had read some blog in this topic, but I don't got an unique
  answser, so I have to ask it from you. Is Http Live stream -ing
  possible on android ?!

   Thanks: Károly

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

 --
 Romain Guy
 Android framework engineer
 romain...@android.com

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

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


[android-developers] Re: http live stream

2011-06-19 Thread Károly Holczhauser
Hi!
3.0 avalible only for tablets, right ?

On jún. 19, 08:08, Romain Guy romain...@android.com wrote:
 It is supported as of Android 3.0.

 On Sat, Jun 18, 2011 at 11:07 PM, Károly Holczhauser









 holczhau...@gmail.com wrote:
  Hi girls and boys!

   I had read some blog in this topic, but I don't got an unique
  answser, so I have to ask it from you. Is Http Live stream -ing
  possible on android ?!

   Thanks: Károly

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

 --
 Romain Guy
 Android framework engineer
 romain...@android.com

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

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


Re: [android-developers] External Usb Card WiFi in Android

2011-06-19 Thread Marcin Orlowski
On Jun 19, 2011 12:41 AM, Migazan eni...@gmail.com wrote:

 Hello,
 The Wifi network from my phone does not work. I can install an
 external usb on my phone?

if you got working drivers but 'no' in general

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

2011-06-19 Thread Bharathi raja
Thanks for your reply
i wanted to automate both the scenario on sample phone.
First play song then initiate call and check song is playing or not, after
call whether song resume.

If you/anyone know this please reply me back

On Sat, Jun 18, 2011 at 1:48 PM, kaushik p kaushiks...@gmail.com wrote:

 Hi

 When the call connects the song automatically stops ,Anyways you can use
 the intent like

 startActivity(new Intent(Intent.ACTION_CALL, Uri.parse(tel:99)));

 it does the work of calling . If you have any use case where the call needs
 to check for the song to be played then get back to me again .

 On Sat, Jun 18, 2011 at 11:56 AM, Bharathiraja R 
 bharathiraja.andr...@gmail.com wrote:

 Hi,

 Anyone please share me sample code for make call when song is
 playing.
 and how to check whether song is playing during the call.

 Regards,
 Bharathiraja R

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




 --
 ThanksRegards
 Kaushik Pendurthi

 http://kaushikpendurthi.blogspot.com/

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


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

2011-06-19 Thread RS
To summarize, I still don't have the answer to the original question
except that it is probably not possible yet.

Original question (User perspective):
Once a user (not a developer) clicks† around and grants an android
app, access to google auth tokens, how could he/she revoke it?

† Clicks: User clicks on an activity that android system throws when
third party apps (utilizing android.permission.USE_CREDENTIALS) try
accessing google auth tokens

Sample screenshots:
  http://www.appbrain.com/info/fastweb2.png
  http://chiarg.com/?p=429

Happy to hear workarounds that can possibly revoke this for all third
party android apps that were granted access once (say revoke through
settings  manage apps  all  google services or partner or some such
 clear data) but without disrupting other google services (gmail,
gtalk, android market, ...) on the device.

Or perhaps do it through the central web based accounts dashboard
(which for now doesn't display info about android apps)
http://www.google.com/url?sa=Dq=https://www.google.com/accounts/IssuedAuthSubTokens

I could possibly post this on android-platform group as well.

On Jun 17, 5:02 pm, RS rajeshs...@gmail.com wrote:
 Thanks Nikolay. Very useful pointers. Thank goodness it isn't global
 (UID).

 Though am using this permission as a developer the question is from a
 user point of view who wishes to revoke access, so I'd rather not call
 this directly or through reflection. Wish the system had a settings
 screen for this instead. Something the user could trust irrespective
 of the apps installed.

 I do see a couple of bugs requests where people would like to deny
 access to specific security permissions to an app (eg: network,
 camera, call status, ...) on the whole. This auth token stuff though,
 falls in a different sub-category and might be quicker to solve.

 Hope a google employee could comment on any future updates to the
 account management flow that they might have.

 Thanks,
 RS

 On Jun 17, 4:28 pm, Nikolay Elenkov nikolay.elen...@gmail.com wrote:







  On Fri, Jun 17, 2011 at 11:21 PM, RS rajeshs...@gmail.com wrote:
   Simplifying the question:

   Am looking for answers from developers (or google engineers) who have
   used accountManager.getAuthToken() and have come across such a
   screen for their own apps:

  http://www.appbrain.com/info/fastweb2.png
   or
  http://chiarg.com/?p=429

   Once the user clicks 'allow', how could they undo this action for that
   particular android app+account?

  It seems that there is no public API to do this.  AccountMangerService has a
  revokeAppPermission() method which is both hidden (with @hide) and
  not accessible via public APIs. You could probably call it using reflection,
  but that is usually not recommended. BTW, access to tokens is granted
  by UID, so it's not global for all applications. Check out
  /data/system/accounts.db for more details if you have a rooted device.

  HTH

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

2011-06-19 Thread Indicator Veritatis
It sounds to me like you may have run up against the same problem I
noticed when building and running the WindAndWaves app from Android
in Action: LocationManager.requestLocationUpdates does a logical AND
operation on the two conditions, minimum distance and minimum time.

This sounds pretty useless at first, but counter intuitive though it
is to AND hem, it does provide more flexibility: you can always get
the effect of an OR by registering the same listener twice, once for
minimum distance changed, and again for minimum time changed.

This is what I did when I rewrote that section fo the original app to
read:

// we use separate locationListeners for different purposes
// one to update buoy data only if we move a long distance
(185000 meters, just under the
// 100 nautical miles we are parsing the data for)
// another to recenter the map, even when we move a short
distance (50 meters). Now
// also every minute (60,000mS is one minute), now two seperate
requests.
if (this.locationProvider != null) {
 
this.locationManager.requestLocationUpdates(this.locationProvider.getName(),
6, 185000,
this.locationListenerGetBuoyData);
 
this.locationManager.requestLocationUpdates(this.locationProvider.getName(),
6, 0,
this.locationListenerRecenterMap);
 
this.locationManager.requestLocationUpdates(this.locationProvider.getName(),
0, 50,
this.locationListenerRecenterMap);
} else {
Log.e(Constants.LOGTAG,   + MapViewActivity.CLASSTAG +   NO
LOCATION PROVIDER AVAILABLE);
Toast.makeText(this,
Wind and Waves cannot continue, the GPS 
location provider is
not available at this time.,
Toast.LENGTH_SHORT).show();
finish();
}

If the snippet is too obscure, you can download the Chapter 11 source
code to see the whole thing. You don't have to buy the book to do the
download. But it is worth getting the book despite the redundant use
of 'this' you can see in the snippet above;)

Then again, you did say 10 seconds. But that is an awfully short
period of time.

On Jun 16, 6:18 pm, Baodong Chen chenbdche...@gmail.com wrote:
 Hi:
  I have a APP using Location Service, and i tested it and found that
  my Location Listener's onLocationChanged() was not called for more
 than ten seconds.
  but onGpsStatusChanged() was called normally.
  this means that i can not decide user's location for too long time.
  I want to know why this happens?
  is this a normal case or a bug cause this?

  ps: I have posted this to android-ndk, and they suggested me posting here.

  best regards, 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: Text view over image gallery

2011-06-19 Thread Randy
Textview and imageview are static.
But in this case, i want to put the text on the top of every image in
gallery.
And for the gallery, i'm using gallery widget.
So i can make them dynamically.
How can i do it?

Thank's so much with you reply...

On Jun 17, 8:31 pm, hwrdprkns taylo...@gmail.com wrote:
 If you use a FrameLayout, the views are layered by the time they are
 defined.

 For example, if you have a FrameLayout with a TextView and an
 ImageView, the one that is defined FIRST will be on the bottom, and
 the one that is defined second would be on top. Take a look at the
 developer docs for more details.

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

 On May 23, 10:16 pm, Randy rendy.hadin...@gmail.com wrote:







  How can i make Text view over image gallery like pulse news reader's
  UI?

  Anyone can help me?

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

2011-06-19 Thread Randy
Textview and Imageview are static.
But in this case, i want to put the text on the top of every my
gallery image.
And for the gallery, i use gallery widget.
So they are dynamic.
How can i do it?

Thank's so much for the reply.

On Jun 17, 7:30 pm, gaurav gupta gaurav.gupta...@gmail.com wrote:
 Hi
 u can use frame layout.







 On Fri, Jun 17, 2011 at 12:42 PM, Randy rendy.hadin...@gmail.com wrote:
  Anyone help me please...

  On May 24, 9:16 am, Randy rendy.hadin...@gmail.com wrote:
   How can i makeTextviewoverimagegallery like pulse news reader's
   UI?

   Anyone can help me?

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

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


Re: [android-developers] Re: http live stream

2011-06-19 Thread Mark Murphy
2011/6/19 Károly Holczhauser holczhau...@gmail.com:
  3.0 is avalible only for tablest, right ?

Correct.

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

Android Training...At Your Office: http://commonsware.com/training

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

2011-06-19 Thread Mark Murphy
Use Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP.

On Sat, Jun 18, 2011 at 11:31 PM, Hitendrasinh Gohil
hitendra.virtuei...@gmail.com wrote:
 Hi,

 I am binding service to playerview activity and setting the values
 from server to player activity.I am not finishing my playerview
 activity.when i click on status bar notification newactivity is
 called.I dont want that.i want to call existing activity so that i
 doesnt have need to change the details(fetch from server).

 currently  i m using
 PendingIntent
 pendingIntent=PendingIntent.getActivity(getApplicationContext(),0,
 intent,Intent.FLAG_ACTIVITY_CLEAR_TOP);

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




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

Android Training...At Your Office: http://commonsware.com/training

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


[android-developers] How to grey out and disable the settings screen on a live wallpaper?

2011-06-19 Thread MobileVisuals
I have free and full versions of my live wallpapers. I have seen that
the settings screen for many of the full versions of other live
wallpapers look the same as the settings screen for the free versions,
but the options are greyed out and disabled. How can I implement this?

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


[android-developers] Re: How to grey out and disable the settings screen on a live wallpaper?

2011-06-19 Thread Zsolt Vasvari
The same way as you manage any other difference between the free and
paid version of your app.  The settings screen for a wallpaper is just
a normal activity.

On Jun 19, 7:33 pm, MobileVisuals eyv...@astralvisuals.com wrote:
 I have free and full versions of my live wallpapers. I have seen that
 the settings screen for many of the full versions of other live
 wallpapers look the same as the settings screen for the free versions,
 but the options are greyed out and disabled. How can I implement this?

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


[android-developers] SyncManager can't find my sync adapter

2011-06-19 Thread Steve Grosbois
Why Android don't find my sync adapter when i call :

ContentResolver.setSyncAutomatically(account,
com.stevegrosbois.budget.provider, true);

I have searched for hours !

In the Logcat :

DEBUG/SyncManager(59): can't find a sync adapter for SyncAdapterType
Key {name=com.stevegrosbois.budget.provider,
type=com.stevegrosbois.budget.user}, removing settings for it

In my AndroidManifest.xml :

service android:name=.sync.SyncService android:exported=true
intent-filter
action android:name=android.content.SyncAdapter /
/intent-filter
meta-data android:name=android.content.SyncAdapter
android:resource=@xml/syncadapter /
/service
syncadapter.xml :

sync-adapter xmlns:android=http://schemas.android.com/apk/res/
android
contentAuthority=com.stevegrosbois.budget.provider
accountType=com.stevegrosbois.budget.user
android:supportsUploading=true
android:userVisible=true
/

I have tried everything

And now i'm crying :'(

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


[android-developers] Re: Google Plugin Beta 2.4 - C2DM Always tries to register at local ip and times out.

2011-06-19 Thread Andy Bryant
When you run your app against your local app engine, Eclipse generates
a file assets/debugging_prefs.properties.

The app checks if this file exists (see Util.getDebugUrl) and if so
uses that to determine where to connect to. It not it uses the value
defined in Setup.PROD_URL.

So you can either uninstall the app on your phone, then reinstall but
don't debug against local app engine. Or edit Util or Setup classes as
these are both in your project for you to play with.

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

2011-06-19 Thread Simon Platten
I am adding some views to a linear layout in code, I have set the colour of
the text view as follows:

TextView tvImagesTitle = new TextView(this);
tvImagesTitle.setTextColor(R.color.blue);
tvImagesTitle.setText(Some text);
m_llImages.addView( tvImagesTitle );

However the text comes out grey, the value of the blue resource is:

color name=blue#ffff/color


Any ideas?

-- 
Regards,
Sy

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

2011-06-19 Thread Kristopher Micinski
This was discussed quite a bit a few wees ago, you can find it on the group.

Kris

On Sun, Jun 19, 2011 at 1:37 AM, Indicator Veritatis mej1...@yahoo.comwrote:

 I see people are having a lot of fun with your post. But seriously
 now: the abbreviations you are using are acceptable for SMS text
 messages and sometimes even for Twitter, but NOT for serious purposes,
 such as posts to an email list or Google group.

 There are many reasons for this, I will mention only one: so that when
 people do Google searches of this group, your post may show up in the
 right place, along with any answers that people may make.

 On Jun 16, 10:31 am, jeniffer hills saloni9...@gmail.com wrote:
  hey ol!!
  well m  doin engg wid cs deptt. n rcntly m done wid my 4th sem xams.
  few dayz back i hv learnt about android apps n also registerd for the
  same. Though i hv learnt dat in future android may achieve sm demand
  in the market. still i hv a cnfusion regardin d CAREER IN ANDROID as
  android apps r used only in cellphones. dere is no pc or laptop wch is
  based on android apps so far. i hv several ques in my mind like
  1. is dere any career in android apps?
  2. hw good it is frm career point of view?
  3. cellphons r smthing wch will olwayz be in demand so r dere
  sufficient nmbr of cmpanies dat provide gadgets based on android apps?
  4. in outside country, is android a good technology wch hav a good
  demand and future as well?
  5. in a career for engg, wat is more imprtnt? a good programming
  skills or knowldge of sch apps.
  ladies n gentlements plz go thru my quries n help me out by tellin me
  ol ups n dwns of android apps n guiding me for selecting a crrct path
  for a good future carrer.

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

2011-06-19 Thread Fred Niggle
Hello,

Take look here for starters :
http://androidforums.com/developer-101/181868-how-stream-music-internet-radio-station.html

there are lots of info via google search.

Hope this helps
Fred

On 19/06/2011, Károly Holczhauser holczhau...@gmail.com wrote:
 Hi girls and boys!

  I had read some blog in this topic, but I don't got an unique
 answser, so I have to ask it from you. Is Http Live stream -ing
 possible on android ?!

  Thanks: Károly

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

2011-06-19 Thread Fred Niggle
Hello Simon,

For a button in a recent project I used:
How to set a button as transparent and blue:

button1.setBackgroundColor(Color.argb(125, 0, 0, 255));

the 1st set of digits (125) is the translucency.

Did you try dropping the '#' off your code in xml before asking?
Fred.


On 19/06/2011, Simon Platten simonaplat...@googlemail.com wrote:
 I am adding some views to a linear layout in code, I have set the colour of
 the text view as follows:

 TextView tvImagesTitle = new TextView(this);
 tvImagesTitle.setTextColor(R.color.blue);
 tvImagesTitle.setText(Some text);
 m_llImages.addView( tvImagesTitle );

 However the text comes out grey, the value of the blue resource is:

 color name=blue#ffff/color


 Any ideas?

 --
 Regards,
 Sy

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, 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: again like all : The application ... (process ...) has stopped unexpectedly. Please try again

2011-06-19 Thread aMeeN
Hello All,


I downloaded Eclipse Java (this time) and did all the integration and
linking with Android SDK after I finished ...
I tried to run the application again .. but unfortunately getting the
same error.

I am seriously started thinking to give up   with android
development .. this is one bug takes me around 10 days

I will give it some more tries and will see.


On Jun 18, 11:14 am, aMeeN ameen.ra...@gmail.com wrote:
 Thank you Mr. Zsolt for your help.

 I wasn't sure about the error reason, Android and Eclipse both are new
 to me .. thats why I am confused.

 I will try to download Eclipse and prepare the development environment
 again.

 Hope it will work properly .. I will update this post with the
 result.

 Thanks again.

 On Jun 18, 7:29 am, Zsolt Vasvari zvasv...@gmail.com wrote:







  Why do you think the error is caused by your code?  The stack trace
  you are showing has got something to do with Eclipse, not an Android
  application.

  On Jun 17, 10:25 pm, aMeeN ameen.ra...@gmail.com wrote:

   I am writing my first Andoid application. And facing an error .. I
   consider it too strange but also expecting to face a lot of strange
   errors and bugs.

   I googled to find out what cause that error. And tried to learn how to
   debug Android application on Eclipse but no luck.

   The application I am writing is having only an image and button. The
   button is to switch the mobile from normal mode to silent mode and the
   reverse and the image is an indicator the for which mode currently is
   active.

   When I got the error I highlighted all the the code and started
   unhighlighting one by one, till I found the this line specifically
   cause the error:

   int ringerMode = mAudioManager.getRingerMode();

   when I run the application, on the Debug prespective view , in the
   error log tab I am getting :

   Error:

   No command output when running: 'am start -n
   ameen.android.silentModeToggle/
   ameen.android.silentModeToggle.SilentModelToggleActivity -a
   android.intent.action.MAIN -c android.intent.category.LAUNCHER' on
   device emulator-5554

   Exception Stack Track:

   com.android.ddmlib.ShellCommandUnresponsiveException
           at 
   com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:
   408)
           at com.android.ddmlib.Device.executeShellCommand(Device.java:276)
           at
   com.android.ide.eclipse.adt.internal.launch.ActivityLaunchAction.doLaunchAc
­tion(ActivityLaunchAction.java:
   74)
           at
   com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launchA
­pp(AndroidLaunchController.java:
   1147)
           at
   com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.simpleL
­aunch(AndroidLaunchController.java:
   824)
           at
   com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.access
   $3(AndroidLaunchController.java:808)
           at 
   com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController
   $3.run(AndroidLaunchController.java:656)

   Session Data:

   eclipse.buildId=M20110210-1200
   java.version=1.6.0_24
   java.vendor=Apple Inc.
   BootLoader constants: OS=macosx, ARCH=x86, WS=cocoa, NL=en_US
   Framework arguments:  -keyring /Users/ameen/.eclipse_keyring -
   showlocation
   Command-line arguments:  -os macosx -ws cocoa -arch x86 -keyring /
   Users/ameen/.eclipse_keyring -showlocation

   I uploaded the zipped project folder into my DropBox folder if someone
   iterested to test it:

  http://dl.dropbox.com/u/4392604/Silent_Model_Toggle.zip

   I also explained this bug with screen shots in my blog, if you wanna
   have a 
   look:http://enabofaisal.wordpress.com/2011/06/17/the-application-process-h...

   Please someone help me  =)

   BTW .. as shown above (as Session Data) I have intel x86 MAC OS 10.6
   and using Eclipse of these infos:
   Eclipse SDK

   Version: 3.6.2
   Build id: M20110210-1200

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

2011-06-19 Thread Fred Niggle
Hello,
Try: setBackgroundColor(Color.argb(125, 0, 0, 255));

the 1st set of digits (125) is the translucency.

Hope this helps,
Fred

On 18/06/2011, Greg Donald gdon...@gmail.com wrote:
 On Sat, Jun 18, 2011 at 12:27 PM, Greg Donald gdon...@gmail.com wrote:
 I have a list view using a layout that has a background color of
 #8000.

 When I scroll the list, the list item background color change to a
 solid color, in this case black.  Seems it's ignoring the alpha
 transparency value on scroll.

 Is there a way to make it not do that?

 Tried this in getView() in my list adapter:

 RelativeLayout outer = (RelativeLayout) findViewById( R.id.outer );
 int color = Color.argb( 80, 0, 0, 0 );
 outer.setBackgroundColor( color );

 Still turns black on scroll :(


 --
 Greg Donald
 destiney.com | gregdonald.com

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

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

2011-06-19 Thread Simon Platten
Thanks for the reply, actually after reading your response I realised what
the problem was, I was passing the resource ID, not the colour.

I fixed it by:

tvImagesTitle.setTextColor( getResources().getColor(R.color.blue) );

On Sun, Jun 19, 2011 at 4:18 PM, Fred Niggle fred.nig...@googlemail.comwrote:

 Hello Simon,

 For a button in a recent project I used:
 How to set a button as transparent and blue:

 button1.setBackgroundColor(Color.argb(125, 0, 0, 255));

 the 1st set of digits (125) is the translucency.

 Did you try dropping the '#' off your code in xml before asking?
 Fred.


 On 19/06/2011, Simon Platten simonaplat...@googlemail.com wrote:
  I am adding some views to a linear layout in code, I have set the colour
 of
  the text view as follows:
 
  TextView tvImagesTitle = new TextView(this);
  tvImagesTitle.setTextColor(R.color.blue);
  tvImagesTitle.setText(Some text);
  m_llImages.addView( tvImagesTitle );
 
  However the text comes out grey, the value of the blue resource is:
 
  color name=blue#ffff/color
 
 
  Any ideas?
 
  --
  Regards,
  Sy
 
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-developers@googlegroups.com
  To unsubscribe from this group, 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




-- 
Regards,
Sy

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

[android-developers] where are the applications in 2.2 simulator

2011-06-19 Thread Jags
I last worked on 1.6 in 2.2 when the big simulator opens, i could only
scroll horizentally diferent screens, where to look 4 application ? my
aplication builds but dont know how to run, pressing ctrl f5 it
springs up simulator but never runs the app !

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

2011-06-19 Thread Fred Niggle
MERGE!

I had a bit of a battle doing this unil I went and praticed the layout
tutorials over at
http://developer.android.com/guide/topics/ui/layout-objects.html

in short you have to merge your two layouts, the image view being
first in your xml, and then the textview so it goes on top.

Hope this helps,
Fred

On 19/06/2011, Randy rendy.hadin...@gmail.com wrote:
 Textview and imageview are static.
 But in this case, i want to put the text on the top of every image in
 gallery.
 And for the gallery, i'm using gallery widget.
 So i can make them dynamically.
 How can i do it?

 Thank's so much with you reply...

 On Jun 17, 8:31 pm, hwrdprkns taylo...@gmail.com wrote:
 If you use a FrameLayout, the views are layered by the time they are
 defined.

 For example, if you have a FrameLayout with a TextView and an
 ImageView, the one that is defined FIRST will be on the bottom, and
 the one that is defined second would be on top. Take a look at the
 developer docs for more details.

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

 On May 23, 10:16 pm, Randy rendy.hadin...@gmail.com wrote:







  How can i make Text view over image gallery like pulse news reader's
  UI?

  Anyone can help me?

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

2011-06-19 Thread ivano borsato
hi all,i need to integrate the *ad-banner* (use the ad-mob sdk 4.1.0)
into the CandidateView of a custom soft-keyboard,i just write the code
but this not work because i have not a Activity context be passed to
the constructor of ad-banner.
This is code that I wrote:
---
public class CandidateView extends LinearLayout {
Context mContext;
public CandidateView(Context context) {
super(context);
mContext = context;
this.setBackgroundColor(Color.BLUE);

AdView adView = new AdView((Activity) mContext, AdSize.BANNER,
pippoplutopaperino); ---
this.addView(adView);
adView.loadAd(new AdRequest());

}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
@Override
protected void onDraw(Canvas canvas) {
if (canvas != null) {
super.onDraw(canvas);
}
}
}
---
this is a error:
Uncaught handler: thread main exiting due to uncaught exception
java.lang.ClassCastException: net.iacopodeenosee.test_AD.SoftKeyboard
at net.iacopodeenosee.test_AD.CandidateView.init(CandidateView.java:25)
at 
net.iacopodeenosee.test_AD.SoftKeyboard.onCreateCandidatesView(SoftKeyboard.java:118)
at 
android.inputmethodservice.InputMethodService.showWindowInner(InputMethodService.java:1310)
at 
android.inputmethodservice.InputMethodService.showWindow(InputMethodService.java:1278)
at 
android.inputmethodservice.InputMethodService$InputMethodImpl.showSoftInput(InputMethodService.java:388)
at 
android.inputmethodservice.IInputMethodWrapper.executeMessage(IInputMethodWrapper.java:148)
at 
com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:45)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4203)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
at dalvik.system.NativeStart.main(Native Method)

there is some trick that I can use? thanks to all.8y3

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


[android-developers] TabHost and TabWidget ?

2011-06-19 Thread Simon Platten
I am trying to create a layout using the TabHost and TabWidge views as
described here:

http://developer.android.com/resources/tutorials/views/hello-tabwidget.html

My XML so far looks like this:

?xml version=1.0 encoding=utf-8?
TabHost xmlns:android=http://schemas.android.com/apk/res/android;
android:id=@android:id/tabhost
android:layout_width=fill_parent
android:layout_height=fill_parent
LinearLayout xmlns:android=http://schemas.android.com/apk/res/android;

  android:orientation=vertical
  android:isScrollContainer=true
  android:layout_width=fill_parent
  android:layout_height=fill_parent
  android:layout_gravity=center_horizontal
android:gravity=center_horizontal
android:background=@drawable/bg
TabWidget android:id=@android:id/tabs
  android:layout_width=fill_parent
  android:layout_height=wrap_content /
FrameLayout android:id=@android:id/tabcontent
 android:layout_width=fill_parent
 android:layout_height=fill_parent
 android:padding=5dp /
/LinearLayout
/TabHost

However, the graphical layout shows the following error:

Error during post inflation process:
TabHost requires a TabWidget with id android:id/tabs.
View found with id 'tabs' is 'com.android.layoutlib.bridge.MockView'

The following classes could not be found:
- TabWidget

I've made sure eclipse and the SDK is all up to date, so what am I missing?

Thank you,

-- 
Regards,
Sy

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

2011-06-19 Thread New Developer
To Dianne

Thank you for all your support

I have managed to get the fragment concept working

I call  show()
FragmentTransaction fMgr = getFragmentManager().beginTransaction();
fMgr.show(visitScreen); 
fMgr.commit();

And then when done I call hide()
FragmentTransaction fMgr = getFragmentManager().beginTransaction();
fMgr.hide(visitScreen);
fMgr.commit();


I just have a new problem  But When I recall the function with the .show()

06-19 15:17:50.720: WARN/InputManagerService(21637): Window already focused, 
ignoring focus gain of: 
com.android.internal.view.IInputMethodClient$Stub$Proxy@4169e988

and Do not see the  Fragment  ?  any ideas

Thanks again for everything




On Jun 19, 2011, at 1:40 AM, Dianne Hackborn wrote:

 Committing a fragment transaction is asynchronous.  You should let it run and 
 do its thing; don't call getView() outside of the fragment's own lifecycle.
 
 Have you tried any of the API demos?  There are lots of them.  I suggest 
 starting off with one of those known working demos, found here:
 
 http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/index.html
 
 On Sat, Jun 18, 2011 at 8:10 PM, New Developer secur...@isscp.com wrote:
 Here is what I have can you see something obvious
 
 in my MainActivity  I call the  Fragment using
 
 FragmentTransaction   fMgr  = getFragmentManager().beginTransaction();
 VisitMenu fragment  = new VisitMenu(); 
 fMgr.add(R.id.menu2, fragment);
 fMgr.commit();
   
 fMgr.show(fragment);
   
 Log.w(CHECK , Check  1 + fragment.getView()   );
 Log.w(CHECK , Check  2 + fragment.view);
 
 Both Check 1  and Check 2  return NULL
 
 My Fragment Has this
 
 public class VisitMenu extends Fragment {
   private  View  parent= null;
   public   View  view  = null;
   
   @Override
   public View onCreateView(LayoutInflater inflater, ViewGroup container, 
 Bundle bundle) {
   view  = inflater.inflate(R.layout.visit_menu, container, 
 false);
   parent= container;
   return view;
   }
 }
 
 and ideas welcome
 
 Thanks in advance
 
 
 
 On Jun 18, 2011, at 10:40 PM, New Developer wrote:
 
 I have the SDK Updater done  and installed the  Compatibility package
 
 When I putextends   FragmentActivity
 
 I still get  FragmentActivity cannot be resolved to a type
 
 With the offer to change to Fragment
 
 and ideas
 
 thanks again
 
 
 
 
 On Jun 18, 2011, at 1:11 AM, Dianne Hackborn wrote:
 
 Xav's blog post explains how to get the support library, which has 
 FragmentActivity, through the SDK updater:
 
 http://android-developers.blogspot.com/2011/03/fragments-for-all.html
 
 On Fri, Jun 17, 2011 at 8:16 PM, New Developer secur...@isscp.com wrote:
 Dianne
 Thanks  and yes is was your blogspot article at the bottom that refers to  
 FragmentActivity
 
 But I can not find this anywhere  and when I type it ,  it is unknown
 
 thanks again
 
 On Jun 17, 2011, at 7:57 PM, Dianne Hackborn wrote:
 
 Blog posts:
 
 http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html
 http://android-developers.blogspot.com/2011/03/fragments-for-all.html
 
 SDK documentation:
 
 http://developer.android.com/guide/topics/fundamentals/fragments.html
 http://developer.android.com/reference/android/app/Fragment.html
 
 I would suggest that for now you ignore the fragment tag; all it is, is 
 a convenience for doing certain things.  Learn how to directly use the 
 Fragment APIs and how those work with activities, and then once you are 
 done with those basic concepts you can throw in fragment layout tags.
 
 (I should probably adjust the Fragment java doc to reflect this approach 
 as well.)
 
 On Fri, Jun 17, 2011 at 4:42 PM, New Developer secur...@isscp.com wrote:
 Could someone please clarify the method in which to use fragment
 
 There is a Main Activity which has a  fragment  element within it's layout
 
 this fragment element is then loaded to a class the extends  Fragment
 But does the fragment class then have it's own activity ?  or
 how do you access the elements within the fragment ?
 For discussion let us say the fragment has a Button and EditText
 
 Under  a normal activity  you could access it with
 (Button) findViewbyId(R.id.button);   but when I put this into a fragment 
 extended class
 findViewById  gives an error ?
 
 Also there is one article on Fragment which has a FragmentActivity  or 
 ActivityFragment
 But I can not find this anywhere
 
 Thanks in advance
 
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 

[android-developers] Android Market Developer Console not updating

2011-06-19 Thread Didier Girard
For several weeks, I see no updates on the number of downloads. Someone 
observes the same?
Sincerely,
Didier

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

2011-06-19 Thread jtoolsdev
Tailor your LVL code to deal with it.  You can let the app run but
check the next time it is run with wifi available and then maybe stop
checking altogether after a while.

On Jun 18, 4:31 pm, Zsolt Vasvari zvasv...@gmail.com wrote:
 This has become an issue recently for me -- no doubt because of the
 rise in the number of WIFI-only devices:

 I am using the Google LVL to do license checking.  I am taking the
 license validity time stamp in the extras and using that or the 2
 days, whichever is less.  (I think Google only gives 24 hrs.)

 But what happens after 2 days is my user is out using her WIFI-only
 device out of WIFI range and the license validity period expires and
 they are denied access and they are pissed.  I do pop up a message to
 enable the Internet, but if they cannot, they cannot.

 I think this will become a more serious issue over time -- how do you
 guys deal with this, if at all?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: again like all : The application ... (process ...) has stopped unexpectedly. Please try again

2011-06-19 Thread Greg Krimer
Hi aMeeN

The LogCat view is your friend. The cause of the error will always be
displayed there. To display the LogCat view in the current perspective in
Eclipse go to Window-Show View-Other-Android-LogCat.

When I ran your code, I saw this in the LogCat view:

06-19 21:34:29.586: ERROR/AndroidRuntime(279): FATAL EXCEPTION: main
06-19 21:34:29.586: ERROR/AndroidRuntime(279): java.lang.RuntimeException:
Unable to start activity
ComponentInfo{ameen.android.silentModeToggle/ameen.android.silentModeToggle.SilentModelToggleActivity}:
java.lang.NullPointerException
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
android.os.Handler.dispatchMessage(Handler.java:99)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
android.os.Looper.loop(Looper.java:123)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
android.app.ActivityThread.main(ActivityThread.java:4627)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
java.lang.reflect.Method.invokeNative(Native Method)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
java.lang.reflect.Method.invoke(Method.java:521)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
dalvik.system.NativeStart.main(Native Method)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): Caused by:
java.lang.NullPointerException
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
ameen.android.silentModeToggle.SilentModelToggleActivity.onCreate(SilentModelToggleActivity.java:22)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
06-19 21:34:29.586: ERROR/AndroidRuntime(279): ... 11 more

As you can see, the cause of the problem is just a NullPointerException on
line 22 of your activity owing to the fact that mAudioManager is used before
it is unitialized. You initialize it on line 28. I was able to get your app
to run by uncommenting the code and changing the onCreate() method to the
following:

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

mAudioManager = (AudioManager)getSystemService(AUDIO_SERVICE);
int ringerMode = mAudioManager.getRingerMode();

checkIfPhoneIsSilent();

setButtonClickListener();
}

Not a bad first Android app!

On Sun, Jun 19, 2011 at 8:46 AM, aMeeN ameen.ra...@gmail.com wrote:

 Hello All,


 I downloaded Eclipse Java (this time) and did all the integration and
 linking with Android SDK after I finished ...
 I tried to run the application again .. but unfortunately getting the
 same error.

 I am seriously started thinking to give up   with android
 development .. this is one bug takes me around 10 days

 I will give it some more tries and will see.


 On Jun 18, 11:14 am, aMeeN ameen.ra...@gmail.com wrote:
  Thank you Mr. Zsolt for your help.
 
  I wasn't sure about the error reason, Android and Eclipse both are new
  to me .. thats why I am confused.
 
  I will try to download Eclipse and prepare the development environment
  again.
 
  Hope it will work properly .. I will update this post with the
  result.
 
  Thanks again.
 
  On Jun 18, 7:29 am, Zsolt Vasvari zvasv...@gmail.com wrote:
 
 
 
 
 
 
 
   Why do you think the error is caused by your code?  The stack trace
   you are showing has got something to do with Eclipse, not an Android
   application.
 
   On Jun 17, 10:25 pm, aMeeN ameen.ra...@gmail.com wrote:
 
I am writing my first Andoid application. And facing an error .. I
consider it too strange but also expecting to face a lot of strange
errors and bugs.
 
I googled to find out what cause that error. And tried to learn how
 to
debug Android application on Eclipse but no luck.
 
The application I am writing is having only an image and button. The
button is to switch the mobile from normal mode to silent mode and
 the
reverse and the image is an indicator the for which mode currently is
active.
 
When I got the error I highlighted all the the code and started
unhighlighting one by one, till I found the this line 

Re: [android-developers] new Fragments

2011-06-19 Thread Dianne Hackborn
That log is just a warning, and unrelated fragments, and not causing such an
issue.

Let's still step back -- are you actually having a fragment displayed at
all?  Make sure you are actually getting it displayed before then trying to
hide and show it.  (And after adding a fragment starts out shown so there is
no reason to hide it unless you are doing some special specific stuff.)

On Sun, Jun 19, 2011 at 12:18 PM, New Developer secur...@isscp.com wrote:

 To Dianne

 Thank you for all your support

 I have managed to get the fragment concept working

 I call  show()
 FragmentTransaction fMgr = getFragmentManager().beginTransaction();
  fMgr.show(visitScreen);
  fMgr.commit();

 And then when done I call hide()
 FragmentTransaction fMgr = getFragmentManager().beginTransaction();
  fMgr.hide(visitScreen);
  fMgr.commit();


 I just have a new problem  But When I recall the function with the .show()

 06-19 15:17:50.720: WARN/InputManagerService(21637): Window already
 focused, ignoring focus gain of:
 com.android.internal.view.IInputMethodClient$Stub$Proxy@4169e988

 and Do not see the  Fragment  ?  any ideas

 Thanks again for everything




 On Jun 19, 2011, at 1:40 AM, Dianne Hackborn wrote:

 Committing a fragment transaction is asynchronous.  You should let it run
 and do its thing; don't call getView() outside of the fragment's own
 lifecycle.

 Have you tried any of the API demos?  There are lots of them.  I suggest
 starting off with one of those known working demos, found here:


 http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/index.html

 On Sat, Jun 18, 2011 at 8:10 PM, New Developer secur...@isscp.com wrote:

 Here is what I have can you see something obvious

 in my MainActivity  I call the  Fragment using

 FragmentTransaction   fMgr  = getFragmentManager().beginTransaction();
 VisitMenu fragment  = new VisitMenu();
 fMgr.add(R.id.menu2, fragment);
 fMgr.commit();

 fMgr.show(fragment);

 Log.w(CHECK , Check  1 + fragment.getView()
 );
 Log.w(CHECK , Check  2 + fragment.view
 );

 Both Check 1  and Check 2  return NULL

 My Fragment Has this

 public class VisitMenu extends Fragment {
  private  View  parent= null;
  public   View  view  = null;

  @Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container,
 Bundle bundle) {
  view  = inflater.inflate(R.layout.visit_menu, container, false);
  parent= container;
  return view;
  }
 }

 and ideas welcome

 Thanks in advance



 On Jun 18, 2011, at 10:40 PM, New Developer wrote:

 I have the SDK Updater done  and installed the  Compatibility package

 When I putextends   FragmentActivity

 I still get  FragmentActivity cannot be resolved to a type

 With the offer to change to Fragment

 and ideas

 thanks again




 On Jun 18, 2011, at 1:11 AM, Dianne Hackborn wrote:

 Xav's blog post explains how to get the support library, which has
 FragmentActivity, through the SDK updater:

 http://android-developers.blogspot.com/2011/03/fragments-for-all.html

 On Fri, Jun 17, 2011 at 8:16 PM, New Developer secur...@isscp.comwrote:

 Dianne
 Thanks  and yes is was your blogspot article at the bottom that refers to
  FragmentActivity

 But I can not find this anywhere  and when I type it ,  it is unknown

 thanks again

 On Jun 17, 2011, at 7:57 PM, Dianne Hackborn wrote:

 Blog posts:


 http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html
 http://android-developers.blogspot.com/2011/03/fragments-for-all.html

 SDK documentation:

 http://developer.android.com/guide/topics/fundamentals/fragments.html
 http://developer.android.com/reference/android/app/Fragment.html

 I would suggest that for now you ignore the fragment tag; all it is, is
 a convenience for doing certain things.  Learn how to directly use the
 Fragment APIs and how those work with activities, and then once you are done
 with those basic concepts you can throw in fragment layout tags.

 (I should probably adjust the Fragment java doc to reflect this approach
 as well.)

 On Fri, Jun 17, 2011 at 4:42 PM, New Developer secur...@isscp.comwrote:

 Could someone please clarify the method in which to use fragment

 There is a Main Activity which has a  fragment  element within it's
 layout

 this fragment element is then loaded to a class the extends  Fragment
 But does the fragment class then have it's own activity ?  or
 how do you access the elements within the fragment ?
 For discussion let us say the fragment has a Button and EditText

 Under  a normal activity  you could access it with
 (Button) findViewbyId(R.id.button);   but when I put this into a
 fragment extended class
 findViewById  gives an error ?

 Also there is one article on Fragment which has a FragmentActivity  or
 ActivityFragment
 But I can not find this anywhere

 Thanks in advance

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

[android-developers] Re: Android Market Developer Console not updating

2011-06-19 Thread Zsolt Vasvari
No, it's working for me -- surprisingly.

On Jun 20, 5:38 am, Didier Girard didier.gir...@gmail.com wrote:
 For several weeks, I see no updates on the number of downloads. Someone
 observes the same?
 Sincerely,
 Didier

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


[android-developers] Strange device?

2011-06-19 Thread Zsolt Vasvari
As part of my app, if I notice a screen size/DPI combo I haven't
tested on, I pop-up a dialog and ask the user to send me an e-mail
about that.

Here's what I got yesterday:

Display width: 800
Display height: 960
Display DPI: 240


Anybody has a clue as to what kind of device has a 800x960 squarish
screen.  The HDPI indiciates that it's a phone.  I asked the user, but
he hasn't come back to me -- my guess it's something unreleased.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email 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: again like all : The application ... (process ...) has stopped unexpectedly. Please try again

2011-06-19 Thread aMeeN
I learned a new way to debug on eclipse using DDMS

and in LogCat tab I got these details:

06-20 02:16:27.474: DEBUG/AndroidRuntime(5289): 
AndroidRuntime START 
06-20 02:16:27.485: DEBUG/AndroidRuntime(5289): CheckJNI is ON
06-20 02:16:27.735: DEBUG/AndroidRuntime(5289): --- registering native
functions ---
06-20 02:16:28.755: DEBUG/AndroidRuntime(5289): Shutting down VM
06-20 02:16:28.755: DEBUG/dalvikvm(5289): Debugger has detached;
object registry had 1 entries
06-20 02:16:28.784: INFO/AndroidRuntime(5289): NOTE: attach of thread
'Binder Thread #3' failed
06-20 02:16:29.364: DEBUG/AndroidRuntime(5297): 
AndroidRuntime START 
06-20 02:16:29.374: DEBUG/AndroidRuntime(5297): CheckJNI is ON
06-20 02:16:29.624: DEBUG/AndroidRuntime(5297): --- registering native
functions ---
06-20 02:16:31.334: INFO/ActivityManager(59): Starting activity:
Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x1000
cmp=ameen.android.silentModeToggle/.SilentModelToggleActivity }
06-20 02:16:31.644: INFO/ActivityManager(59): Start proc
ameen.android.silentModeToggle for activity
ameen.android.silentModeToggle/.SilentModelToggleActivity: pid=5317
uid=10037 gids={}
06-20 02:16:31.684: DEBUG/AndroidRuntime(5297): Shutting down VM
06-20 02:16:31.704: DEBUG/dalvikvm(5297): Debugger has detached;
object registry had 1 entries
06-20 02:16:31.755: INFO/AndroidRuntime(5297): NOTE: attach of thread
'Binder Thread #3' failed
06-20 02:16:33.024: DEBUG/dalvikvm(5317): GC_EXTERNAL_ALLOC freed 638
objects / 51312 bytes in 87ms
06-20 02:16:33.074: DEBUG/AndroidRuntime(5317): Shutting down VM
06-20 02:16:33.074: WARN/dalvikvm(5317): threadid=1: thread exiting
with uncaught exception (group=0x4001d800)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): FATAL EXCEPTION: main
06-20 02:16:33.104: ERROR/AndroidRuntime(5317):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{ameen.android.silentModeToggle/
ameen.android.silentModeToggle.SilentModelToggleActivity}:
java.lang.NullPointerException
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2663)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
android.os.Handler.dispatchMessage(Handler.java:99)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
android.os.Looper.loop(Looper.java:123)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
android.app.ActivityThread.main(ActivityThread.java:4627)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
java.lang.reflect.Method.invokeNative(Native Method)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
java.lang.reflect.Method.invoke(Method.java:521)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
dalvik.system.NativeStart.main(Native Method)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): Caused by:
java.lang.NullPointerException
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
ameen.android.silentModeToggle.SilentModelToggleActivity.onCreate(SilentModelToggleActivity.java:
22)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2627)
06-20 02:16:33.104: ERROR/AndroidRuntime(5317): ... 11 more
06-20 02:16:33.134: WARN/ActivityManager(59):   Force finishing
activity ameen.android.silentModeToggle/.SilentModelToggleActivity
06-20 02:16:33.688: WARN/ActivityManager(59): Activity pause timeout
for HistoryRecord{44ea3408
ameen.android.silentModeToggle/.SilentModelToggleActivity}
06-20 02:16:44.662: WARN/ActivityManager(59): Activity destroy timeout
for HistoryRecord{44ea3408
ameen.android.silentModeToggle/.SilentModelToggleActivity}
06-20 02:16:44.724: DEBUG/SntpClient(59): request time failed:
java.net.SocketException: Address family not supported by protocol
06-20 02:18:03.184: INFO/Process(5317): Sending signal. PID: 5317 SIG:
9
06-20 02:18:03.204: INFO/ActivityManager(59): Process
ameen.android.silentModeToggle (pid 5317) has died.
06-20 02:18:03.275: WARN/InputManagerService(59): Window already
focused, ignoring focus gain of:
com.android.internal.view.IInputMethodClient$Stub$Proxy@450c99c8

but I understand noting =(


I appreciate any help ... thanks in advance =D

On Jun 19, 

[android-developers] Re: again like all : The application ... (process ...) has stopped unexpectedly. Please try again

2011-06-19 Thread aMeeN
HELLO Dear Greg,

YAH   IT WORKS IT WORKS

THANK YOU   THANK YOU  THANK YOU S MUCH

I really appreciate your help ... you rescued me from giving up ...

for(i = 1 ; i  0; i++)
{
Thank you man .. you saved me time XD
}

aMeeN


On Jun 20, 12:42 am, Greg Krimer gkri...@gmail.com wrote:
 Hi aMeeN

 The LogCat view is your friend. The cause of the error will always be
 displayed there. To display the LogCat view in the current perspective in
 Eclipse go to Window-Show View-Other-Android-LogCat.

 When I ran your code, I saw this in the LogCat view:

 06-19 21:34:29.586: ERROR/AndroidRuntime(279): FATAL EXCEPTION: main
 06-19 21:34:29.586: ERROR/AndroidRuntime(279): java.lang.RuntimeException:
 Unable to start activity
 ComponentInfo{ameen.android.silentModeToggle/ameen.android.silentModeToggle 
 .SilentModelToggleActivity}:
 java.lang.NullPointerException
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 android.app.ActivityThread.access$2300(ActivityThread.java:125)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 android.os.Handler.dispatchMessage(Handler.java:99)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 android.os.Looper.loop(Looper.java:123)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 android.app.ActivityThread.main(ActivityThread.java:4627)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 java.lang.reflect.Method.invokeNative(Native Method)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 java.lang.reflect.Method.invoke(Method.java:521)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java: 
 868)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 dalvik.system.NativeStart.main(Native Method)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279): Caused by:
 java.lang.NullPointerException
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 ameen.android.silentModeToggle.SilentModelToggleActivity.onCreate(SilentMod 
 elToggleActivity.java:22)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     at
 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
 06-19 21:34:29.586: ERROR/AndroidRuntime(279):     ... 11 more

 As you can see, the cause of the problem is just a NullPointerException on
 line 22 of your activity owing to the fact that mAudioManager is used before
 it is unitialized. You initialize it on line 28. I was able to get your app
 to run by uncommenting the code and changing the onCreate() method to the
 following:

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

         mAudioManager = (AudioManager)getSystemService(AUDIO_SERVICE);
         int ringerMode = mAudioManager.getRingerMode();

         checkIfPhoneIsSilent();

         setButtonClickListener();
     }

 Not a bad first Android app!







 On Sun, Jun 19, 2011 at 8:46 AM, aMeeN ameen.ra...@gmail.com wrote:
  Hello All,

  I downloaded Eclipse Java (this time) and did all the integration and
  linking with Android SDK after I finished ...
  I tried to run the application again .. but unfortunately getting the
  same error.

  I am seriously started thinking to give up   with android
  development .. this is one bug takes me around 10 days

  I will give it some more tries and will see.

  On Jun 18, 11:14 am, aMeeN ameen.ra...@gmail.com wrote:
   Thank you Mr. Zsolt for your help.

   I wasn't sure about the error reason, Android and Eclipse both are new
   to me .. thats why I am confused.

   I will try to download Eclipse and prepare the development environment
   again.

   Hope it will work properly .. I will update this post with the
   result.

   Thanks again.

   On Jun 18, 7:29 am, Zsolt Vasvari zvasv...@gmail.com wrote:

Why do you think the error is caused by your code?  The stack trace
you are showing has got something to do with Eclipse, not an Android
application.

On Jun 17, 10:25 pm, aMeeN ameen.ra...@gmail.com wrote:

 I am writing my first Andoid application. And facing an error .. I
 consider it too strange but also expecting to face a lot of strange
 errors and bugs.

 I googled to find out what cause that error. And tried to learn how
  to
 debug 

[android-developers] Re: debugging in eclipse and CONFIRM keyword???

2011-06-19 Thread Doug
If you have an app that force closes but don't share what your code is
or what your stack trace is, probably people can't help you.

You are not obliged to use the visual creation tools for layouts.  You
can just edit the XML directly, which is probably where most people do
their layout work.

Doug

On Jun 18, 12:36 am, Budi Wibowo budiat...@gmail.com wrote:
 Hello group,
 I'm a beginner in developing in android. I'm used to using visual
 studio for my IDE.

 here is a problem i'm having. When i launched an app in AVD, it keeps
 on forcing me to close. i tried to debug it using the debug feature in
 eclipse.

 i don't know if it's just me because i still know very little, or
 what. so far,  I find the debugging feature in eclipse when debugging
 android app. well, very useless.

 this is an example:
 i have a button, and i'm trying to create a listener for the button.

 i name the button id confirm (Id      @+id/confirm)

 i spent hours trying to debug my code, with no useful info from logcat
 or the debugger itself. maybe there is a feature in this book i'm
 using that i haven't gotten to yet.

 after 2 hours, i find out that if i change the button id to something
 else like confirm1 (Id        @+id/confirm1), everything works
 perfectly!!!
 if i change the id back to confirm, it forces close again when i run
 the app. I can only assume that confirm is somehow a reserved word,
 and the debugger didn't tell me that.

 is confirm really a RESERVED word??

 another thing that annoy me A LOT is the Properties tab. When i'm
 building a layout, there is no way i'm going to remember all the XML
 attributes for every form widgets. therefore, i rely a lot on the GUI
 and the Properties tab to set the value of my widgets(i.e setting the
 text value of my button, color of my background, etc).

 i could never get this to work. say that i have 4 buttons on a layout.
 and i need to see the properties of button 4. logically, this is what
 you would do:
 click on the properties tab, and click on button 4.

 this does NOT work. I have to do the following:
 - click properties tab
 - click button 4 (properties display doesn't change)
 - i need to click on some other tab, like console, or log cat
 - click on properties tab again
 - click on button 4 again. still the properties is not updating.
 - click on different tab again
 - click on properties again
 - click on button 4 again, and the view magically switch to some other
 tab(unpredictable which tab it will land on)
 - click on properties again
 - click on button 4 again.. BINGO. Now i can see the
 properties.

 AM I CRAZY or JUST DUMB

 can a more seasoned android developer tell me more about the problems
 i describe above?

 I would really appreciate any input.

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

2011-06-19 Thread Rakshith S Kumar
I do understand your question. Android is not a kind of platform that you
learn and you get a job for that in a company. If you are really serious of
your career in android its better to do it with few friends rather than for
some small companies which live on such kind of apps.

On Thu, Jun 16, 2011 at 12:31 PM, jeniffer hills saloni9...@gmail.comwrote:

 hey ol!!
 well m  doin engg wid cs deptt. n rcntly m done wid my 4th sem xams.
 few dayz back i hv learnt about android apps n also registerd for the
 same. Though i hv learnt dat in future android may achieve sm demand
 in the market. still i hv a cnfusion regardin d CAREER IN ANDROID as
 android apps r used only in cellphones. dere is no pc or laptop wch is
 based on android apps so far. i hv several ques in my mind like
 1. is dere any career in android apps?
 2. hw good it is frm career point of view?
 3. cellphons r smthing wch will olwayz be in demand so r dere
 sufficient nmbr of cmpanies dat provide gadgets based on android apps?
 4. in outside country, is android a good technology wch hav a good
 demand and future as well?
 5. in a career for engg, wat is more imprtnt? a good programming
 skills or knowldge of sch apps.
 ladies n gentlements plz go thru my quries n help me out by tellin me
 ol ups n dwns of android apps n guiding me for selecting a crrct path
 for a good future carrer.

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

2011-06-19 Thread New Developer
Thanks

Yes it is displaying (the first time)  then I hide it  so I can use that 
portion of the screen for other things
and then I try to go back an reshow it  But it gives the error and  then
  shows  nothing.

So it will show  and then hide  the first time around,   but will not show the 
second time around.

thanks again for all your help


On Jun 19, 2011, at 6:37 PM, Dianne Hackborn wrote:

 That log is just a warning, and unrelated fragments, and not causing such an 
 issue.
 
 Let's still step back -- are you actually having a fragment displayed at all? 
  Make sure you are actually getting it displayed before then trying to hide 
 and show it.  (And after adding a fragment starts out shown so there is no 
 reason to hide it unless you are doing some special specific stuff.)
 
 On Sun, Jun 19, 2011 at 12:18 PM, New Developer secur...@isscp.com wrote:
 To Dianne
 
 Thank you for all your support
 
 I have managed to get the fragment concept working
 
 I call  show()
   FragmentTransaction fMgr = getFragmentManager().beginTransaction();
   fMgr.show(visitScreen); 
   fMgr.commit();
 
 And then when done I call hide()
   FragmentTransaction fMgr = getFragmentManager().beginTransaction();
   fMgr.hide(visitScreen);
   fMgr.commit();
 
 
 I just have a new problem  But When I recall the function with the .show()
 
 06-19 15:17:50.720: WARN/InputManagerService(21637): Window already focused, 
 ignoring focus gain of: 
 com.android.internal.view.IInputMethodClient$Stub$Proxy@4169e988
 
 and Do not see the  Fragment  ?  any ideas
 
 Thanks again for everything
 
 
 
 
 On Jun 19, 2011, at 1:40 AM, Dianne Hackborn wrote:
 
 Committing a fragment transaction is asynchronous.  You should let it run 
 and do its thing; don't call getView() outside of the fragment's own 
 lifecycle.
 
 Have you tried any of the API demos?  There are lots of them.  I suggest 
 starting off with one of those known working demos, found here:
 
 http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/index.html
 
 On Sat, Jun 18, 2011 at 8:10 PM, New Developer secur...@isscp.com wrote:
 Here is what I have can you see something obvious
 
 in my MainActivity  I call the  Fragment using
 
 FragmentTransaction   fMgr  = getFragmentManager().beginTransaction();
 VisitMenu fragment  = new VisitMenu(); 
 fMgr.add(R.id.menu2, fragment);
 fMgr.commit();
  
 fMgr.show(fragment);
  
 Log.w(CHECK , Check  1 + fragment.getView()   );
 Log.w(CHECK , Check  2 + fragment.view);
 
 Both Check 1  and Check 2  return NULL
 
 My Fragment Has this
 
 public class VisitMenu extends Fragment {
  private  View  parent= null;
  public   View  view  = null;
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, 
 Bundle bundle) {
  view  = inflater.inflate(R.layout.visit_menu, container, 
 false);
  parent= container;
  return view;
  }
 }
 
 and ideas welcome
 
 Thanks in advance
 
 
 
 On Jun 18, 2011, at 10:40 PM, New Developer wrote:
 
 I have the SDK Updater done  and installed the  Compatibility package
 
 When I putextends   FragmentActivity
 
 I still get  FragmentActivity cannot be resolved to a type
 
 With the offer to change to Fragment
 
 and ideas
 
 thanks again
 
 
 
 
 On Jun 18, 2011, at 1:11 AM, Dianne Hackborn wrote:
 
 Xav's blog post explains how to get the support library, which has 
 FragmentActivity, through the SDK updater:
 
 http://android-developers.blogspot.com/2011/03/fragments-for-all.html
 
 On Fri, Jun 17, 2011 at 8:16 PM, New Developer secur...@isscp.com wrote:
 Dianne
 Thanks  and yes is was your blogspot article at the bottom that refers to  
 FragmentActivity
 
 But I can not find this anywhere  and when I type it ,  it is unknown
 
 thanks again
 
 On Jun 17, 2011, at 7:57 PM, Dianne Hackborn wrote:
 
 Blog posts:
 
 http://android-developers.blogspot.com/2011/02/android-30-fragments-api.html
 http://android-developers.blogspot.com/2011/03/fragments-for-all.html
 
 SDK documentation:
 
 http://developer.android.com/guide/topics/fundamentals/fragments.html
 http://developer.android.com/reference/android/app/Fragment.html
 
 I would suggest that for now you ignore the fragment tag; all it is, is 
 a convenience for doing certain things.  Learn how to directly use the 
 Fragment APIs and how those work with activities, and then once you are 
 done with those basic concepts you can throw in fragment layout tags.
 
 (I should probably adjust the Fragment java doc to reflect this approach 
 as well.)
 
 On Fri, Jun 17, 2011 at 4:42 PM, New Developer secur...@isscp.com wrote:
 Could someone please clarify the method in which to use fragment
 
 There is a Main Activity which has a  fragment  element within it's 
 layout
 
 this fragment element is then loaded to a 

[android-developers] Re: debugging in eclipse and CONFIRM keyword???

2011-06-19 Thread Chris
i could never get this to work. say that i have 4 buttons on a layout.
and i need to see the properties of button 4. logically, this is what
you would do:
click on the properties tab, and click on button 4.

this does NOT work. I have to do the following:

This will be fixed http://tools.android.com/recent/adt12bugfixroundup in 
the next ADT release.  Pretty sure its available nowish if you're crafty.


AM I CRAZY or JUST DUMB

You tell us.

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

[android-developers] AudioTrack cant not play sound on device with FM?

2011-06-19 Thread Baodong Chen
Hi all:
  i have a APP using AudioTrack to play pcm buffers,it works well on
some devices.
  but when the device have FM, my APP can not make the sound, can someone give
  some advice?
  I used AudioTrack.MODE_STREAM and AudioManager.STREAM_MUSIC when new
AudioTrack();

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


[android-developers] Re: Dialog and Progress Dialog issues on Orientation Change

2011-06-19 Thread sahana uday
Hi,
I understood what you were trying to say. Here's what I;'m doing now:

class ConnectionsListAddScreen extends Activity{
   public void onCreate(Bundle savedInstState){
super.onCreate(savedInstState);
//here on particular button click
new ConnReqSenderAsyncTask().execute();

   }

   protected Dialog onCreateDialog(int id) {
Dialog dialog = new Dialog(ConnectionsListAddScreen.this);
switch(id){
case Constants.LOGIN_DIALOG:ProgressDialog pg = new
ProgressDialog(ConnectionsListAddScreen.this);
pg.setMessage(//some 
string);
pg.setCancelable(true);
dialog = pg;
break;
default:return super.onCreateDialog(id);

}
return dialog;
}

}

private class ConnReqSenderAsyncTask extends
AsyncTaskVoid,Void,Void{

protected Void doInBackground(Void... params) {
  //send request to server
  return null;
}

protected void onPreExecute() {
super.onPreExecute();
showDialog(Constants.LOGIN_DIALOG);
}

protected void onPostExecute(Void result) {
super.onPostExecute(result);
dismissDialog(Constants.LOGIN_DIALOG);
}
}

If the above is right. Then the problem is on Orientation Change it
throws below exception:

FATAL EXCEPTION: main
java.lang.IllegalArgumentException: no dialog with id 5 was ever shown
via Activity#showDialog
at android.app.Activity.missingDialog(Activity.java:2590)
at android.app.Activity.dismissDialog(Activity.java:2575)
at com.sap.explorer.view.ConnectionsListAddScreen
$ConnReqSenderAsyncTask.onPostExecute(ConnectionsListAddScreen.java:
699)
at com.sap.explorer.view.ConnectionsListAddScreen
$ConnReqSenderAsyncTask.onPostExecute(ConnectionsListAddScreen.java:1)
at android.os.AsyncTask.finish(AsyncTask.java:417)
at android.os.AsyncTask.access$300(AsyncTask.java:127)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:
429)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)

Since we are using showDialog(...) and onCreateDialog(...) for
ProgressDialog display, then shouldn't Android keep a reference of
same on orientation change. Can you let me know if there are any
mistakes in my code or solution to my problem asap.


On Jun 16, 4:02 pm, sahana uday sahanau...@gmail.com wrote:
 Hi,
 Yes I'm sending the request to server in onCreateDialog(), but its an
 AsyncTask.
 In onPreExecute() show theprogressdialogand onPostExecute() cancel
 theprogressdialog.

 Off late I have anotherissuein computing textview height, I have
 posted thisissueon a separate thread also.
 The issues is:
         How to compute TextView Height before its laid out on screen?

         I'm not aware how we can use getPaint().ascent() or descent()
 method
         for computing height?

         Can you please provide an example

 On Jun 6, 6:38 pm, Streets Of Boston flyingdutc...@gmail.com wrote:

  Are you sending a request to the server in the implementation of the
  'onCreateDialog(...)' method? If so, this is not good. The onCreateDialog is
  called by the OS when the hosting activity is recreated due to a config
 changewhen adialogis shown using the showDialog method (i.e. an
  activity-manageddialog). This is perfectly normal behavior.

  Call 'showDialog' just *after *you send an (asynchronous) request to the
  server and call 'dismissDialog' when the server returns a response. Usually,
  do not code anything in the onCreateDialog except for building an
  AlertDialog object.



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


[android-developers] how to handle navigation between activities?

2011-06-19 Thread Hitendrasinh Gohil
Hi,

Can anybody tell me what is the best way to do a navigation between
activities.
Like i am calling one activity from other and finishing the current
activity.

startActivity(intent);
finish();

But if i finish activity the i have to manage back functionality by
putting some values to intent.
If i am not going to finish the activity than is there any performance
or memory related issues.

when we should call startActivityForResult?

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

2011-06-19 Thread TreKing
On Sun, Jun 19, 2011 at 11:05 PM, Hitendrasinh Gohil 
hitendra.virtuei...@gmail.com wrote:

 Like i am calling one activity from other and finishing the current
 activity.

 startActivity(intent);
 finish();


Why?


 But if i finish activity the i have to manage back functionality by putting
 some values to intent.


Then don't finish the current activity.


 If i am not going to finish the activity than is there any performance
 or memory related issues.


No, the system will kill your inactive activities if need be. Just make sure
to handle the lifecycle methods correctly.


 when we should call startActivityForResult?


When you're starting an activity and need a result ...

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

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

[android-developers] skia / purging [x]k from font cache [y entries] - what does it mean? was Re: Custom Fonts

2011-06-19 Thread Adam Ratana
Hello, I am noticing the same with an implementation for some new 
functionality I'm experimenting with.  I am doing a lot of canvas.drawText 
calls on a custom View canvas, using the system font though.  Are you doing 
canvas.drawText a lot, Samuh?

Also a bump in case anyone reading has knowledge on this subject. 
 Wondering am I doing something stupid here, trying to avoid jankiness.


On Wednesday, June 1, 2011 2:10:27 PM UTC-4, Samuh wrote:

 We are using four different custom fonts across our app. These files 
 are bundled in Assets and are opened in onCreate of every Activity. 

 While studying the logs of our app we keep observing the following log 
 from Skia decoder. 

 01-01 19:19:51.585: DEBUG/skia(1510): purging 197K from font cache [20 
 entries] 

 What does the above mean? And how does it affect performance? 

 Is it desirable? 

 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] skia / purging [x]k from font cache [y entries] - what does it mean? was Re: Custom Fonts

2011-06-19 Thread Dianne Hackborn
It just means it needs to flush old data from the font cache.  You may see
this a lot if you are for example drawing at a large number of sizes, as you
fill up the font cache with glyphs in a lot of sizes and old glyphs need to
be removed to make room.

On Sun, Jun 19, 2011 at 9:17 PM, Adam Ratana adam.rat...@gmail.com wrote:

 Hello, I am noticing the same with an implementation for some new
 functionality I'm experimenting with.  I am doing a lot of canvas.drawText
 calls on a custom View canvas, using the system font though.  Are you doing
 canvas.drawText a lot, Samuh?

 Also a bump in case anyone reading has knowledge on this subject.
  Wondering am I doing something stupid here, trying to avoid jankiness.


 On Wednesday, June 1, 2011 2:10:27 PM UTC-4, Samuh wrote:

 We are using four different custom fonts across our app. These files
 are bundled in Assets and are opened in onCreate of every Activity.

 While studying the logs of our app we keep observing the following log
 from Skia decoder.

 01-01 19:19:51.585: DEBUG/skia(1510): purging 197K from font cache [20
 entries]

 What does the above mean? And how does it affect performance?

 Is it desirable?

 Thanks.

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




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

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

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

[android-developers] Re: Dialog and Progress Dialog issues on Orientation Change

2011-06-19 Thread William Ferguson
Android doesn't handle rotation and dialogs particularly well, mainly
due to rotation causing the Activity to be destroyed and a new one
created. This leaves Dialogs with an invalid Context. Using managed
dialogs (like you are) just shifts the problem, otherwise you get
java.lang.IllegalArgumentException: View not attached to window
manager instead.

In Froyo and below calling dismissDialog for an Activity that has
already been destroyed causes the Exception you noted. As far as I can
recall, Gingerbread logs a message but swallows the Exception. I have
tended to add a try/catch around dismissDialog to handle the pre
Gingerbread cases.

You can configure your Activity to stop rotation occurring, or your
can code your Activity to handle rotation.
But as Streets of Boston says, you don't want to be firing off your
AsyncTask in onCreate, at least not without checking to see whether
this Activity has already been started/destroyed due to rotation. See
#getLastNonConfigurationInstance.



On Jun 20, 1:52 pm, sahana uday sahanau...@gmail.com wrote:
 Hi,
 I understood what you were trying to say. Here's what I;'m doing now:

 class ConnectionsListAddScreen extends Activity{
        public void onCreate(Bundle savedInstState){
             super.onCreate(savedInstState);
             //here on particular button click
             new ConnReqSenderAsyncTask().execute();

        }

        protected Dialog onCreateDialog(int id) {
                 Dialog dialog = new Dialog(ConnectionsListAddScreen.this);
                 switch(id){
                         case Constants.LOGIN_DIALOG:    ProgressDialog pg = 
 new
 ProgressDialog(ConnectionsListAddScreen.this);
                                                         pg.setMessage(//some 
 string);
                                                         
 pg.setCancelable(true);
                                                         dialog = pg;
                                                         break;
                         default:        return super.onCreateDialog(id);

                 }
                 return dialog;
         }

 }

 private class ConnReqSenderAsyncTask extends
 AsyncTaskVoid,Void,Void{

         protected Void doInBackground(Void... params) {
               //send request to server
               return null;
         }

         protected void onPreExecute() {
                 super.onPreExecute();
                 showDialog(Constants.LOGIN_DIALOG);
         }

         protected void onPostExecute(Void result) {
                 super.onPostExecute(result);
                 dismissDialog(Constants.LOGIN_DIALOG);
         }

 }

 If the above is right. Then the problem is on Orientation Change it
 throws below exception:

 FATAL EXCEPTION: main
 java.lang.IllegalArgumentException: no dialog with id 5 was ever shown
 via Activity#showDialog
 at android.app.Activity.missingDialog(Activity.java:2590)
 at android.app.Activity.dismissDialog(Activity.java:2575)
 at com.sap.explorer.view.ConnectionsListAddScreen
 $ConnReqSenderAsyncTask.onPostExecute(ConnectionsListAddScreen.java:
 699)
 at com.sap.explorer.view.ConnectionsListAddScreen
 $ConnReqSenderAsyncTask.onPostExecute(ConnectionsListAddScreen.java:1)
 at android.os.AsyncTask.finish(AsyncTask.java:417)
 at android.os.AsyncTask.access$300(AsyncTask.java:127)
 at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:
 429)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loop(Looper.java:123)
 at android.app.ActivityThread.main(ActivityThread.java:4627)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:521)
 at com.android.internal.os.ZygoteInit
 $MethodAndArgsCaller.run(ZygoteInit.java:868)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)

 Since we are using showDialog(...) and onCreateDialog(...) for
 ProgressDialog display, then shouldn't Android keep a reference of
 same on orientation change. Can you let me know if there are any
 mistakes in my code or solution to my problem asap.

 On Jun 16, 4:02 pm, sahana uday sahanau...@gmail.com wrote:







  Hi,
  Yes I'm sending the request to server in onCreateDialog(), but its an
  AsyncTask.
  In onPreExecute() show theprogressdialogand onPostExecute() cancel
  theprogressdialog.

  Off late I have anotherissuein computing textview height, I have
  posted thisissueon a separate thread also.
  The issues is:
          How to compute TextView Height before its laid out on screen?

          I'm not aware how we can use getPaint().ascent() or descent()
  method
          for computing height?

          Can you please provide an example

  On Jun 6, 6:38 pm, Streets Of Boston flyingdutc...@gmail.com wrote:

   Are you sending a request to the server in the implementation of the
   'onCreateDialog(...)' method? If so, this is not good. The onCreateDialog 
   is
   called by the OS when the hosting activity is recreated 

Re: [android-developers] Strange device?

2011-06-19 Thread Jitesh dedhiya
Yeah i think its not released yet but this kind of phone may be this one
http://worldofphones.net/?p=4487

On Mon, Jun 20, 2011 at 4:26 AM, Zsolt Vasvari zvasv...@gmail.com wrote:

 As part of my app, if I notice a screen size/DPI combo I haven't
 tested on, I pop-up a dialog and ask the user to send me an e-mail
 about that.

 Here's what I got yesterday:

 Display width: 800
 Display height: 960
 Display DPI: 240


 Anybody has a clue as to what kind of device has a 800x960 squarish
 screen.  The HDPI indiciates that it's a phone.  I asked the user, but
 he hasn't come back to me -- my guess it's something unreleased.

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




-- 
--Jitesh .V. Dedhiya---

Don't Learn To Hack but Hack To Learn

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

2011-06-19 Thread ABS
Here is the code that i wrote to connect with printer socket.
I hope u will reply me ASAP,bcz i have to release my application.

package com.ob;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.Iterator;
import java.util.Set;
import java.util.UUID;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.app.AlertDialog.Builder;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothServerSocket;
import android.bluetooth.BluetoothSocket;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.DialogInterface.OnCancelListener;
import android.os.Bundle;
import android.util.Log;

public class BluetoothPaired extends Activity {

private static final int REQUEST_ENABLE_BT = 2;
private BluetoothAdapter bluetoothAdapter;
private UUID applicationUUID = java.util.UUID.randomUUID();
private static final String logTag = BluetoothTest;
boolean rePrintFlag;
int offenceCount = 0;
int licOffenceCount = 0;
static int dataSize;
int status = 0x00;
static int[] dataPacket = new int[2000];
String chain=\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0;
String key = ranjeetkumar1984;
char[] szEncData = new char[16];
public static DataOutputStream dos = null;
  String Devicesfound =null;
  UUID MY_UUID=null;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (bluetoothAdapter == null) {
Log.d(logTag, Could not get bluetooth adapter);
return;
}
searchForDevices();
}

@Override
protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_ENABLE_BT) {
if (requestCode == RESULT_OK) {
Log.d(BluetoothTest, bluetooth enabled);
searchForDevices();
} else {
Log.d(BluetoothTest, Could not enable bluetooth
device);
}
}

}

public void lineReadFromBluetoothDevice(String line) {
Log.d(logTag, Mottok:  + line);
}

private void searchForDevices() {

Intent discoverableIntent = new
Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);

discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION,
300);
startActivity(discoverableIntent);
bluetoothAdapter.startDiscovery();

if (bluetoothAdapter.isEnabled()) {
SetBluetoothDevice devicesAvailable =
bluetoothAdapter.getBondedDevices();
System.out.println(set of devices available
==+devicesAvailable);
if(devicesAvailable.size() 0)
{
for ( BluetoothDevice device : devicesAvailable) {
 Devicesfound +=device.getAddress()+~;
 System.out.println(==+device.getName()+
+device.getAddress()+\n);
   }
}
if (devicesAvailable.isEmpty()) {
informUserNoDevicesPaired();
} else {
askUserToPickDeviceToUse(devicesAvailable);
}
} else {
Intent enableBtIntent = new
Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
}
}

private void askUserToPickDeviceToUse(SetBluetoothDevice
devicesAvailable) {

  for (Iterator iterator = devicesAvailable.iterator();
iterator.hasNext();) {
BluetoothDevice bluetoothDevice = (BluetoothDevice) 
iterator.next();
if(bluetoothDevice.getAddress().equalsIgnoreCase(00:0A:3A:
74:61:4A))
{
 pairToDevice((BluetoothDevice)bluetoothDevice );
}
}

}

private void informUserNoDevicesPaired() {
Builder dialogBuilder = new AlertDialog.Builder(this);
dialogBuilder.setMessage(No user device paired);
dialogBuilder.setPositiveButton(Ok, new
DialogInterface.OnClickListener() {

public void onClick(DialogInterface dialog, int arg1) {
dialog.dismiss();

}
});
dialogBuilder.setOnCancelListener(new OnCancelListener() {

public void onCancel(DialogInterface dialog) {
dialog.dismiss();
finish();
}
});
dialogBuilder.show();
}

private void showError(String message) {
Builder dialogBuilder = new AlertDialog.Builder(this);
dialogBuilder.setMessage(Error + message);
dialogBuilder.setOnCancelListener(new OnCancelListener() {

public void onCancel(DialogInterface dialog) {
dialog.dismiss();
finish();
}
});
dialogBuilder.show();
}

private void pairToDevice(BluetoothDevice bluetoothDevice) {
System.out.println(Socket opening for 

[android-developers] Android Camera

2011-06-19 Thread FAISON N.P
Hi all,

Can anybody tell me what is the best way to do a camera in
portrait mode in version 2.1?

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