[android-developers] Re: headset button

2009-02-01 Thread Nick Pelly
For wired headsets, you can use Intent.ACTION_MEDIA_BUTTON as mentioned in
the other thread. This is how the built in media app does pause/play on
wired headset button presses, and where I recommend that you hook in.

For Bluetooth headsets, they do not work like you think. There is no 'button
pressed event' sent by the headset. We don't know when the button is
pressed. Instead the headset maps its buttons presses to commands depending
on its state machine. We receive commands, not button presses from the
headset.

Nick


On Sat, Jan 31, 2009 at 2:07 AM, deepdr...@googlemail.com 
deepdr...@googlemail.com wrote:


 you may want to look at


 http://groups.google.com/group/android-developers/browse_thread/thread/1c64cf65f87c9895/1d9464c96b91dbd8?show_docid=1d9464c96b91dbd8



 On Jan 30, 8:20 pm, Brodsky peter.brod...@gmail.com wrote:
  Hi!  Does anyone know how to tell when the headset button is being
  pressed?  I'd like to support the usb headsets and possibly bluetooth
  headsets.  My app is a media player and ideally, I could register it
  somewhere so that if no app that uses the headset button has focus it
  button press would act as a play/pause command in my app. If the phone
  is ringing or a call is in progress, I'd like to be sensitive to that
  and let the button do what it normally does: pickup and hang up
  calls.  we've been trying to chase the button down using this:
 
  IntentFilter headsetFilter = new IntentFilter
  (Intent.ACTION_HEADSET_PLUG);
  headsetFilter.addAction
  (android.intent.action.HEADSET_STATE_CHANGED);
  headsetFilter.addAction(android.bluetooth.intent.HEADSET_STATE);
  headsetFilter.addAction
  (android.bluetooth.intent.HEADSET_STATE_CHANGED);
  headsetFilter.addAction
  (android.bluetooth.intent.action.MODE_CHANGED);
  headsetFilter.addAction(android.intent.action.MODE_CHANGED);
 
  no luck as of yet.  Any help would be greatly appreciated!  Thanks!
 


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



[android-developers] Re: Leaked window in PreferenceActivity

2009-02-01 Thread AusR

I did search the forum but due to the low number of preferencescreen
example I couldn't find anything directly concerning both
preferenceactivity AND orientation. :-) I did state in my post I had
been reading the tuts on androidguys, unfortunately there is not a
'merged' example of both.

My stripped down version exhibits the same issue:

test.java:
public class test extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
super.onCreateOptionsMenu(menu);

MenuItem mi;
mi = menu.add(0,0,0,Settings);
mi.setIcon(android.R.drawable.ic_menu_preferences);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case 0:
startActivityForResult(new 
Intent(test.this,ShowSettings.class),
30);
return true;
}
return super.onOptionsItemSelected(item);
}
}

ShowSettings.java:
public class ShowSettings extends PreferenceActivity {

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.layout.settings);
}
}

settings.xml:
PreferenceScreen
xmlns:android=http://schemas.android.com/apk/res/android;
PreferenceCategory
android:title=Other Preference
PreferenceScreen
android:title=Other Preference
android:summary=Other Preference
PreferenceCategory
android:title=Other Preference
/PreferenceCategory
/PreferenceScreen
/PreferenceCategory
PreferenceCategory
android:title=Other Preference
/PreferenceCategory
/PreferenceScreen


If I click to the second preferences screen and change orientation I
get:
02-01 09:12:02.703: INFO/WindowManager(53): Input configuration
changed: { scale=1.0 imsi=0/0 locale=en_US touch=3 key=2/2 nav=3
orien=1 }
02-01 09:12:02.813: ERROR/WindowManager(262): Activity
uk.co.arcdev.android.test.ShowSettings has leaked window
com.android.internal.policy.impl.phonewindow$decorv...@43389f58 that
was originally added here
02-01 09:12:02.813: ERROR/WindowManager(262):
android.view.WindowLeaked: Activity
uk.co.arcdev.android.test.ShowSettings has leaked window
com.android.internal.policy.impl.phonewindow$decorv...@43389f58 that
was originally added here
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.view.ViewRoot.init(ViewRoot.java:178)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:147)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.view.WindowManagerImpl.addView(WindowManagerImpl.java:90)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.view.Window$LocalWindowManager.addView(Window.java:393)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.app.Dialog.show(Dialog.java:212)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.preference.PreferenceScreen.showDialog(PreferenceScreen.java:
160)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.preference.PreferenceScreen.onClick(PreferenceScreen.java:142)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.preference.Preference.performClick(Preference.java:804)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:
182)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.widget.AdapterView.performItemClick(AdapterView.java:283)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.widget.ListView.performItemClick(ListView.java:3049)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.widget.AbsListView$PerformClick.run(AbsListView.java:1415)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.os.Handler.handleCallback(Handler.java:542)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.os.Handler.dispatchMessage(Handler.java:86)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.os.Looper.loop(Looper.java:123)
02-01 09:12:02.813: ERROR/WindowManager(262): at
android.app.ActivityThread.main(ActivityThread.java:3742)
02-01 09:12:02.813: ERROR/WindowManager(262): at
java.lang.reflect.Method.invokeNative(Native Method)
02-01 09:12:02.813: ERROR/WindowManager(262): at
java.lang.reflect.Method.invoke(Method.java:515)
02-01 09:12:02.813: ERROR/WindowManager(262): at

[android-developers] Re: Audio in the emulator...

2009-02-01 Thread Nicolas Cosson
Thanks for the advice,

I work on windows vista,

the audio backend found is:
 winaudioWindows wave audio
But it doesn't work with audio-out and audio-in at the same time for me.
emulator: warning: opening audio output failed

audio-out works alone
I tested it with the sample provided with the sdk when reading ressources.
It doesn't when trying to read the sdcard.

the sdcard isn't readable in settings too, and it won't launch itself from
eclipse with the additionnal emulator command line option, but only from
cmd.exe with the arguments -sdcard sdimg.iso

However, the logcat says this repetitivly when I click on record with
audio-in:
D/AudioHardware   25: AudioStreamInGeneric::read0x40308160, 320 from fd
7

I finally found the sound recorder application you where talking about, I
haven't tested it yet, but the source code is 100* bigger than mine...
http://android.git.kernel.org/?p=platform/packages/apps/SoundRecorder.git;a=blob;f=src/com/android/soundrecorder/Recorder.java;h=5fe41b0b4086b652ee6792d931b251a0799747dc;hb=HEAD



Maybe I have made a mistake somewhere, any help is greatly appreciated

thanks for your time





On Sun, Feb 1, 2009 at 5:15 AM, Dave Sparks davidspa...@android.com wrote:


 Try this:

 emulator -help-audio-in

 It will tell you which audio backends are available on your system.
 You didn't specify what OS you are using.

 I think there was also some sample code in the SDK at one point. Maybe
 one of the developer advocates can point you to it. Another option is
 to look for the source for the Sound Recorder application on
 source.android.com. It should be in packages/apps/SoundRecorder.

 On Jan 31, 10:45 am, nicolas cosson dodgemysp...@gmail.com wrote:
  Hello,
 
  I have been searching for some time and I can't find a detailled
  tutorial on how to easily record and then read audio on the emulator
  under eclipse. I have found these steps:
 
  - You have to install a virtual sd card with mksdcard.exe 1024M
  sdimg.iso
 
  -then run the emulator : emulator.exe -sdcard
  sdimg.iso//where sdimg.iso it is the path to
  the sdcard
 
  -then run adb.exe : adb push local_file sdcard/remote_file
 
  -then you should put : uses-permission
  android:name=android.permission.RECORD_AUDIO/uses-permission in
  the androidmanifest.xml
 
  -then there is some code to implement which should look like :
  private void startRecord() {
 
 recorder = new MediaRecorder();
  recorder.setAudioSource(MediaRecorder.AudioSource.MIC);  //ok
 so
  I say audio source is the microphone, is it windows/linux microphone
  on the emulator?
 
 recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
  recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
  recorder.setOutputFile(/sdcard/test.3gpp);
 
  recorder.prepare();
  recorder.start();
 
  }
 
  -then you should stop with : recorder.stop(); // at some point (I have
  no idea when and where to decide to stop but I haven't searched yet)
 
  -then you should play it.
 
  I have also heard about :
 http://code.google.com/intl/fr/android/reference/emulator.html#sdcard
  in this page of the manual (~1/4 of the total scroll), there are some
  informations about Emulator Startup Options, one of them is about
  Media  -audio backend
  I couldn't find much about that backend thing, google didn't said much
  about it. I still don't know if it's important to the audio recording
  process.
 
  The fact is all these steps are pretty blurry to me, and I believe I
  am not the only android newbie trying to record some sound :)
 
  Anyone knows where we can find a complete tutorial for dummies
  teaching this feature?
 
  Any help is of course greatly appreciated
 
  Thanks.
 
  On 27 jan, 20:08, Breno breno.min...@gmail.com wrote:
 
   Hey Andrei,
 
  To recordaudioit's pretty easy. But, you must record in
   sdcard, only. Be sure your path to file it's pointing to sdcard, and
   you have one mounted in eclipse (or something else). It's working
   perfectly.
 
   Regards
 
   Breno
 
   On Jan 15, 8:58 am, Andrei Craciun avcrac...@gmail.com wrote:
 
Thanks David...
 
2009/1/15 David Turner di...@android.com
 
 the emulator now supportsaudiorecording. If you have problems with
 it,
 you should report mode detailed information about it here
 
 On Thu, Jan 15, 2009 at 11:05 AM, Andrei Craciun 
 avcrac...@gmail.comwrote:
 
 Hi All,
 As reported on this blog:

 http://blog.roychowdhury.org/2008/04/29/sip-ua-for-android-stack-rtp-...problemsinrecordingaudioon
  the emulator, but everything
 works fine on the real phone. Does anyone has a workaround
 forrecording
audioon the emulator?
 
 Thanks in advance,
 A.
 



-- 
Nicolas Cosson

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

[android-developers] Re: texts are not adding to intent for email

2009-02-01 Thread Guillaume Perrot

Maybe a bug with the attached media part.
Did you try without it ?

On Jan 31, 2:02 pm, jj jagtap...@gmail.com wrote:
 Hello
 I am sending image using following. the image successfully send by
 application. But The subject and text r not getting added to email.

 I want to add body containing some hyperlink, I am doing this
 Intent.EXTRA_TEXT but it is not going to added.

 Will somebody will clear suggest me for. None of EXTRA working
 (subject, title, text);

 Uri uri = ContentUris.withAppendedId(Media.EXTERNAL_CONTENT_URI, 2);

                 Intent i = new Intent();

                 i.setAction(Intent.ACTION_SEND);
                 i.setType(image/jpeg);

                 i.putExtra(Intent.EXTRA_SUBJECT, jigsaw);
          i.putExtra(Intent.EXTRA_TEXT, http://code.google.com/
 android);

                 i.putExtra(Intent.EXTRA_TITLE, ETitle);
                 i.putExtra(Intent.EXTRA_STREAM, uri);
                 i = Intent.createChooser(i, Send);
                 startActivity(i);
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: local service getting killed

2009-02-01 Thread Guillaume Perrot
I posted in the linked discussion John, but it's not the point here. We're
talking about services being killed by android then restarted.

2009/2/1 John Spurlock john.spurl...@gmail.com



 http://groups.google.com/group/android-developers/browse_thread/thread/fa2848e31636af70/8d967c32df91a7d1?lnk=gstq=keeping+a+service+alive

 On Jan 30, 3:09 pm, brs bernhard.r.su...@gmail.com wrote:
  I have an app loosely based on the LocalService example from the SDK
  with a controller activity and a long-running, stateful service which
  is doing stuff on a periodic handler. The service is also a bit of a
  memory hog.
 
  It seems that the service is sometimes killed by the activity-manager
  and immediately restarted. I don't see any stack trace, so I assume it
  is not the application crashing but the system doing that, presumably
  to claim resources. Is that what is going on here?
 
  Is there a way to tell the system that this process is kind of
  important, even though it has no foreground activity and should only
  be killed as a last resort?
 
  Bernhard
 



-- 
Guillaume Perrot
Software Engineer at Ubikod
BuddyMob developer

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

2009-02-01 Thread ph...@grantmidwinter.com

I'm using a mediaplayer to play a sound file, when you leave the
application the sound continues in the background, which is the
desired behaviour.

However, when the app is resumed, the mediaplayer isn't retrieved, so
hitting pause just starts a new player so now there are two sounds
playing.

Is the mediaplayer a type of service? How can I access the original
player again?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to add weight attr of a LinearLayout's child from code

2009-02-01 Thread 邓亮
Hi~
i know we can use XML to specify layout_weight.(refer to APIdemo
LinearLayout9.java)
but is there any method to specify it from code?

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



[android-developers] Re: custom themes?

2009-02-01 Thread skink



Craig wrote:
 It well could be over complicated - here is what I did:
 In res, values, attrs.xml I have:

 ?xml version=1.0 encoding=utf-8?
 resources
   declare-styleable name=MyColors
   attr name=inactiveColor format=color/
   attr name=activeColor format=color/
 ...

 In res, values, styles.xml:
 ?xml version=1.0 encoding=utf-8?
 resources
   style name=Theme parent=android:Theme.NoTitleBar/style

   style name=Theme.GreenWithYellow
   item name=android:windowBackground@drawable/mid_green/item
   item name=inactiveColor#090/item
   item name=activeColor#0F0/item
 ...

 ...and I specify this theme in my AndroidManifest.xml.


 Without specifying the attributes separately, I was getting errors for
 my styles.xml like 'No resource found for specified attribute' (not
 the exact wording).

 Is there a simpler way to do this?

for xml files, you did perfect job: it's exactly what it should be.

but your code is FAR overcomplicated. look at this:

Theme t = getTheme();
TypedArray myColors = t.obtainStyledAttributes(R.styleable.MyColors);
Log.d(test , has activeColor?  + myColors.hasValue
(R.styleable.MyColors_activeColor));
Log.d(test , has inactiveColor?  + myColors.hasValue
(R.styleable.MyColors_inactiveColor));
Log.d(test , has disabledColor?  + myColors.hasValue
(R.styleable.MyColors_disabledColor));

int activeColor = myColors.getInteger
(R.styleable.MyColors_activeColor, 0);
int inactiveColor = myColors.getInteger
(R.styleable.MyColors_inactiveColor, 0);
Log.d(test , activeColor  + Integer.toHexString(activeColor));
Log.d(test , inactiveColor  + Integer.toHexString(inactiveColor));

i declared additional attribute (but not defined in themes.xml)
disabledColor to show how to test if given attribute exists in theme
or not (its somehow helpful for colors since its difficult to set
default value in getColor)

and the code outputs:

D/test(  345): has activeColor? true
D/test(  345): has inactiveColor? true
D/test(  345): has disabledColor? false
D/test(  345): activeColor ff00ff00
D/test(  345): inactiveColor ff009900

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

2009-02-01 Thread Guillaume Perrot
No I was not using a debugger, just DDMS.

2009/2/1 EboMike ebom...@gmail.com


 Guillaume, that kind of sounds like you're running with a debugger
 attached... see somewhere in the middle of this long thread, it is
 known that the system will leak memory when you run with a debugger
 attached - mostly when exceptions are involved, and
 BitmapFactory.decodeFile() always throws (and catches) an exception.

 Do you get the same results when you run without a debugger? All my
 memory woes have been fixed when I stopped using a debugger except
 when necessary.

 -Mike


 On Jan 31, 8:14 am, Guillaume Perrot guillaume.p...@gmail.com wrote:
  There is bug in BitmapFactory memory allocation, there are tons of
  threads in this mailing list dealing with that.
  To sum up:
  At a normal time when you create an object, the heap size is
  automatically grown if not sufficient enough (there is an absolute
  limit of 16MB per process though, you will crash if you exceed this).
  But the bitmap factory allocates memory in a non Java way, it uses
  native code to do that, and the heap growing process fails if not
  enough memory in this case!
  So even if you are far under the 16MB limit, if you are unlucky enough
  to have the heap grown up for your image to be allocated, you will
  have an OutOfMemoryError
  Some guys claim that this crash can be avoided by catching this error
  (catching an error instead of an exception is quite unusual by the
  way)...
 
  On Jan 18, 12:31 am, EboMike ebom...@gmail.com wrote:
 
   Hey gym,
 
   1) You don't have to go that far. No need to close or reset anything,
   simply run the app from within the emulator (obviously, you need to
   update it via adb install -r or something if you changed it). It will
   show up in the process list in the DDMS, but you'll see that it
   doesn't have that cute bug next to it. You can still add the heap
   watch to it, this will not affect anything. And you can always attach
   the debugger later if you need to debug something -- if you have the
   heap watch on too, you might be able to see a change in behavior as
   soon as you attach it. In my test app that repeatedly called
   BitmapFactory.decodeFile and/or threw an exception, I noticed an
   immediate continual increase in memory usage until it OOMed.
 
   2) You won't necessarily see any garbage collection until the VM
   decides to collect. That's okay. It doesn't matter if your app takes
   up 15MB without ever collecting garbage. But as soon as you do an
   allocation that exceeds the amount of available RAM, the gc should
   kick in and take out the trash. Basically, it's all good as long as
   you don't OOM. If you OOM, something went wrong.
 
   Please note the very beginning of this thread - there is a known
   problem in the Gallery class, it never recycles its views. However, I
   have an app that uses two Galleries, both of them using
   BitmapFactory.decodeFile(). I've run it on my device, sometimes with
   1000 entries in the Gallery and scrolling like crazy, and I've never
   OOMed. If I have the debugger attached, I OOM pretty quickly.
 
   3) Interesting. SHOULDN'T happen, the VM should automatically gc as
   soon as you're running out of memory.
 
   Are you doing anything funky with your Bitmap/Drawable objects? How do
   you manage them?
 
   On Jan 17, 9:03 am, gymshoe gyms...@bresnan.net wrote:
 
I have noted the following discrepancies compared to the descriptions
here, using a similar, simple application which uses Gallery, and
BitmapFactory:
 
1) EboMike, How exactly do I run the application without a debugger
attached?  I assume that closing Eclipse entirely, and launching a
new emulator from a DOS prompt (without Eclispe running) would be the
equivalent of not having a debugger attached.
 
When I do this, I get the same memory leak problem as I always did...
 
2) When I have the DDMS attached and running, the heap size doesn't
show any garbage collection (see below) going on for my gallery
application (unless I click on Cause GC)...
 
3) If I call System.GC() intermittently directly in my application
(calling this method alone, and not as part of a {gc() /
runFinalization() / gc()} sequence), this prevents OOM, and then I
 can
see the GC altering the heap size (in DDMS).
 
Jim
 
On Jan 9, 6:37 pm, fadden fad...@android.com wrote:
 
 On Jan 9, 4:47 pm, Mark K mark.ka...@gmail.com wrote:
 
 I've tried it with no de-bugger, on the emulator, and on
 actual G1
  hardware, I can't seem to get rid of the problem entirely. I only
  process and use one bitmap at a time, bitmaps are recycled after
 use,
  and I invoke gc(). The Runtime free memory indicates that I
 always
  have over 10 MB free, each bitmap is less than 3.5 MB, yet this
  problem still ocurs intermittently.
 
 What does logcat show at the point of the failure?  Should see some
 additional traffic, 

[android-developers] Re: How to add weight attr of a LinearLayout's child from code

2009-02-01 Thread 邓亮
o~
i see it now.

give the weight when you use the method
 public void addView(View
about:../../../reference/android/view/View.htmlchild,
ViewGroup.LayoutParamsabout:../../../reference/android/view/ViewGroup.LayoutParams.htmlparams)

and construct the LayoutParams with public LinearLayout.LayoutParams(int
width, int height, float weight)
2009/2/1 邓亮 wsgfz...@gmail.com

 Hi~
 i know we can use XML to specify layout_weight.(refer to APIdemo
 LinearLayout9.java)
 but is there any method to specify it from code?


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

2009-02-01 Thread Guillaume Perrot

From the documentation, I am afraid there is kind of a limitation:
Input: getType() is the MIME type of the data being sent. get*Extra
can have either a EXTRA_TEXT  or EXTRA_STREAM field, containing the
data to be sent. If using EXTRA_TEXT, the MIME type should be text/
plain; otherwise it should be the MIME type of the data in
EXTRA_STREAM. Use */* if the MIME type is unknown (this will only
allow senders that can handle generic data streams). 
Maybe you can set EITHER a text OR a media (XOR).
Did you try not using the media part, and replace the mime type by
text/plain ?

On Jan 31, 2:02 pm, jj jagtap...@gmail.com wrote:
 Hello
 I am sending image using following. the image successfully send by
 application. But The subject and text r not getting added to email.

 I want to add body containing some hyperlink, I am doing this
 Intent.EXTRA_TEXT but it is not going to added.

 Will somebody will clear suggest me for. None of EXTRA working
 (subject, title, text);

 Uri uri = ContentUris.withAppendedId(Media.EXTERNAL_CONTENT_URI, 2);

                 Intent i = new Intent();

                 i.setAction(Intent.ACTION_SEND);
                 i.setType(image/jpeg);

                 i.putExtra(Intent.EXTRA_SUBJECT, jigsaw);
          i.putExtra(Intent.EXTRA_TEXT, http://code.google.com/
 android);

                 i.putExtra(Intent.EXTRA_TITLE, ETitle);
                 i.putExtra(Intent.EXTRA_STREAM, uri);
                 i = Intent.createChooser(i, Send);
                 startActivity(i);
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: getRingtone returns null

2009-02-01 Thread rob...@diprotector.com

oh, my mistake. Classes created in other way then StartActivity have
no Context.
Should pass this from parent class which has been created using
StartActivity and pass this this to MediaPlayer.create().

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

2009-02-01 Thread Tez

Hi,

Has anyone been able to run JNA on Android?

Cheers,
Earlence

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

2009-02-01 Thread Guillaume Perrot

I had the problem yesterday, no maps in my phone, even with the
standard maps application.
It's now working.

On Feb 1, 6:48 am, Keiji Ariyama ml_andr...@c-lis.co.jp wrote:
 Dave,

 Thank you for your reply.

  WiFi, 3G/EDGE (what carrier)? Is there anything useful in the log?
  Maybe a proxy failure?

 I didn't change any settings my dev phone.

 As you know, this trouble cause is Google server error. And it has
 recovered now.

 Thank you,
 Keiji



 Dave Sparks wrote:
  I don't know anything about MapView. What service are you on e.g.
  WiFi, 3G/EDGE (what carrier)? Is there anything useful in the log?
  Maybe a proxy failure?

  On Jan 30, 5:46 pm, Keiji Ariyama ml_andr...@c-lis.co.jp wrote:
  Hi folks,

  Now, I'm developing an Android app called Echo.
  But 5 hours ago, My Dev phone haven't displayed MapView.

  First, I supposed that my API-key have been disabled.
  I tried to Maps API Key signup agian. But google server response error.

  Server Error
  The server encountered a temporary error and could not complete your 
  request.
  Please try again in 30 seconds.
  And not only Echo but also other all map apps cannot display map.

  Default map apps display error message that [Attention] There is a
  connection problem... we'll keep trying..

  If you can think of anything that may help me, I'll appreciate it.

  --
  Keiji,
  ml_andr...@c-lis.co.jp

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



[android-developers] Re: custom themes?

2009-02-01 Thread skink



skink wrote:
 int activeColor = myColors.getInteger
 (R.styleable.MyColors_activeColor, 0);
 int inactiveColor = myColors.getInteger
 (R.styleable.MyColors_inactiveColor, 0);

just after posting i realized i use getInteger, which is wrong of
course (however it also works...)

it should be getColor:

int activeColor = myColors.getColor(R.styleable.MyColors_activeColor,
0);
int inactiveColor = myColors.getColor
(R.styleable.MyColors_inactiveColor, 0);

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



[android-developers] Re: What determines Android Market popularity ranking

2009-02-01 Thread Chister Nordvik

Has anyone figured out this magic formula?

I have a app that has  15000 downloads, a rating of 4.38(600
ratings), but it is still less popular than a competing app with 
1 downloads and a rating of 3.45. How is this possible? My guess
is that it is related to the number of uninstalls but then the rating
system is all wrong? I think I just have to make a new application
with a similar name and start all over again since the app got a lot
of uninstalls in the first version. But then I loose 600 ratings which
could potentially be very important to have if the rating system
changes...

So please, Google employees, can you give us any hints on whether you
are doing any changes to the rating system in the near future or give
us any hints on how the list is decided?

-Christer


On Dec 18 2008, 3:44 pm, joshv jvanderb...@gmail.com wrote:
 I've posted this question to theMarkettechnical support forum and
 received no answer, so I will try here.

 Does anyone know what metrics are used to determine an 
 application'spopularityin the AndroidMarket?

 It does not appear to involve just the number of ratings, the download
 count, or the average rating, as there are applications which are
 persistently ranked lower bypopularityeven though they have higher
 download counts, higher total ratings, and higher average ratings than
 other apps that are more popular in the same category.

 I don't want to point to specific apps in this post, but it should be
 easy enough to find examples.  If a Google employee is interested in
 specific examples, contact me directly.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: custom themes?

2009-02-01 Thread Craig

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



[android-developers] Re: Android Maps API Key gets 502 Server Error

2009-02-01 Thread Keiji Ariyama

Hi sonxurxo,

As long as I know, google's server encountered fatal trouble now.
I sent a mail for you.

Certs and api-key is included in the mail.

Keiji,

sonxurxo wrote:
 Hi, I'm trying to sign up my app (even with debug key, I don't need a
 custom key by now) and I get a Server Error 502. Anyone knows what's
 happening? How long will it take? I need the key for February 2nd.
 Please if anyone has a valid debug key could post it for me? (I'm
 reading my career thesis and I need that key!) Thank you
 
  
 

-- 
Keiji,
ml_andr...@c-lis.co.jp

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

2009-02-01 Thread rob...@diprotector.com

Hello. Probably I misunderstand something, but why

RingtoneManager.getRingtone(this,
Settings.System.DEFAULT_RINGTONE_URI);

always returns null when launching from my activity? Shouldn't it
return some object which is System.DEFAULT_RINGTONE_URI, which I can
then play() ?

Is there any small example of code which shows how to play Ringtone
from Activity? MediaPlayer way also not works.

MediaPlayer.create(this, Settings.System.DEFAULT_RINGTONE_URI)

simply crashes with:

02-01 11:19:51.008: ERROR/TAG(351): null
02-01 11:19:51.008: ERROR/TAG(351): java.lang.NullPointerException
02-01 11:19:51.008: ERROR/TAG(351): at
android.content.ContextWrapper.getContentResolver(ContextWrapper.java:
89)
02-01 11:19:51.008: ERROR/TAG(351): at
android.media.MediaPlayer.setDataSource(MediaPlayer.java:589)
02-01 11:19:51.008: ERROR/TAG(351): at
android.media.MediaPlayer.create(MediaPlayer.java:516)
02-01 11:19:51.008: ERROR/TAG(351): at
android.media.MediaPlayer.create(MediaPlayer.java:497)

Please help!

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



[android-developers] Re: Howto remove thread from Dalvik VM????

2009-02-01 Thread Mark Murphy

sagar.indianic wrote:
 Is there any replacement for threads..or else I will have to change my
 logic as u described..

Animations do not necessarily need background threads.

If you decide you do need threads, I use objects out of
java.util.concurrent package to help with thread management. The
original author of those classes, Doug Lea, has a book on Java
concurrent programming (i.e., thread safety) that has some useful patterns:

http://www.awprofessional.com/bookstore/product.asp?isbn=0201310090

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android Training in Sweden -- http://www.sotrium.com/training.php

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



[android-developers] Re: What determines Android Market popularity ranking

2009-02-01 Thread brs

There also seems to be a time aspect to it - newer apps seem to be
favored in the ranking even if they have not as many downloads or
ratings as an older one.

As a suggestion to the Market team: it would be really nice to list
the apps by multiple metrics. We already have date and this secret,
magic popularity metric. Sometimes I just would like to see which
are the most downloaded or most highly rated applications in a
particular category.

Bernhard

On Feb 1, 10:56 am, Chister Nordvik cnord...@gmail.com wrote:
 Has anyone figured out this magic formula?

 I have a app that has  15000 downloads, a rating of 4.38(600
 ratings), but it is still less popular than a competing app with 
 1 downloads and a rating of 3.45. How is this possible? My guess
 is that it is related to the number of uninstalls but then the rating
 system is all wrong? I think I just have to make a new application
 with a similar name and start all over again since the app got a lot
 of uninstalls in the first version. But then I loose 600 ratings which
 could potentially be very important to have if the rating system
 changes...

 So please, Google employees, can you give us any hints on whether you
 are doing any changes to the rating system in the near future or give
 us any hints on how the list is decided?

 -Christer

 On Dec 18 2008, 3:44 pm, joshv jvanderb...@gmail.com wrote:

  I've posted this question to theMarkettechnical support forum and
  received no answer, so I will try here.

  Does anyone know what metrics are used to determine an 
  application'spopularityin the AndroidMarket?

  It does not appear to involve just the number of ratings, the download
  count, or the average rating, as there are applications which are
  persistently ranked lower bypopularityeven though they have higher
  download counts, higher total ratings, and higher average ratings than
  other apps that are more popular in the same category.

  I don't want to point to specific apps in this post, but it should be
  easy enough to find examples.  If a Google employee is interested in
  specific examples, contact me directly.


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



[android-developers] Re: What determines Android Market popularity ranking

2009-02-01 Thread John Spurlock

The active install % seems to be very highly rated in this magic
formula right now.  Which means any update you release will, by
definition, kill your popularity.  Personally, I'd rather focus on
improving the app instead of gaming the system, but I agree it would
be nice if the rating favored # of downloads a bit more.

On Feb 1, 10:56 am, Chister Nordvik cnord...@gmail.com wrote:
 Has anyone figured out this magic formula?

 I have a app that has  15000 downloads, a rating of 4.38(600
 ratings), but it is still less popular than a competing app with 
 1 downloads and a rating of 3.45. How is this possible? My guess
 is that it is related to the number of uninstalls but then the rating
 system is all wrong? I think I just have to make a new application
 with a similar name and start all over again since the app got a lot
 of uninstalls in the first version. But then I loose 600 ratings which
 could potentially be very important to have if the rating system
 changes...

 So please, Google employees, can you give us any hints on whether you
 are doing any changes to the rating system in the near future or give
 us any hints on how the list is decided?

 -Christer

 On Dec 18 2008, 3:44 pm, joshv jvanderb...@gmail.com wrote:

  I've posted this question to theMarkettechnical support forum and
  received no answer, so I will try here.

  Does anyone know what metrics are used to determine an 
  application'spopularityin the AndroidMarket?

  It does not appear to involve just the number of ratings, the download
  count, or the average rating, as there are applications which are
  persistently ranked lower bypopularityeven though they have higher
  download counts, higher total ratings, and higher average ratings than
  other apps that are more popular in the same category.

  I don't want to point to specific apps in this post, but it should be
  easy enough to find examples.  If a Google employee is interested in
  specific examples, contact me directly.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Math.Sin(90) doesn't return 1?

2009-02-01 Thread ph...@grantmidwinter.com


input:
Log.v(sintest,String.valueOf(Math.sin(90)));

output:
V/sintest (16869): 0.8939966636005579

huh? I realise I'm probably about to invite explanations about
floating points and subsequent brain explosions, but could anyone tell
me what's going on here?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Math.Sin(90) doesn't return 1?

2009-02-01 Thread Phill Midwinter
V/sintest (21227): -0.8011526357338304

And that's Sin(180) ?

2009/2/1 ph...@grantmidwinter.com ph...@grantmidwinter.com



 input:
 Log.v(sintest,String.valueOf(Math.sin(90)));

 output:
 V/sintest (16869): 0.8939966636005579

 huh? I realise I'm probably about to invite explanations about
 floating points and subsequent brain explosions, but could anyone tell
 me what's going on here?
 



-- 
Phill Midwinter
Director
Grant Midwinter Limited
d: 0844 736 5234 x: 0
m: 07538 082156
e: ph...@grantmidwinter.com

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



[android-developers] Re: Math.Sin(90) doesn't return 1?

2009-02-01 Thread Christoph Studer

According to the doc:
http://code.google.com/android/reference/java/lang/Math.html#sin(double)

you need to provide the angle in radians, where 2*Pi corresponds to
360 degrees (i.e. Pi/2 is 90 deg).

http://en.wikipedia.org/wiki/Radian

In Java, you can use the constant Math.PI for Pi.

Christoph


On Sun, Feb 1, 2009 at 6:20 PM, ph...@grantmidwinter.com
ph...@grantmidwinter.com wrote:


 input:
 Log.v(sintest,String.valueOf(Math.sin(90)));

 output:
 V/sintest (16869): 0.8939966636005579

 huh? I realise I'm probably about to invite explanations about
 floating points and subsequent brain explosions, but could anyone tell
 me what's going on here?
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Math.Sin(90) doesn't return 1?

2009-02-01 Thread Mark Murphy

ph...@grantmidwinter.com wrote:
 
 input:
 Log.v(sintest,String.valueOf(Math.sin(90)));
 
 output:
 V/sintest (16869): 0.8939966636005579
 
 huh? I realise I'm probably about to invite explanations about
 floating points and subsequent brain explosions, but could anyone tell
 me what's going on here?

The parameter to sin() is in radians, not degrees. The sine of 90
degrees is 1. The sine of 90 radians is approximately 0.8939966636005579.

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

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

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



[android-developers] Re: Math.Sin(90) doesn't return 1?

2009-02-01 Thread Phill Midwinter
Ah

So I just multiply by pi over 180?

Cheers!

2009/2/1 Mark Murphy mmur...@commonsware.com


 ph...@grantmidwinter.com wrote:
 
  input:
  Log.v(sintest,String.valueOf(Math.sin(90)));
 
  output:
  V/sintest (16869): 0.8939966636005579
 
  huh? I realise I'm probably about to invite explanations about
  floating points and subsequent brain explosions, but could anyone tell
  me what's going on here?

 The parameter to sin() is in radians, not degrees. The sine of 90
 degrees is 1. The sine of 90 radians is approximately 0.8939966636005579.

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

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

 



-- 
Phill Midwinter
Director
Grant Midwinter Limited
d: 0844 736 5234 x: 0
m: 07538 082156
e: ph...@grantmidwinter.com

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



[android-developers] Re: Math.Sin(90) doesn't return 1?

2009-02-01 Thread Mark Murphy

Phill Midwinter wrote:
 Ah
 
 So I just multiply by pi over 180?

That should work.

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

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

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



[android-developers] Re: custom themes?

2009-02-01 Thread skink



On 1 Lut, 16:07, Craig csab...@gmail.com wrote:
 Thank you, skink - that is much simpler.

you probably were not aware of generated R.styleable... note that
R.styleable.MyColors contains int[] you created by hand while
R.styleable.MyColors_* contains indices to that table
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] No callback when list item is touched.

2009-02-01 Thread Brendon

I have a ListView that is populated with a custom adapter.  When an
item is clicked with the trackball, it works fine, i.e. I can catch
the event and move on, though when I touch an item with my finger
there is no callback from the listener.  The item does respond to the
touch, by turning orange for that moment.

Here is how I've setup the listener.  This is within an Activity, not
a ListActivity.

 list.setOnItemClickListener(new
AdapterView.OnItemClickListener() {

public void onItemClick(AdapterView? 
arg0, View arg1,
int position, long id) {
viewItem(id);

}
 });

What am I missing? Is there another listener I need to configure?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: No callback when list item is touched.

2009-02-01 Thread Mark Murphy

Brendon wrote:
 I have a ListView that is populated with a custom adapter.  When an
 item is clicked with the trackball, it works fine, i.e. I can catch
 the event and move on, though when I touch an item with my finger
 there is no callback from the listener.  The item does respond to the
 touch, by turning orange for that moment.
 
 Here is how I've setup the listener.  This is within an Activity, not
 a ListActivity.
 
list.setOnItemClickListener(new
 AdapterView.OnItemClickListener() {
 
   public void onItemClick(AdapterView? 
 arg0, View arg1,
   int position, long id) {
   viewItem(id);
 
   }
});
 
 What am I missing? Is there another listener I need to configure?

You need to call setOnItemSelectedListener() to handle taps like that.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Published!

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



[android-developers] Re: No callback when list item is touched.

2009-02-01 Thread Brendon Drew
I do have that listener defined as well. Though again, I'm not getting a
callback when I touch it.  I do get a call back when selecting an item with
the trackball.

 list.setOnItemSelectedListener(new
AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView? arg0, View arg1,
int position, long id) {
Log.v(this.toString(), Item Selected);
viewItem(id);
}

public void onNothingSelected(AdapterView? arg0) {
// TODO Auto-generated method stub
Log.v(this.toString(), Nothing Selected);



On Sun, Feb 1, 2009 at 2:12 PM, Mark Murphy mmur...@commonsware.com wrote:


 Brendon wrote:
  I have a ListView that is populated with a custom adapter.  When an
  item is clicked with the trackball, it works fine, i.e. I can catch
  the event and move on, though when I touch an item with my finger
  there is no callback from the listener.  The item does respond to the
  touch, by turning orange for that moment.
 
  Here is how I've setup the listener.  This is within an Activity, not
  a ListActivity.
 
 list.setOnItemClickListener(new
  AdapterView.OnItemClickListener() {
 
public void
 onItemClick(AdapterView? arg0, View arg1,
int position, long
 id) {
viewItem(id);
 
}
 });
 
  What am I missing? Is there another listener I need to configure?

 You need to call setOnItemSelectedListener() to handle taps like that.

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com
 _The Busy Coder's Guide to Android Development_ Version 2.0 Published!

 



-- 

Brendon

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

2009-02-01 Thread Mark Murphy

Brendon Drew wrote:
 I do have that listener defined as well. Though again, I'm not getting a
 callback when I touch it.  I do get a call back when selecting an item
 with the trackball.

Besides, on further reflection, I had them backwards, anyway.
Trackball/D-pad movement is select, tap is click.

Without more code, I can't give you a solid answer. What you're doing
sure looks good.

Are you sure the issue isn't something inside of viewItem() -- that
you're getting the event but viewItem() isn't responding to it properly
in the click case?

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
_The Busy Coder's Guide to Android Development_ Version 2.0 Published!

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



[android-developers] Re: Math.Sin(90) doesn't return 1?

2009-02-01 Thread Romain Guy
Or use Math.toRadians()

On Feb 1, 2009 12:49 PM, Mark Murphy mmur...@commonsware.com wrote:

Phill Midwinter wrote:  Ah   So I just multiply by pi over 180?
That should work.

--

Mark Murphy (a Commons Guy) http://commonsware.com Android Training on the
Ranch! -- Mar 16-20, 200...

--~--~-~--~~~---~--~~ You received this
message because you are subs...

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

2009-02-01 Thread Anna PS

Great - thank you. I'll remember to read the documentation next
time :)

I've pasted my code below in case anyone wants to borrow it: it keeps
polling for up-to-date and accurate GPS data, up to a maximum of 10
seconds. If by then the GPS data is old or not accurate enough, it
just returns false.

The code feels a bit dubious, but it seems to do the job.

Anna

long locationTime = location.getTime();
long currentTime = System.currentTimeMillis();
timeDifference = (currentTime - locationTime) / 1000;

float accuracy = location.getAccuracy();
int count = 0;

// Wait for accurate GPS data, up to a maximum of 10 
seconds before
// throwing an error
while (((timeDifference  10) || (accuracy  20.0))  
(count 
20)) {
location = 
locationmanager.getLastKnownLocation(gps);
locationTime = location.getTime();
currentTime = System.currentTimeMillis();
timeDifference = (currentTime - locationTime) / 
1000;
accuracy = location.getAccuracy();
Log.d(LOG_TAG, getting up to date GPS data, 
time diff = 
+ timeDifference +   accuracy 
=  + accuracy
+   count =  + count);
try {
Thread.currentThread();
Thread.sleep(500);
} catch (InterruptedException ie) {
}
count++;
}
// No accurate GPS data? Exit here and warn the user
if ((timeDifference  10) || (accuracy  20.0)) {
return false;
}

On 27 Jan, 03:38, gjs garyjamessi...@gmail.com wrote:
 Hi,

 Subtract the Location.getTime() value from the current time to get the
 age of the last fix.

 Seehttp://code.google.com/android/reference/android/location/Location.html

 Regards

 On Jan 23, 10:07 am, Anna PS annapowellsm...@googlemail.com wrote:

  Hi

  When you get GPS location using getLastKnownLocation, is there a way
  to check how old the data is, i.e. when the location was last
  updated?

  I'm noticing that sometimes my app is giving me an out-of-date
  location (usually because the sky is not visible when the app starts)
  - it'd be good to warn the user about this.

  It's possible to check the age of the data on the iPhone I believe, is
  it possible in Android?

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

2009-02-01 Thread Bala

In the Android phone, while I am watching YouTube videos, I may reduce
the audio volume. Once I am done watching, I close all applications
and leave the phone. Then when there is a incoming call, the ringer is
very feeble. I may miss that call.

Can you make the volume adjustment apply only for that application? I
don't want the ringer volume get changed.

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

2009-02-01 Thread Phill Midwinter
Should be in android beginners?

Volumes are distinct and context sensitive between the ringer and media.

2009/2/1 Bala california.b...@gmail.com


 In the Android phone, while I am watching YouTube videos, I may reduce
 the audio volume. Once I am done watching, I close all applications
 and leave the phone. Then when there is a incoming call, the ringer is
 very feeble. I may miss that call.

 Can you make the volume adjustment apply only for that application? I
 don't want the ringer volume get changed.

 Thanks
 Bala
 



-- 
Phill Midwinter
Director
Grant Midwinter Limited
d: 0844 736 5234 x: 0
m: 07538 082156
e: ph...@grantmidwinter.com

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



[android-developers] Re: Sending Intent to specific Activity

2009-02-01 Thread Dianne Hackborn
Read the first part of Intent Resolution here:

http://code.google.com/android/reference/android/content/Intent.html

(on explicit intents).

On Fri, Jan 9, 2009 at 8:56 AM, Lutz Schönemann 
lutz.schoenem...@sit.fraunhofer.de wrote:


 Hi,

 I want to create a activity that receives intents modify these and
 send them to an other activity that is also registerd to receive this
 kind of intents. These two activities are not in the same package. Is
 there a way to specify a activity that should receive this intent?

 I am new to android and I know that it would be bad and ugly to do
 something like this but it is only a proof of concept.

 Thanks
 Lutz

 



-- 
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.  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: Specific Design significance of Attribute Name Spaces in AndroidManifest Files.

2009-02-01 Thread Dianne Hackborn
There are two main reasons for this:

1. In a layout XML, your XML tree contains tags corresponding to classes to
instantiate and the the attributes are parameters passed to those classes.
Since this is sitting on top of an OO model, the specific class
corresponding to the tag will have an arbitrary number of base classes,
implemented by an arbitrary number of authors.  Yet all of those classes
will be pulling their arguments out of the single set of attributes, so
namespaces allow us to avoid any conflicts as the different implementations
change in version.

2. This allows for a number of key optimizations we do to be able to much
more efficiently parse these XML resources, without the requiring that the
tools have DTD descriptions (and actually more than full) of every kind of
XML file you create.  These optimizations come into play when the resource
compiler sees an attribute in a sub-namespace of
http://schemas.android.com/apk/res/..., and include things like:

- The corresponding resource ID of the attribute is embedded in the compiled
XML, so it can be find with simple integer comparisons.

- Multiple such attributes are sorted in order of their resource IDs, so
obtainStyledAttributes() can be performed as an O(N) operation (this is the
reason for the funky way that API works).

- The resource compiler uses the type information associated with the
attribute resource to pre-parse its value, such as converting color and
integer strings to 4-byte ints, converting enums and flags to their final
int value, resolving references to resources or attributes to their
associated resource identifier, etc.

Without these things, there is just no way we could have used generic XML
files for layouts and such and achieved sufficient performance; we would
have had to take a more traditional approach of converting the resource
source files (which could still be XML) into some custom specific binary
blob for that specific resource type.  With what we have now, the full XML
data is parsed on the device, just using our own special binary XML format.

Hope that helps!

On Sat, Jan 31, 2009 at 7:38 PM, Raja Nagendra Kumar 
nagendra.r...@gmail.com wrote:


 Thank you for reply. Any good reason for doing it..

 Most of the designs aim to assume reasonal defaults to min typing and
 do more with less..

 Regards,
 Nagendra
 



-- 
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.  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: How good to use intents with an application to communcate and modularise it

2009-02-01 Thread Dianne Hackborn
On Sat, Jan 31, 2009 at 8:12 PM, Raja Nagendra Kumar 
nagendra.r...@gmail.com wrote:

 In the contex of one each activity approach, we the following
 advantages
- Go with just one activity for the enitre
 application, hence no need to think of managing many activities life
 cycle
- AndroidManifest would have only one configuration
- Switch the view by way of creating views as it
 demands and use them
- if each view needs a context to create it self
 properly, pass the paratmers to the constructor of the view, this
 would also enhance compile checks and enable maintnace as opposed to
 intent key value pair approach.


You missed the disadvantages, the main one being that you are then
responsible for keeping track of the full state of your application so that
it can be recreated when the user returns to it after its process has been
killing or changes the configuration it is running in by for example
rotating the screen.  This can actually become a significant amount of
effort to do well, since you need to limit as much as possible the up-front
work you need to do to get your UI re-created in whatever state it should be
in.


 Closure comparision to J2ME is Canvas which has lifecycle, however
 many frameworks recommend one instance of canvas only..


I would strongly caution against trying to use models from J2ME to help
understand Android.  Pretty much no part of these aspects of the design were
influenced by J2ME.

-- 
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.  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: No callback when list item is touched.

2009-02-01 Thread Brendon Drew
No, I am printing a log entry just before I call viewItem(), and I wasn't
seeing that log statement when touching the item.

Though I think I have found the problem. I narrowed it down to my custom
adapter that extends ArrayAdapter.  In my adapter I call the overloaded
ArrayAdapter constructor:
public 
ArrayAdapter(Contexthttp://code.google.com/android/reference/android/content/Context.htmlcontext,
int resource, int textViewResourceId,
List http://code.google.com/android/reference/java/util/List.htmlT
objects) I use this so I can define a standalone XML layout (resource) to
use for each item in the list. Then when overriding getView(), I call
super.getView() to get that layout, set the elements based on the object at
that position, then return the layout for that row.

The problem occurs when my layout contains a Button or ButtonView element.
After taking out the Button (which I wanted for a speficic action to be
taken), the listener is now getting a callback when touching the item.

Is this a bug or am I not doing something correctly?

Below is an XML layout for my rows.  Simply commenting out the Button
element fixed the problem.

?xml version=1.0 encoding=utf-8?
LinearLayout
xmlns:android=http://schemas.android.com/apk/res/android;
android:layout_height=60px
android:orientation=horizontal
android:id=@+id/row_id
android:layout_width=fill_parent
ImageView android:id=@+id/row_icon
android:layout_height=wrap_content
android:layout_width=wrap_content
android:layout_gravity=center_vertical/
LinearLayout android:layout_height=60px
android:orientation=vertical
android:id=@+id/row_text
android:layout_width=wrap_content
android:layout_weight=1


TextView android:id=@+id/test_row_text
android:layout_height=wrap_content
android:textColor=#FF
android:textSize=14px
android:layout_weight=1
android:layout_width=wrap_content/
TextView android:id=@+id/test_row_desc
android:layout_height=wrap_content
android:textColor=#FF
android:textSize=14px
android:layout_weight=1
android:layout_width=wrap_content/
Button android:id=@+id/test_row_action_button
android:text=@string/add
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_gravity=center_vertical/
/LinearLayout

On Sun, Feb 1, 2009 at 2:41 PM, Mark Murphy mmur...@commonsware.com wrote:


 Brendon Drew wrote:
  I do have that listener defined as well. Though again, I'm not getting a
  callback when I touch it.  I do get a call back when selecting an item
  with the trackball.

 Besides, on further reflection, I had them backwards, anyway.
 Trackball/D-pad movement is select, tap is click.

 Without more code, I can't give you a solid answer. What you're doing
 sure looks good.

 Are you sure the issue isn't something inside of viewItem() -- that
 you're getting the event but viewItem() isn't responding to it properly
 in the click case?

 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com
 _The Busy Coder's Guide to Android Development_ Version 2.0 Published!

 



-- 

Brendon

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

2009-02-01 Thread solid

I am new to developing android apps.  I have been writing java webapps
for years and decided to try my hand at this.  I have my app humming
along in the emulator but I am having problems installing my app on
the g1 itself.  I copied the apk file to the sd card and I used the
apps installer app from the market to install off the SD card.  I get
prompted for the install and everything seems to go fine but the my
new app never shows up in the apps menu or in the installed
applications.  I am hoping this is simply because I did not sign it.
I am trying to figure out how to sign a app but this is weird and
counterintutive.  I already have a gpg key.  Can that be used to sign
my app?  If so, how do I import my key into the keytool store?  Is
there something I am missing?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: No callback when list item is touched.

2009-02-01 Thread Romain Guy
When an item contains a focusable/clickable item you cannot get the
onitemclick event.

On Feb 1, 2009 4:41 PM, Brendon Drew b.j.d...@gmail.com wrote:

No, I am printing a log entry just before I call viewItem(), and I wasn't
seeing that log statement when touching the item.

Though I think I have found the problem. I narrowed it down to my custom
adapter that extends ArrayAdapter.  In my adapter I call the overloaded
ArrayAdapter constructor:
public 
ArrayAdapter(Contexthttp://code.google.com/android/reference/android/content/Context.htmlcontext,
int resource, int textViewResourceId,
List http://code.google.com/android/reference/java/util/List.htmlT
objects) I use this so I can define a standalone XML layout (resource) to
use for each item in the list. Then when overriding getView(), I call
super.getView() to get that layout, set the elements based on the object at
that position, then return the layout for that row.

The problem occurs when my layout contains a Button or ButtonView element.
After taking out the Button (which I wanted for a speficic action to be
taken), the listener is now getting a callback when touching the item.

Is this a bug or am I not doing something correctly?

Below is an XML layout for my rows.  Simply commenting out the Button
element fixed the problem.

?xml version=1.0 encoding=utf-8?
LinearLayout
xmlns:android=http://schemas.android.com/apk/res/android;
android:layout_height=60px
android:orientation=horizontal
android:id=@+id/row_id
android:layout_width=fill_parent
ImageView android:id=@+id/row_icon
android:layout_height=wrap_content
android:layout_width=wrap_content
android:layout_gravity=center_vertical/
LinearLayout android:layout_height=60px
android:orientation=vertical
android:id=@+id/row_text
android:layout_width=wrap_content
android:layout_weight=1


TextView android:id=@+id/test_row_text
android:layout_height=wrap_content
android:textColor=#FF
android:textSize=14px
android:layout_weight=1
android:layout_width=wrap_content/
TextView android:id=@+id/test_row_desc
android:layout_height=wrap_content
android:textColor=#FF
android:textSize=14px
android:layout_weight=1
android:layout_width=wrap_content/
Button android:id=@+id/test_row_action_button
android:text=@string/add
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_gravity=center_vertical/
/LinearLayout

On Sun, Feb 1, 2009 at 2:41 PM, Mark Murphy mmur...@commonsware.com wrote:
   Brendon Drew wro...
Brendon

--~--~-~--~~~---~--~~ You received this
message because you are su...

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



[android-developers] is there any setStyle method?

2009-02-01 Thread skink

hi,

i created my style in styles.xml, lets say MyStyle.

i can use it in any layout file by style=@style/MyStyle.

also my generated R class have R.style.MyStyle, my question is if i
can use it at runtime to setStyle - unfortunately View doesn't have
such a method. if not what is R.style.MyStyle used for? (i already
know that custom themes IDs are also in R.style and can be used to
setTheme, but MyStyle is not a theme)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 any setStyle method?

2009-02-01 Thread Romain Guy
The style can be passed to a view's constructor.

On Feb 1, 2009 5:28 PM, skink psk...@gmail.com wrote:


hi,

i created my style in styles.xml, lets say MyStyle.

i can use it in any layout file by style=@style/MyStyle.

also my generated R class have R.style.MyStyle, my question is if i
can use it at runtime to setStyle - unfortunately View doesn't have
such a method. if not what is R.style.MyStyle used for? (i already
know that custom themes IDs are also in R.style and can be used to
setTheme, but MyStyle is not a theme)

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

2009-02-01 Thread Brendon Drew
the button had neither focusable or clickable defined. and why was I getting
the event when clicking with the trackball, but not when touching it.

On Feb 1, 2009 5:04 PM, Romain Guy romain...@google.com wrote:

When an item contains a focusable/clickable item you cannot get the
onitemclick event.

  On Feb 1, 2009 4:41 PM, Brendon Drew b.j.d...@gmail.com wrote:  
No, I am printing a log ...

On Sun, Feb 1, 2009 at 2:41 PM, Mark Murphy mmur...@commonsware.com wrote:
   Brendon Drew wro...
Brendon

--~--~-~--~~~---~--~~ You received this
message because you are su...

--~--~-~--~~~---~--~~ You received this
message because you are s...

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

2009-02-01 Thread Romain Guy
A button is clickable and focusable.

On Feb 1, 2009 7:01 PM, Brendon Drew b.j.d...@gmail.com wrote:

the button had neither focusable or clickable defined. and why was I getting
the event when clicking with the trackball, but not when touching it.

  On Feb 1, 2009 5:04 PM, Romain Guy romain...@google.com wrote:  
When an item contains a ...

  On Feb 1, 2009 4:41 PM, Brendon Drew b.j.d...@gmail.com wrote:  
No, I am printing a log ...

  On Sun, Feb 1, 2009 at 2:41 PM, Mark Murphy mmur...@commonsware.com
wrote:Brendon Dr...

--~--~-~--~~~---~--~~ You received this
message because you are s...

--~--~-~--~~~---~--~~ You received this
message because you are s...

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

2009-02-01 Thread Brendon Drew
ahh, right, I misunderstood.  I thought you meant if those were set to true.


but still, why does it work with the trackball?

  On Feb 1, 2009 5:04 PM, Romain Guy romain...@google.com wrote:  
When an item contains a ...

On Feb 1, 2009 4:41 PM, Brendon Drew b.j.d...@gmail.com wrote:
  No, I am printing ...

  On Sun, Feb 1, 2009 at 2:41 PM, Mark Murphy mmur...@commonsware.com
wrote:Brendon Dr...

  --~--~-~--~~~---~--~~ You received this
message because you are...

--~--~-~--~~~---~--~~ You received this
message because you are s

--~--~-~--~~~---~--~~ You received this
message because you are subs...

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

2009-02-01 Thread skink



On 1 Lut, 22:34, Romain Guy romain...@google.com wrote:
 The style can be passed to a view's constructor.



thanks Romain for your reply, but i think it's equivalent of setting
style in xml - it's static.

what about setting the style after the View is constructed - that way
style could be dynamically changed?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to force screen to switch between landscape/portrait

2009-02-01 Thread Tomei Ningen

Is there a way to programmatically force the screen to change between landscape 
and portrait mode? I want to allow the user to choose a menu item to rotate the 
screen, instead of relying on pulling out the keyboard.

I am looking for something like Activity.changeScreenOrientation, but couldn't 
find such a thing in the API docs ...

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] ListView: Disable Focus Highlight

2009-02-01 Thread fahad

Hi,

I've set the row (view) being used in a ListView as non-focusable
along with non-clickable and have set the listview's focusable flag to
false as well. However, I still get the yellow highlight when I use
the scroll-ball on my device. How can I disable the yellow highlight
and use my own special view/color instead upon focus?

Any help would be much appreciated.

Thanks

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

2009-02-01 Thread Tomei Ningen

Oh, pardon me. on second reading of the doc:

Activity.setRequestedOrientation()

will do the trick

sorry for the spam



- Original Message 
From: Tomei Ningen tomei.nin...@yahoo.com
To: android-developers@googlegroups.com
Sent: Sunday, February 1, 2009 6:18:25 PM
Subject: [android-developers] How to force screen to switch between 
landscape/portrait


Is there a way to programmatically force the screen to change between landscape 
and portrait mode? I want to allow the user to choose a menu item to rotate the 
screen, instead of relying on pulling out the keyboard.

I am looking for something like Activity.changeScreenOrientation, but couldn't 
find such a thing in the API docs ...

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: How to scroll a Listview to focus a particular element?

2009-02-01 Thread Gw1921

Thanks! That worked

On Jan 30, 5:31 pm, Romain Guy romain...@google.com wrote:
 Use setSelection(position).

 On Fri, Jan 30, 2009 at 9:28 AM, fahad guidedw...@googlemail.com wrote:

  Hi,

  I'm trying to scroll my ListView (from an Activity) to a particular
  element in the list. I know it's position in the list. How is this
  possible?

  Thanks

 --
 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] ImageButton resizes within TableLayout -- How do i fix?

2009-02-01 Thread Pete

*Scenario*
I'm attempting to host Image Buttons with a descriptor TextView below
each button. To do this elegantly, I decided to use a TableLayout.

The resulting image should look something like like:

   [img1][img2]  [img3]
  hi   please send this exit

As you can see above, each image is properly centered within its cell
and some text is displayed below.


*Issue*
Unfortunately, if the descriptive text is longer than the ImageButton
is wide, then the ImageButton associated with that text is stretched.
See below:

   [img1]   [ img2  ]   [img3]
  hi   please send this exit


*Failed Attempts*
Setting Height Width: I've already tried to fix this by setting
layout_width  layout_height for each element, but within a
TableLayout it does not seem to work (these seem to be ignored for the
stretched item).

Also I thought I could nest each row within a LinearLayout (vertical
orientation) but for some reason the layout file will not render if an
ImageButton is nested within a TableLayout   TableRow  LinearLayout.


*Example Code*
You can use this example XML to reproduce the issue at hand.

TableLayout android:layout_width=fill_parent
android:layout_height=wrap_content
android:layout_gravity=center_horizontal

TableRow android:gravity=center_horizontal
android:layout_width=fill_parent
ImageButton android:id=@+id/button1 
android:src=@drawable/
icon /
ImageButton android:id=@+id/button1 
android:src=@drawable/
icon /
ImageButton android:id=@+id/button1 
android:src=@drawable/
icon /
/TableRow

TableRow android:gravity=center_horizontal
android:layout_width=fill_parent

TextView android:text=hi /
TextView android:text=please send this /
TextView android:text=exit /
/TableRow

/TableLayout


*Question Restated*
How can I host an ImageButton within a TableLayout (or at least make
it look like a table layout) without stretching having the TableLayout
ImageButtons to fit the width of their columns? Most importantly is
still keeping the text below the ImageButton.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Dialing Permission

2009-02-01 Thread Sohail

I am not using the built in ACTIVITY for Dialer. Rather trying to
create my own. I wrote the following code and when I run this; the
Dialer starts to dial.

package my.AndroidPhoneDialer;
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.net.Uri;

public class AndroidPhoneDialer extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
Intent DialIntent = new Intent (Intent.ACTION_DIAL, Uri.parse
(tel:03332424242));
/** To Launch the Dialer Activity */
DialIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
/** To start the Activity */
startActivity(DialIntent);

Intent CallIntent = new Intent (Intent.ACTION_CALL, Uri.parse
(tel:03332424242));
CallIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(CallIntent);

}
}


On Jan 30, 11:22 pm, Charlie Collins charlie.coll...@gmail.com
wrote:
 I don't think you need any permission to initial a phone call using
 the built in Activity. As long as you go through the built in activity
 and included user interface, no perms required.
 The CALL_PHONE permission is for making a call on your own without
 using the built in Activity, as I understand it (if you want to write
 your own dialer, or otherwise not go through the built in dialer).

 (And the built in Activity probably HAS the CALL_PHONE permission, so
 it's not your app that needs the permission if you are handing off,
 etc.)

 On Jan 30, 7:07 am, Sohail sohail.k...@imsciences.edu.pk wrote:

  Hi,

  I just created a simple application, that starts the Dial Activity and
  place a call. I did not provide any permission in the manifest file to
  start a call, but still the call activity starts.

  I also checked the AndroidManifest.xml file, there is no permission
  added, still the activity starts.

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



[android-developers] Problem with textalign

2009-02-01 Thread Zi Yong Chua

Hi guys,

I am trying to center align the text in my textview for btn_quit but
the android:textalign=center is giving me error. The eclipse is
telling me that there is no resource identifier for textalign and even
though I have placed textview widget package in the src.. can anyone
help me on this? Thank you very much.

?xml version=1.0 encoding=utf-8?

RelativeLayout android:id=@+id/widget29
android:layout_width=fill_parent
android:layout_height=fill_parent
xmlns:android=http://schemas.android.com/apk/res/android;

TextView android:id=@+id/btn_quit
android:layout_width=100px
android:layout_height=30px
android:textSize=14sp
android:text=Abort Game?
android:textAlign=center
android:layout_alignParentBottom=true 
android:clickable=true
/TextView

TextView android:id=@+id/txt_level
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=Level
/TextView

TextView
android:id=@+id/txt_score
android:layout_width=wrap_content
android:layout_height=wrap_content
android:text=Score
android:layout_alignParentBottom=true
android:layout_alignLeft=@+id/txt_level
/TextView

ImageButton android:id=@+id/img_gameshark
android:layout_width=wrap_content
android:layout_height=wrap_content
android:layout_centerVertical=true
/ImageButton

/RelativeLayout


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: ImageButton resizes within TableLayout -- How do i fix?

2009-02-01 Thread Chander Pechetty

TextView
android:text=please send this
android:maxWidth=10dip /

If your text requirements are complex, you can use other views below
the image. You can also set the number of lines of text etc.

On Feb 2, 7:54 am, Pete pcnof...@gmail.com wrote:
 *Scenario*
 I'm attempting to host Image Buttons with a descriptor TextView below
 each button. To do this elegantly, I decided to use a TableLayout.

 The resulting image should look something like like:

            [img1]                [img2]              [img3]
               hi           please send this         exit

 As you can see above, each image is properly centered within its cell
 and some text is displayed below.

 *Issue*
 Unfortunately, if the descriptive text is longer than the ImageButton
 is wide, then the ImageButton associated with that text is stretched.
 See below:

            [img1]       [         img2      ]       [img3]
               hi           please send this         exit

 *Failed Attempts*
 Setting Height Width: I've already tried to fix this by setting
 layout_width  layout_height for each element, but within a
 TableLayout it does not seem to work (these seem to be ignored for the
 stretched item).

 Also I thought I could nest each row within a LinearLayout (vertical
 orientation) but for some reason the layout file will not render if an
 ImageButton is nested within a TableLayout   TableRow  LinearLayout.

 *Example Code*
 You can use this example XML to reproduce the issue at hand.

         TableLayout android:layout_width=fill_parent
                 android:layout_height=wrap_content
 android:layout_gravity=center_horizontal

                 TableRow android:gravity=center_horizontal
 android:layout_width=fill_parent
                         ImageButton android:id=@+id/button1 
 android:src=@drawable/
 icon /
                         ImageButton android:id=@+id/button1 
 android:src=@drawable/
 icon /
                         ImageButton android:id=@+id/button1 
 android:src=@drawable/
 icon /
                 /TableRow

                 TableRow android:gravity=center_horizontal
 android:layout_width=fill_parent

                         TextView android:text=hi /
                         TextView android:text=please send this /
                         TextView android:text=exit /
                 /TableRow

         /TableLayout

 *Question Restated*
 How can I host an ImageButton within a TableLayout (or at least make
 it look like a table layout) without stretching having the TableLayout
 ImageButtons to fit the width of their columns? Most importantly is
 still keeping the text below the ImageButton.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Questions in Calling Operation

2009-02-01 Thread Stanley.lei

Hi all Android developers,

We are developing an application to automatically dial call, answer
call, and drop call. But I met some issues when I tried to answer and
drop call:

1. I could not get all calls' status. In current published SDK, there
are only three status could be available: IDLE, OFFHOOK, and RINGING.
But I wish that I could get more status about each call, not the whole
status of phone, such as which call is active, which call is held,
which calls are in a conference. Do I have any method to acquire these
status? Or is it contained in future google development roadmap?

2. I could not answer an inbound call. From the SDK, we can see that
the intent ACTION_ANSWER is used to handle an incoming phone call. But
when I tried to call it to answer the incoming call, the activity
crashed. From the search result in the group, I found that there are
some others developers have met this issue, but no answer is given.
Could any comment be available from Google Android Development team,
or from Dianne Hackborn?

3. I could not drop a call. It seems this issue is a known issue for
the Android SDK. What I want to know is that when we could get a
workaround version to resolve it?

Any comment is appreciated.

Thanks  Best Regards,

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



[android-developers] Re: Problem with textalign

2009-02-01 Thread Romain Guy
The attribute is called gravity not textAlign.

On Feb 1, 2009 9:44 PM, Zi Yong Chua chu...@gmail.com wrote:


Hi guys,

I am trying to center align the text in my textview for btn_quit but
the android:textalign=center is giving me error. The eclipse is
telling me that there is no resource identifier for textalign and even
though I have placed textview widget package in the src.. can anyone
help me on this? Thank you very much.

?xml version=1.0 encoding=utf-8?

   RelativeLayout android:id=@+id/widget29
   android:layout_width=fill_parent
   android:layout_height=fill_parent
   xmlns:android=http://schemas.android.com/apk/res/android;

   TextView android:id=@+id/btn_quit
   android:layout_width=100px
   android:layout_height=30px
   android:textSize=14sp
   android:text=Abort Game?
   android:textAlign=center
   android:layout_alignParentBottom=true
android:clickable=true
   /TextView

   TextView android:id=@+id/txt_level
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   android:text=Level
   /TextView

   TextView
   android:id=@+id/txt_score
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   android:text=Score
   android:layout_alignParentBottom=true
   android:layout_alignLeft=@+id/txt_level
   /TextView

   ImageButton android:id=@+id/img_gameshark
   android:layout_width=wrap_content
   android:layout_height=wrap_content
   android:layout_centerVertical=true
   /ImageButton

/RelativeLayout



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

2009-02-01 Thread zcj0429

Hi, everyone:
How can my host machine connect to emulator using socket? In my
application, I need emulator to open a server socket, then host
machine connects to emulator as a client. But when host creates the
socket using 10.0.2.15:x (x is the port which emulator is
listenning), it doesn't work. I think maybe the address10.0.2.15
goes wrong. Is it a local address behind the virtual router and the
host can't find? If so, how to find a correct IP address of emulator?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] CoolReader Open Source

2009-02-01 Thread SinFrancis

CoolReader Open Source

source address : http://androidos.cc/bbs/viewthread.php?tid=675extra=page%3D1

CoolReader? is based on the Android platform for readers, the current
version 0.7.0.0, the following documents in support of sdcard

browsing, support for Txt file reading, specific functions are as
follows:

* support sdcard file browser
* support Txt documents read
* support for large file read (up to test 50M)
* to support the font settings
* support custom background settings
* to support the unlimited class bookmark
* support bookmarks deleted, Jump
* support percentages
* support screen rotation
* to support the keyboard and flip Scroll
* to support the touch screen and flip Scroll

If you are a user directly download the installation package and can
install and use manual.

Address: http://code.google.com/p/coolreader/downloads/list

If you are a developer, please use the Eclipse Ganymede 3.4 version,
SDK for RC2, ADT 0.8, JDK 1.6 Version

And Eclipse working directory encoding for UTF-8.

If you join us, the availability of the Android OS community training
and technical support.

Address: http://androidos.cc/bbs
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Fwd: GMAPS is not being displayed in the emulator

2009-02-01 Thread Ravi Patil

Hi sheik,

I too facing the same problem. Are u able to solve the issue. If so
please mail me how on ravi.pa...@sasken.com

On Jan 16, 11:49 am, sheik sheik...@gmail.com wrote:
 Kindly look at this queryand help me regarding the issue..

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

2009-02-01 Thread Christian Wiesbauer

You can use
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE |
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); from the Activity class.

-Ursprüngliche Nachricht-
Von: android-developers@googlegroups.com
[mailto:android-develop...@googlegroups.com] Im Auftrag von Tomei Ningen
Gesendet: Montag, 02. Februar 2009 03:18
An: android-developers@googlegroups.com
Betreff: [android-developers] How to force screen to switch between
landscape/portrait


Is there a way to programmatically force the screen to change between
landscape and portrait mode? I want to allow the user to choose a menu item
to rotate the screen, instead of relying on pulling out the keyboard.

I am looking for something like Activity.changeScreenOrientation, but
couldn't find such a thing in the API docs ...

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: How to handle ini file in android?

2009-02-01 Thread Paranoia

how to use assets directory? i have rebuild the apk by apkbuilder
manually?

On Jan 30, 9:56 pm, Tote tot...@gmail.com wrote:
 Or alternatively you can put your asset files under 'assets' directory
 in your package. AssetManager helps you opening those files, however,
 parsing is really up to you.

 Anyway, I let the users of my application edit preferences and for
 that I use PreferenceActivity along with PreferenceManager. Might be
 useful for you, too.

 On Jan 30, 8:59 am, hmmm akul...@mail.ru wrote:

  You can place your ini file (or any file), say config,ini, in the 'raw'
  subdir of the 'res' dir and then use
  InputStream is = Context.getResources().openRawResource(R.raw.config)
  But then, I guess, there's no API in android dealing with ini files
  specifically so you then might want to create your own class to represent an
  ini file

  - Original Message -
  From: Paranoia zheny...@gmail.com
  To: Android Developers android-developers@googlegroups.com
  Sent: Friday, January 30, 2009 10:32 AM
  Subject: [android-developers] Re: How to handle ini file in android?

  i want to use ini file as my config files. how to use ini file in
  android instead of xml file. i mean replace xml with ini in android

  On Jan 30, 11:48 am, Dianne Hackborn hack...@android.com wrote:
   Android doesn't do ini files; we generally use XML for these kinds of
   things. You will probably need to find a parser elsewhere, or write your
   own, and compile it into your app.

   On Thu, Jan 29, 2009 at 6:59 PM, Paranoia zheny...@gmail.com wrote:

Thanks
but it seems that this method can not handle the ini file with
multiple sections.
e.g.

[Section1]
X=a
Y=b

[Section2]
U=c
V=d
...

On Jan 22, 2:37 pm, Freepine freep...@gmail.com wrote:
 Hi, maybe you can try
 java.util.Properties.load(InputStream
   http://code.google.com/android/reference/java/io/InputStream.html
 in)
   http://code.google.com/intl/zh-CN/android/reference/java/util/Propert...)

 On Thu, Jan 22, 2009 at 2:14 PM, Paranoia zheny...@gmail.com wrote:

  i can not find any utility to parse the ini file in android. any one
  can help me?

   --
   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. 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: Sending Multipart SMS

2009-02-01 Thread suchita bhardwaj
Hey ..I am getting same problem while sending multipartmessages.via emulator
..hv u got  Success to get message in text format.

On Thu, Jan 29, 2009 at 8:00 PM, Chethan shchet...@gmail.com wrote:


 Hi,

 I am trying to send a multipart SMS using the following code. While
 the SMS is being split into multiple parts and sent across, in the
 receiver, I am seeing some junk characters (as if i am reading a
 binary file). Obviously, I am not doing something correct. Can someone
 (plusminus ) help?

 // SMS SENDER

 package com.test;

 import java.util.ArrayList;
 import android.app.Activity;
 import android.app.PendingIntent;
 import android.content.Intent;
 import android.os.Bundle;
 import android.telephony.gsm.SmsManager;
 import android.util.Log;

 public class SMSSender extends Activity {



 @Override
 public void onCreate(Bundle icicle) {
 super.onCreate(icicle);
 setContentView(R.layout.main);
 SmsManager smsManager = SmsManager.getDefault();
 String destAddr = 5556, scAddr = null, mMessageText =
 This is a sample SMS which has more than 160 characters if it has
 more characters, it will give an error as the standard SMS can contain
 only 160 characters. This text does not appear;
 PendingIntent sentIntent = null, deliveryIntent = null;
 try {
 ArrayListPendingIntent listOfIntents = new ArrayListPendingIntent
 (0);
 //PendingIntent il = PendingIntent.getBroadcast(this, 0, new Intent(),
 0);
 ArrayListString messages = smsManager.divideMessage(mMessageText);

 Log.v(, messages.toString());

 for (int i=0; i  messages.size(); i++){

 PendingIntent pi = PendingIntent.getBroadcast(this, 0, new Intent(),
 0);
 listOfIntents.add(pi);
 }
 smsManager.sendMultipartTextMessage(destAddr, null, messages,
 listOfIntents, null);

 } catch (Exception e) { Log.i(TEST, e.toString()); } } }



 ---

 // SMS Receiver
 package com.test;

 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
 import android.telephony.gsm.SmsMessage;
 import android.util.Log;


 public class SMSReceiver extends BroadcastReceiver {
 private static final String TAG = SMSReceiver;
 static final String ACTION =
 android.provider.Telephony.SMS_RECEIVED;
 public void onReceive(Context context, Intent intent) {
 if (intent.getAction().equals(ACTION)) {
 StringBuilder buf = new StringBuilder();
 Bundle bundle = intent.getExtras();
 if (bundle != null) {
 Object[] pdusObj = (Object[]) bundle.get(pdus);
 SmsMessage[] messages = new SmsMessage[pdusObj.length];
 for (int i = 0; ipdusObj.length; i++) {
 messages[i] = SmsMessage.createFromPdu ((byte[]) pdusObj[i]);
 SmsMessage msg = messages[0];
 Log.i(TAG, msg.getDisplayMessageBody());
 }

 Thanks,
 Chethan

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] HELP! Lost all my stats on Android Market!

2009-02-01 Thread Akbur

Dear all,

I was uploading my .apk file on Android Market and keep getting this:

You have another published application on Market with the same
package name (com.x.x).  (Where x.x. is my package name). Go to that
other application, and click upgrade.

I do not have another published application with that package name
because it was some how lost by the UI and it refused to accept my APK
file!  Can someone advise what I should do?  Ideally I would like my
old stats back.  My Android Market account is the same as this email
address.

At the moment my app is back on the Market but using a different
package name (to avoid the error), which means all my stats have been
reset and users who wish to upgrade will need to inconveniently
uninstall the old.

Any advice?

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