[android-developers] Re: fast removing SurfaceView

2009-06-23 Thread skink



On 24 Cze, 01:14, Dianne Hackborn  wrote:
> Fyi, I would guess the problem has to do with loading and initializing your
> view hierarchy, and not with the previous surface view.  Have you tried
> launching with just the second hierarchy and not the surface view to see how
> fast it is?
>
>

Dianne,

yes i have, and it worked pretty fast (just half second or 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] Re: Sending Email from Android application

2009-06-23 Thread doubleminus

Swathi,

Did you ever figure this one out??

Thanks,
double

On May 12, 1:40 am, Swathi  wrote:
> I have tried to sendemailfrom myapplication in emulator , with
> following code.
>
> Intent sendIntent = new Intent(Intent.ACTION_SEND);
> sendIntent.putExtra(Intent.EXTRA_EMAIL, mailto);
> sendIntent.putExtra(Intent.EXTRA_SUBJECT,
> subject.getText().toString());
> sendIntent.putExtra(Intent.EXTRA_TEXT,
> body.getText().toString());
> sendIntent.setType("text/plain");
>
> startActivity(Intent.createChooser(sendIntent, "MySendMail"));
>
> But i got an error "No applications can perform this action".
>
> I tried by configuring Gmail in emulator, with the following code
>
>         boolean debug = false;
>         //Set the host smtp address
>         Properties props = new Properties();
>         props.setProperty("mail.transport.protocol", "smtp");
>         props.setProperty("mail.host", "smtp.gmail.com");
>         props.put("mail.smtp.auth", "true");
>         props.put("mail.smtp.port", "465");
>         props.put("mail.smtp.socketFactory.port", "465");
>         props.put("mail.smtp.socketFactory.class",
>                              "javax.net.ssl.SSLSocketFactory");
>         props.put("mail.smtp.socketFactory.fallback", "false");
>         props.setProperty("mail.smtp.quitwait", "false");
>         Session session = Session.getDefaultInstance(props, this);
>         session.setDebug(debug);
>        try
>        {
>         // create a message
>         Message msg = new MimeMessage(session);
>         // set the from and to address
>         InternetAddress addressFrom = new InternetAddress(from);
>         msg.setFrom(addressFrom);
>         InternetAddress[] addressTo =
>                         new InternetAddress[recipients.length];
>         for (int i = 0; i < recipients.length; i++) {
>             addressTo[i] = new InternetAddress(recipients[i]);
>         }
>         msg.setRecipients(Message.RecipientType.TO, addressTo);
>         // Setting the Subject and Content Type
>         msg.setSubject(subject);
>         msg.setContent(message, "text/html");
>         Transport.send(msg);
>        }
>        catch (Exception e) {
>                 // TODO: handle exception
>            System.out.println("Exception in Message"+e.getMessage());
>         }
>     }
>
> But i got an error but i got an error
> "java.lang.verifyError:javax.mail.internet.Mimemessage."
>
> Can anybody help me?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] AnalogClock AppWidget dial.

2009-06-23 Thread Ravi

Using Appwidgets, If we use TextView in layout provider xml then, we
are able to set the text in Provider.java using
remoteViews.setTextViewText() method.

Similarly, if I use AnalogClock as AppWidget in xml then, is there any
method available to change the android:dial value using RemoteViews or
AnalogClock api's in Provider.java ?

For Ex- I need to load two dial png's based on AM or PM.

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



[android-developers] Re: Animation Transition

2009-06-23 Thread Sukitha Udugamasooriya

yeah.. sliding works well.
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] Translate animation in android1.5

2009-06-23 Thread r3

Hi,
Could anyone tell me how to smoothen  the translate animation in
android1.5





Thanks,
rakesh
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Use own map layer in Google Maps

2009-06-23 Thread Maps.Huge.Info (Maps API Guru)

What JavaScript error do you see? I get none. This is a Maps v3 demo
app, it should work well with any modern browser.

The v3 API doesn't have a tile layer yet but it does have an overlay
method. I wrote the one used in the demo. It handles whole image
overlays so if you can create a single image that contains all your
data then it works well. The v2 API has tile overlays which may work
better for your application. The v3 api is smaller and faster, better
for mobile apps.

-John Coryat

On Jun 23, 5:25 pm, JP  wrote:
> Hi John,
>
> Thanks for your reply. Gonna look into that tomorrow for sure!
>
> In your example you have added a point to the map, and I also get a
> javascript error. I am interested in adding a shape. Kind of like
> this:
>
> http://www.weather.com/maps/activity/garden/index_large.html
>
> I was trying to find a temperature map, but this will do ;-). There
> are shapes in red, yellow and green, and I have a similar map with a
> rating I use. I want to know which chape I am currently in.
>
> But thanks for the pointer, I will look into it!
>
> 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: Cannot Decode Images from sdcard using BitmapFactory.Options

2009-06-23 Thread Shre555

The photograph/picture was taken using the camera of Android Dev Phone
1 so i suppose that skia would recognize it.

On Jun 19, 7:25 pm, Streets Of Boston  wrote:
> "xxx jpeg error 53 Not a JPEG file: starts with 0x%02x 0x%02x"
>
> It seems that the file on your sd-card is not a JPEG file, at least
> not one recognized by SKIA.
>
> On Jun 19, 8:23 am, Shre555  wrote:
>
> > Hi,
>
> > I am tring to get a image from the images stored on the sdcard of my
> > Android
>
> > but i am getting a skia error using BitmapFactory
>
> > When I just take the image directly without using BitmapFactory class
> > I get the image.
>
> > But the purpose of using BitmapFactory is scaling down the image size
> > by using inSample =4;
>
> > but I get skia as the error
>
> > Here is my code after which the logcat details are also given
>
> > Java:
> > public class bitD extends Activity {
> >      private int SELECT_IMAGE = 200;
>
> >      /** Called when the activity is first created. */
> >     �...@override
> >      public void onCreate(Bundle savedInstanceState) {
> >           super.onCreate(savedInstanceState);
>
> >           startActivityForResult(new Intent(Intent.ACTION_PICK,
>
> > android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI),
> >                     SELECT_IMAGE);
> >      }
>
> >     �...@override
> >      protected void onActivityResult(int requestCode, int resultCode,
> > Intent data) {
> >           super.onActivityResult(requestCode, resultCode, data);
> >           if (requestCode == SELECT_IMAGE) {
> >                if (resultCode == Activity.RESULT_OK) {
>
> >                     Uri selectedImage = data.getData();
>
> >                     System.out.println("Uri of the selected img is "
> >                               + selectedImage);
>
> >                     try {
> >                          InputStream is = getContentResolver
> > ().openInputStream(
> >                                    selectedImage);
>
> >                          BitmapFactory.Options opts = new
> > BitmapFactory.Options();
> >                          Bitmap bm;
>
> >                          opts.inJustDecodeBounds = true;
> >                          bm = BitmapFactory.decodeStream(is, null,
> > opts);
>
> >                          System.out.println("ht" + opts.outHeight);
> >                          System.out.println("wt" + opts.outWidth);
> >                          System.out.println("mime" +
> > opts.outMimeType);
>
> >                          opts.inJustDecodeBounds = false;
> >                          opts.inDither = true;
> >                          opts.inPreferredConfig =
> > Bitmap.Config.RGB_565;
> >                          // this will resize the bm
> >                          opts.inSampleSize = 4; // scaled down by 4
> >                          bm = BitmapFactory.decodeStream(is, null,
> > opts);
>
> >                          setContentView(R.layout.main);
> >                          ImageView iv1 = (ImageView) findViewById
> > (R.id.ImageView01);
> >                          iv1.setImageBitmap(bm);
>
> >                     } catch (FileNotFoundException e) {
> >                          // TODO Auto-generated catch block
> >                          e.printStackTrace();
> >                     }
>
> >                }
>
> >           }
> >      }
>
> > Here is the ouput of my logcat
>
> > 06-19 12:01:21.140: DEBUG/SurfaceFlinger(56): Screen about to return,
> > flinger = 0x127c58
> > 06-19 12:01:21.350: DEBUG/dalvikvm(316): GC freed 875 objects / 48416
> > bytes in 89ms
> > 06-19 12:01:21.450: DEBUG/dalvikvm(316): GC freed 148 objects / 5720
> > bytes in 88ms
> > 06-19 12:01:21.560: DEBUG/dalvikvm(316): GC freed 23 objects / 1064
> > bytes in 87ms
> > 06-19 12:01:21.780: DEBUG/KeyguardViewMediator(56): pokeWakelock(5000)
> > 06-19 12:01:22.870: VERBOSE/ImageGallery2(316): /
> > ImageBlockManager.onPause
> > 06-19 12:01:22.890: INFO/System.out(2551): Uri of the selected img is
> > content://media/external/images/media/34
> > 06-19 12:01:22.960: INFO/System.out(2551): ht1536
> > 06-19 12:01:22.960: INFO/System.out(2551): wt2048
> > 06-19 12:01:22.970: INFO/System.out(2551): mimeimage/jpeg
> > 06-19 12:01:22.970: DEBUG/skia(2551): xxx jpeg error 53 Not a
> > JPEG file: starts with 0x%02x 0x%02x
> > 06-19 12:01:23.080: INFO/ActivityManager(56): Displayed activity
> > co.pad.BD/.bitD: 14010 ms
> > 06-19 12:01:28.200: DEBUG/dalvikvm(163): GC freed 1543 objects / 79424
> > bytes in 108ms
> > 06-19 12:01:33.170: DEBUG/dalvikvm(180): GC freed 91 objects / 4840
> > bytes in 77ms
> > 06-19 12:01:38.200: DEBUG/dalvikvm(316): GC freed 790 objects / 35944
> > bytes in 103ms
>
> > Please someone help me out 
>
> > Is there a work around / can i do this differently without consuming a
> > lot of memory(I do not want to end up with Out of Memory Error.)
>
> > Thanks in Advance.
--~--~-~--~~~---~--~~
You received this message because you are su

[android-developers] how to set intent flags

2009-06-23 Thread tstanly

hi all,


in the
http://developer.android.com/reference/android/content/Intent.html
there are constant "FLAG_ACTIVITY_CLEAR_TOP"
and setFlag method,

but i use for:
Intent intent_back=new Intent();
intent_back.setClass(favorit.this, demo.class);
intent_back.setFlags(FLAG_ACTIVITY_CLEAR_TOP);

startActivity(intent_back);
favorit.this.finish();

setFlag is error,
how to use the constant in the class??
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: FLAG_ACTIVITY_NEW_TASK why is it required in onRecieve when starting activity

2009-06-23 Thread ani

thanks for your answer hack.

On Jun 24, 12:20 am, Dianne Hackborn  wrote:
> Tasks have nothing to do with threads and processes.  Be sure you read this
> overview:
>
> http://developer.android.com/guide/topics/fundamentals.html
>
> You need to use NEW_TASK because you are not starting the activity from an
> existing activity, and thus you are not starting it from an existing task.
>
> On Tue, Jun 23, 2009 at 5:31 AM, ani  wrote:
>
> > Guys,
>
> > I was under the impression that onRecieve runs in the main UI thread
> > and we can launch an activity in onRecieve without setting the flag as
> > new task.Why do we need to create a new task and launch the activity
> > there.Why cant the activtiy launch in the task in which main UI thread
> > is running?
>
> > regards,
> > ani
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Calibration with the environment may improve the readings ?!

2009-06-23 Thread Delta Foxtrot
2009/6/23 Gryyphyn 

>
> I haven't looked through the source for the compass but there has to
> be a set() method that you can apply a positive or negative value to,
> possibly on tha app level. The compass is accurate enough so all you
> would really have to do is assign a set() method to a menu calibration
> option to allow the user to align with a standard compass and set the
> value that modifies the OSD compass alignment, similar to the bubble
> app and its calibration with the accelerometers. Just a thought...
>

The callibration for the accelerometers isn't to calibrate the sensors, but
to figure out which way the phone is pointing and then use that information
along with some fancy maths to display correctly.

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

2009-06-23 Thread Tsai stanly
no...if you don't use the finish(),

and variables would not kill automatically,
variables include some static variable

2009/6/23 Fei Zhang 

> I don't think you need close 2, the system will do it! Is it right?
>
>  2009/6/23 tstanly 
>
>>
>>  hi all,
>>
>> i have a app,the structure composed three .java,
>> 1.java,2.java,3.java
>>
>> their relationship is:
>> 1->2->3
>> and 3 can go back to 1
>>
>> when i was back to 1 from 3,
>> i want to close the 2,
>>
>> how to do this?
>> 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: Use own map layer in Google Maps

2009-06-23 Thread Delta Foxtrot
Look at the osmdroid code, they use tiles from OpenStreetMap.org

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



[android-developers] Re: Binder Thread issue.

2009-06-23 Thread Gavin

OK. thanks for your suggestion. I will modify my design.
It is Binder Thread that I want to know. Is there any negative impact?

On Jun 24, 10:06 am, Mark Murphy  wrote:
> Gavin wrote:
> > Thanks mike.
> > But I don't agree with you . If I stop the service through stopSelf(),
> > the service will not be waked up by alarm manager. It will not
> > repeatly download data every 5 mins.
>
> Sure it will! Or, more accurately, your BroadcastReceiver that you
> register in the manifest for the AlarmManager will get invoked every N
> minutes, and it can restart the service.
>
> http://androidguys.com/?p=4411
>
> Though waking up and turning on WiFi five minutes means you'll wreck
> your users' battery life. I heartily recommend Jeff Sharkey's Google I/O
> presentation, "Coding For Life -- Battery Life, That Is":
>
> http://code.google.com/events/io/sessions/CodingLifeBatteryLife.html
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Need Android talent? Ask on HADO!http://wiki.andmob.org/hado
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: fast removing SurfaceView

2009-06-23 Thread Dianne Hackborn
Fyi, I would guess the problem has to do with loading and initializing your
view hierarchy, and not with the previous surface view.  Have you tried
launching with just the second hierarchy and not the surface view to see how
fast it is?

On Tue, Jun 23, 2009 at 4:44 PM, skink  wrote:

>
>
>
> On 23 Cze, 22:09, Dave Bordoley  wrote:
> > Why not use one View resource which includes both the SurfaceView for
> > the animation and the normal view and show/hide them using
> > setVisibility(View.GONE) and setVisibility(View.VISIBLE). This is
> > pretty quick and how I've done something similar in the past.
> >
> > Dave
> >
>
> thanks Dave,
>
> i'll try your approach
>
> did you use FrameLayout as a container for both Views?
>
> pskink
> >
>


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

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

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



[android-developers] Re: Binder Thread issue.

2009-06-23 Thread Mark Murphy

Gavin wrote:
> Thanks mike.
> But I don't agree with you . If I stop the service through stopSelf(),
> the service will not be waked up by alarm manager. It will not
> repeatly download data every 5 mins.

Sure it will! Or, more accurately, your BroadcastReceiver that you
register in the manifest for the AlarmManager will get invoked every N
minutes, and it can restart the service.

http://androidguys.com/?p=4411

Though waking up and turning on WiFi five minutes means you'll wreck
your users' battery life. I heartily recommend Jeff Sharkey's Google I/O
presentation, "Coding For Life -- Battery Life, That Is":

http://code.google.com/events/io/sessions/CodingLifeBatteryLife.html

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

Need Android talent? Ask on HADO! http://wiki.andmob.org/hado

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

2009-06-23 Thread Gavin

Thanks mike.
But I don't agree with you . If I stop the service through stopSelf(),
the service will not be waked up by alarm manager. It will not
repeatly download data every 5 mins.




On Jun 23, 7:57 pm, Mike Hearn  wrote:
> They're used by the framework itself, ignore them.
>
> On Jun 23, 6:59 am, Gavin  wrote:
>
> >  My app have a service and it will create athreadevery 5 mins.
> > Thethreadwill connect internet to download some data, and then exit.
>
> That's not the right design. Instead look into the alarm manager, you
> want an inexact repeating alarm to send an intent to your service so
> your process only runs when it's actually working. Make sure that
> stopSelf() is always called, even if the process is killed half way
> through the download!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: drawRect not doing anything in a 1.5 MapView

2009-06-23 Thread CaptainSpam

Just tried that.  Unfortunately, that didn't do anything different.  I
think Paint's style defaults to Paint.Style.FILL anyway.

On Jun 23, 4:25 am, MrChaz  wrote:
> You'll need to do fillPaint.setStyle(Paint.Style.FILL) I think.
>
> On Jun 21, 7:57 pm, CaptainSpam  wrote:
>
> > I'm having a problem getting drawRect to draw anything on a Canvas
> > from a MapView (i.e. as an Overlay) on 1.5 firmware.  The strange
> > thing is, drawLine is working perfectly, and both work right with the
> > same code under 1.1.  Was there anything that changed in this respect
> > between 1.1 and 1.5 I'm not taking into account?
>
> > The relevant code is as follows (in snippet form):
> > (R.color.graticule_fill is #10FF; Graticule is an object that
> > indicates a 1x1 degree area on the earth's surface)
>
> > Context mContext; // comes in from constructor
>
> > static Paint fillPaint = new Paint();
> > fillPaint.setColor(mContext.getResources().getColor
> > (R.color.graticule_fill));
>
> >     protected void drawGraticuleFill(Canvas c, Projection pr,
> > Graticule g) {
> >         // This method is called from draw(); c is passed in from
> > there,
> >         // pr = mapView.getProjection(), g is provided by the class.
> >         if (g == null) {
> >             return;
> >         }
>
> >         // Two Points, the top-left and bottom-right of the graticule,
> > taken from the
> >         // current Projection
> >         Point topleft = pr.toPixels(g.getTopLeftGeoPoint(), null);
> >         Point bottomright = pr.toPixels(g.getBottomRightGeoPoint(),
> > null);
>
> >         // Should draw out a rectangle covering the graticule; this
> > works in 1.1, but
> >         // doesn't seem to do anything in 1.5.
> >         c.drawRect(new Rect(topleft.x, topleft.y, bottomright.x,
> > bottomright.y), fillPaint);
> >     }
>
> > (sorry if this snippet doesn't make much sense out of context, I can
> > provide more information if need be)
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] WebView highlight link border

2009-06-23 Thread kevin

When click on a image link in webView, it highlights the border of
image then loads the url. Is there a way to disable the border
hightlight?

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

2009-06-23 Thread Dianne Hackborn
Yeah ADT launches apps differently than the home screen does.  Assume the
home screen is correct, and ignore this behavior from ADT.

On Tue, Jun 23, 2009 at 1:34 PM, Al  wrote:

>
> Hi, I've come across a very annoying problem, which only seems to
> happen when I launch my app from eclipse for testing. If I launch it
> normally, it doesn't seem to have this problem.
>
> This is how I can reproduce it:
> - Launch app via Eclipse
> - Press Home
> - Relaunch app via icon
> - Click menu->exit which tells the Service to clean up and calls finish
> () when the Service finishes cleaning up
>
> For some reason, there seem to be two instances of the activity, one
> exits normally and the other one gains focus. Clicking exit does
> nothing since the Service has stopped but the Service variable is not
> null. Attempting to use the app launches errors since the resource it
> uses have been closed. I can force a close via the crash and relaunch
> the app, and it exits normally this time.
>
> As I said, it only happens when launching the app via Eclipse. Anyone
> know what could cause this? My launchMode is set to singleTask,
> however, that shouldn't cause an issue, I used that mode before. I
> tried calling finish() regardless of the state of the Service, but it
> doesn't seem to help.
> >
>


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

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

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



[android-developers] Re: Application Needed

2009-06-23 Thread sm1

I moved it to the Productivity section.
serge

On Jun 23, 8:47 pm, sm1  wrote:
> I wrote a special app for this. It's free. It's called *)s) Repeat
> Vibrations*. In the Reference section. By simplecode.inc.
>
> Make sure you test it thoroughly before using it in class or during
> the evaluation. I wrote it today and i only tested it for an hour or
> so.
>
> Let us know how you did after the eval.
>
> serge
>
> On Jun 22, 4:49 am, bizzy401  wrote:
>
>
>
> > I am an instructor in the military.  I have an instructor evaluation
> > coming up and I am looking for an application that might be able to
> > help me out.  When I am instructing a class I have to ask a question
> > every three to six minutes.  No more no less.  I was looking for an
> > app that would vibrate in my pocket every four minutes.  Does anyone
> > know of an app like this?
>
> > Thank you very much for any help that is offered.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Application Needed

2009-06-23 Thread sm1

I wrote a special app for this. It's free. It's called *)s) Repeat
Vibrations*. In the Reference section. By simplecode.inc.

Make sure you test it thoroughly before using it in class or during
the evaluation. I wrote it today and i only tested it for an hour or
so.

Let us know how you did after the eval.

serge

On Jun 22, 4:49 am, bizzy401  wrote:
> I am an instructor in the military.  I have an instructor evaluation
> coming up and I am looking for an application that might be able to
> help me out.  When I am instructing a class I have to ask a question
> every three to six minutes.  No more no less.  I was looking for an
> app that would vibrate in my pocket every four minutes.  Does anyone
> know of an app like this?
>
> Thank you very much for any help that is offered.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Hide the virtual keyboard

2009-06-23 Thread Alex B

Thanks Lexxuz. The solution you provided works only in the sense that
it prevents the soft keyboard from revealing itself - but it is still
a hack. Here's why: I have a hint in each of my text fields (EditText
input fields). When I *press* into the fields (i.e. focus them), the
hints disappear - whereas normally, the fields only disappear if
something is *entered* (inputted). Also, when the field is emptied,
the hints normally re-appear -- however, with the above solution they
don't. Therefore, this solution is a kind of hack.

It blows my mind that Google introduced this soft keyboard without any
documentation about how to suppress it.

If anyone out there has figured this out in a way that does not lose
the usual functionality of the input fields, please reply.

Google Android Engineers please help in this regard.

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: fast removing SurfaceView

2009-06-23 Thread skink



On 23 Cze, 22:09, Dave Bordoley  wrote:
> Why not use one View resource which includes both the SurfaceView for
> the animation and the normal view and show/hide them using
> setVisibility(View.GONE) and setVisibility(View.VISIBLE). This is
> pretty quick and how I've done something similar in the past.
>
> Dave
>

thanks Dave,

i'll try your approach

did you use FrameLayout as a container for both Views?

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

2009-06-23 Thread Marco Nelissen
On Tue, Jun 23, 2009 at 2:43 PM, Richard Schilling <
richard.rootwirel...@gmail.com> wrote:

>
> Trying to get my head around the specific ins/outs of the Looper
> object and how it interacts with Threads.  Documentation is rather
> scant on this topic.  This is one of those topics that is obvious to
> the Android core team, but to the rest of us, it's not so obvious.
>
> Can someone point us to better documentation or give a more complete
> account of Looper:
>
> 1. What is looper.


It's the thing that makes sure that messages sent to a Handler actually end
up there.

2. How does the Android phone use Looper to coordinate message
> handling?


Not sure what you mean by "coordinate" in this context.

3. What do I need to do when I get the "Can't create handler inside
> thread that has not called Looper.prepare()" message?


You call Looper.prepare() before you create the Handler, then some time
later you call Looper.loop() to start the message handling loop, exactly as
done in the sample code at the top of
http://developer.android.com/reference/android/os/Looper.html
If you don't want your message processing to be done in that thread, create
the Handler somewhere else (your main application thread for example).

4. How do I use LocationManager.requestLocationUpdates with Looper,
> and why does this call require a Looper object?


Because internally those updates are sent as Messages, so a Handler is
needed to receive them, so you need a Looper to run the message loop.
You don't *have* to specify a Looper, but in that case the calling thread
must have a Looper. For example, you can call the non-Looper method from
your app's main thread.

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



[android-developers] Re: fast removing SurfaceView

2009-06-23 Thread Dave Bordoley

Why not use one View resource which includes both the SurfaceView for
the animation and the normal view and show/hide them using
setVisibility(View.GONE) and setVisibility(View.VISIBLE). This is
pretty quick and how I've done something similar in the past.

Dave

On Tue, Jun 23, 2009 at 2:18 PM, skink wrote:
>
> hi,
>
> in my activity i'd like to setContentView() twice: first one i pass
> custom SurfaceView that will be used for animated painting (some sort
> of splash screen) and after animation finishes i setContentView()
> again this time with my 'normal' activity View.
>
> the problem is that it takes quite long (2 seconds or so) to switch
> to second content View.
>
> is there any way to speed it up?
>
> thanks,
> pskink
> >
>

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

2009-06-23 Thread JP

Hi John,

Thanks for your reply. Gonna look into that tomorrow for sure!

In your example you have added a point to the map, and I also get a
javascript error. I am interested in adding a shape. Kind of like
this:

http://www.weather.com/maps/activity/garden/index_large.html

I was trying to find a temperature map, but this will do ;-). There
are shapes in red, yellow and green, and I have a similar map with a
rating I use. I want to know which chape I am currently in.

But thanks for the pointer, I will look into it!

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] WebView Link with SDK 1.5

2009-06-23 Thread John

With previous SDK, clicking on the link of telephony number triggers
the dialer. But it does not work with new SDK, is it right? Thanks!

-John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 use android's built in zoom controls for View or ImageView

2009-06-23 Thread John

Thanks for your response. I posted multiple times while ago since I
couldn't see my previous postings. I don't think I can use WebView to
implement my application. Appreciated anyway.

On Jun 4, 11:01 am, hanged_man  wrote:
> i was investigating into the same issue and it seems like that it is
> not possible, thezoomcontrolsare not available for the imageview as
> it is in the "camera" application. However, there's a always a
> workaround for this using the webview, if you need a sample on how to
> do it you can send me a private message and ill gladly help 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: Problem with createBitmap method

2009-06-23 Thread Streets Of Boston

Try this: Before setting it to null, call mpBitmap.recycle().

But be sure, though, that the reference held by mpBitmap is not held
somewhere else in your program by another heap variable, cache or an
active View.

On Jun 23, 9:07 am, hamlatzis  wrote:
> My application crashes after I try to use the static Bitmap
> createBitmap method to get a mutable bitmap in order to fill it later
> with data.
>
> If I only create one 1024x1024 the application works just fine, but
> when I try to load the same image more than once (first making my
> object null in each round) my application crashes on my third or
> fourth try.
>
> eg
> Bitmap mpBitmap = null;
>
> void CreateBitmap(int nWidth, int nHeight)
> {
>      if ( mpBitmap != null )
>           mpBitmap = null;
>      mpBitmap = Bitmap.createBitmap(nWidth, nHeight,
> Bitmap.Config.ARGB_);
>
> }
>
> I get the same result if I create a smaller image but then I need more
> runs before the crash. In all cases my application works just fine if
> I only create the image (even 1024x1024) once, then exit my
> application and run it again.
>
> If there is a need for "crash dump" I can provide one.
>
> Any help will be appreciated.
>
> Thanks,
>
> Iosif
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Better Looper documentation, please ....

2009-06-23 Thread Richard Schilling

Trying to get my head around the specific ins/outs of the Looper
object and how it interacts with Threads.  Documentation is rather
scant on this topic.  This is one of those topics that is obvious to
the Android core team, but to the rest of us, it's not so obvious.

Can someone point us to better documentation or give a more complete
account of Looper:

1. What is looper.
2. How does the Android phone use Looper to coordinate message
handling?
3. What do I need to do when I get the "Can't create handler inside
thread that has not called Looper.prepare()" message?
4. How do I use LocationManager.requestLocationUpdates with Looper,
and why does this call require a Looper object?

Please don't just reference the API documentation.  I've been through
that and it creates more questions than it answers.

Thanks.

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

2009-06-23 Thread Max Salley

a 1024x1024 bitmap will be (IIRC) 4MB.  Creating a few will likely
cause you to run out of memory.  Use Bitmap.recycle to free up the
resources that a bitmap you no longer need is using

On Jun 23, 9:07 am, hamlatzis  wrote:
> My application crashes after I try to use the static Bitmap
> createBitmap method to get a mutable bitmap in order to fill it later
> with data.
>
> If I only create one 1024x1024 the application works just fine, but
> when I try to load the same image more than once (first making my
> object null in each round) my application crashes on my third or
> fourth try.
>
> eg
> Bitmap mpBitmap = null;
>
> void CreateBitmap(int nWidth, int nHeight)
> {
>      if ( mpBitmap != null )
>           mpBitmap = null;
>      mpBitmap = Bitmap.createBitmap(nWidth, nHeight,
> Bitmap.Config.ARGB_);
>
> }
>
> I get the same result if I create a smaller image but then I need more
> runs before the crash. In all cases my application works just fine if
> I only create the image (even 1024x1024) once, then exit my
> application and run it again.
>
> If there is a need for "crash dump" I can provide one.
>
> Any help will be appreciated.
>
> Thanks,
>
> Iosif
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: NinePatchDrawable as ItemizedOverlay

2009-06-23 Thread skink



skyman napisał(a):

> If not how can I draw NinePatchDrawable on Canvas?
>

NinePatchDrawable npd = ...;

npd.setBounds(0, 0, 100, 50);
npd.draw(canvas);
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Cannot get Log.isLoggable working as documented

2009-06-23 Thread fadden

On Jun 13, 3:47 am, westmeadboy  wrote:
> My code is something like:
>
> if (Log.isLoggable("mytag", Log.DEBUG)) {
>     Log.d("mytag", "Logged at debug level");
>
> }
[...]
> However, if we remove the if statement then shouldnt the Log.d()
> statement do nothing?

All log statements get written to the log file.  If that weren't the
case, the Log.isLoggable call would be redundant.

This is more meaningful for something like:

  if (Log.isLoggable("blah", Log.DEBUG)) {
Log.d("blah", "This " + i + " another " + thing + " xyzzy");
  }

Here, the call to Log.isLoggable avoids allocating a StringBuilder and
performing several concatenation operations.


> So neither of those work for me. What am I doing wrong? Is eclipse
> somehow overriding my settings?

You can verify that the property has been set with "getprop".

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

2009-06-23 Thread Boris

FYI. I solved the problem by experimenting with the values of the -X
flags ... These settings worked:

-Xms1g -Xmx1g

B
On Jun 19, 9:07 am, Boris  wrote:
> Are there no Traceview gurus out there?
> B
>
> On Jun 15, 8:38 pm, Boris  wrote:
>
> > Hello. I have been trying to use traceview for profiling my Android
> > app. So far I have gotten it to work on very small parts of the
> > program. If I use it for bigger chunks it creates too much information
> > (.trace file is too large) and I get an OutOfMemory (heap memory)
> > error from the java compiler. I tried some tricks with setting higher
> > min and max heap memory values but no luck.
>
> > If anyone has used traceview with similar effects before I would
>
> > highly appreciate any tips you may have.
>
> > Here are the details. First I am reproducing the error message:
>
> > $ traceview.bat tmp.trace
> > Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
> >        at com.android.traceview.TimeLineView.setData
> > (TimeLineView.java:433)
> >        at com.android.traceview.TimeLineView.(TimeLineView.java:
> > 316)
> >        at com.android.traceview.MainWindow.createContents
> > (MainWindow.java:93)
> >        at org.eclipse.jface.window.Window.create(Window.java:426)
> >        at org.eclipse.jface.window.Window.open(Window.java:785)
> >        at com.android.traceview.MainWindow.run(MainWindow.java:58)
> >        at com.android.traceview.MainWindow.main(MainWindow.java:190)
>
> > On windows traceview works from a batch file that is reproduced below.
> > The last line is where I am mucking with the memory settings. That
> > does not seem to affect the behavior though. The parameters-- -XX:
> > +HeapDumpOnOutOfMemoryError -Xms2g -Xmx2g-- have been added by me ...
> > - Hide quoted text -
>
> > again they have no effect. Maybe because they should be used when
> > generating the .jar file itself?
>
> >  traceview.bat /
> > rem don't modify the caller's environment
> > setlocal
>
> > rem Set up prog to be the path of this script, including following
> > symlinks,
> > rem and set up progdir to be the fully-qualified pathname of its
> > directory.
> > set prog=%~f0
>
> > rem Change current directory to where traceview is, to avoid issues
> > with directories
> > rem containing whitespaces.
> > cd %~dp0
>
> > set jarfile=traceview.jar
> > set frameworkdir=
> > set libdir=
>
> > if exist %frameworkdir%%jarfile% goto JarFileOk
> >    set frameworkdir=lib\
> >    set libdir=lib\
>
> > if exist %frameworkdir%%jarfile% goto JarFileOk
> >    set frameworkdir=..\framework\
> >    set libdir=..\lib\
>
> > :JarFileOk
>
> > set jarpath=%frameworkdir%%jarfile%
>
> > C:\Program Files\Java\jdk1.6.0_12\bin\java -XX:
> > +HeapDumpOnOutOfMemoryError -Xms2g -Xmx2g -Djava.ext.dirs=
> > %frameworkdir
> > % -Djava.library.path=%libdir% -jar %jarpath% %*
> > //
>
> > Cheers, Boris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: 6502 Emulator

2009-06-23 Thread fadden

On Jun 23, 7:49 am, LouisB  wrote:
> fadden, thanks for taking a looksy into the emulator.  Great ideas for
> optimization BTW.  I've been looking at your ideas plus this document
> (http://slack.net/~ant/nes-emu/6502.html) and wondering how much mhz I
> can squeeze out of her.

Interesting article, though some of the advice is C-specific.

It did inspire one thought: have your instruction fetch call return
the next 2 bytes.  That way you're doing one method call and $C000
range check for every two bytes, instead of one per byte.  If the
address is in the I/O range, call over to the generic get-byte-from-
memory function.  You'd end up with slower execution (or duplicated
code) for handling the bank-switched ROM area though.

Interpreter loops do tend to be massive switch statements though.
See, for example, dalvik/vm/mterp/out/InterpC-portstd.c. :-)

> Mhz is calculated by counting clock cycles per loop.

Is that available for display anywhere?  I saw a single-digit integer
fps counter in the top left but that's all.

> Might be pessimistic, but I'm thinking the G1 hardware is just too
> slow.  It's at 1/3 mhz right now, and even if I squeeze another 1/3rd
> out I'm still at .66Mhz.  The last 1/3 would probably be more trouble
> than the time is worth (or impossible.)  I'm leaning heavily towards
> waiting for the hardware to catch up.

The combination of G1 hardware and interpreted bytecode is probably
insufficient.  You're on a mobile device emulating a Dalvik machine
emulating a 6502.

A JIT will help, but only if it aggressively inlines methods -- you're
losing a lot to method call overhead.  Considering the RAM and CPU
cache limitations, inlining more than basic setters and getters is
questionable.

> Do you know anything about the NDK?  Would it allow me to do C
> language type operations to speed this up?  i.e. get the JVM out of
> the way and go straight to the cpu / memory?

This is the sort of thing that the NDK should work well for -- raw
computation independent of the Android APIs.  It's not yet available,
but there's some discussion on the android-ndk mailing list.

> > BTW, at some point you'll want to add support for a virtual keyboard.
> > Not all devices have physical keyboards, which makes it tough to get
> > things going.
>
> True - I could use the built in one correct?

Yup.

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

2009-06-23 Thread Alec

I tested the MemoryFile between threads just to make sure I was doing
it correctly.  My hope is to send data between processes using shared
memory.  It seems to defeat the purpose of shared memory to NOT be
able to map memory between two separate apps.  That's why they call it
shared.  Is this going to be supported in the near future?

On Jun 23, 2:17 pm, Dianne Hackborn  wrote:
> Also, fwiw, there is no reason to use a MemoryFile to share between two
> threads -- you can just make any object and share it between them.
>
> On Tue, Jun 23, 2009 at 12:14 PM, Marco Nelissen wrote:
>
>
>
> > On Mon, Jun 22, 2009 at 1:29 PM, Alec  wrote:
>
> >> Hi,
>
> >> I've been able to send data via shared memory between threads within a
> >> process using MemoryFile.  I then tried to send data between a service
> >> and an activity in different processes, but the data did not get
> >> passed.  The name for each call the MemoryFile's constructor was the
> >> same.  Is it possible to share data between processes using a
> >> MemoryFile?
>
> > Two MemoryFiles with the same name don't automatically map to the same
> > area.
> > Currently the only way to use a MemoryFile across processes is to use
> > hidden APIs, which you shouldn't do.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] use multiple files to store string values

2009-06-23 Thread fry

Hi,

Is it possible to store strings values in multiple files? Eg,
strings.xml, strings1.xml, strings2.xml etc.

I do not mean localized versions of the same file - those multiple
files should contain different string ids in the same language, so in
code they would be refered like:

R.strings1.my_string_1
R.strings1.my_string_2
R.strings2.my_string_3
etc.

So, "strings1", "strings2", "strings3" would be a kind of namespace
for them.

Or, another way is to have multiple R classes inside one project,
which would deal with different stringsXXX.xml files.

Like, currently we can refer to "my.name.space.R" and to "android.R"
at the same time, so is it possible to have:

android.R
my.name.space1.R
my.name.space2.R
etc

at the same time inside single project?

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

2009-06-23 Thread skink

hi,

in my activity i'd like to setContentView() twice: first one i pass
custom SurfaceView that will be used for animated painting (some sort
of splash screen) and after animation finishes i setContentView()
again this time with my 'normal' activity View.

the problem is that it takes quite long (2 seconds or so) to switch
to second content View.

is there any way to speed it up?

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



[android-developers] Strange activity stack issue

2009-06-23 Thread Al

Hi, I've come across a very annoying problem, which only seems to
happen when I launch my app from eclipse for testing. If I launch it
normally, it doesn't seem to have this problem.

This is how I can reproduce it:
- Launch app via Eclipse
- Press Home
- Relaunch app via icon
- Click menu->exit which tells the Service to clean up and calls finish
() when the Service finishes cleaning up

For some reason, there seem to be two instances of the activity, one
exits normally and the other one gains focus. Clicking exit does
nothing since the Service has stopped but the Service variable is not
null. Attempting to use the app launches errors since the resource it
uses have been closed. I can force a close via the crash and relaunch
the app, and it exits normally this time.

As I said, it only happens when launching the app via Eclipse. Anyone
know what could cause this? My launchMode is set to singleTask,
however, that shouldn't cause an issue, I used that mode before. I
tried calling finish() regardless of the state of the Service, but it
doesn't seem to 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: SensorListener and MediaPlayer (Audio)

2009-06-23 Thread Donn Felker
I'll give that a try. Thank you very much!

On Tue, Jun 23, 2009 at 3:14 PM, Marco Nelissen  wrote:

> You can just postpone calling reset() until playback is actually done
> (using an OnCompletionListener), or until your application exits.
>
>
> On Tue, Jun 23, 2009 at 12:32 PM, Donn Felker wrote:
>
>> Ahh... I think you nailed it.
>>
>> Right before I checked back for a response, I put on some headphones and
>> heard the _start_ of the sound and then it got cut off.
>>
>> Would you advise firing this playback off in a service? Is there a
>> recommended way of doing this?
>>
>> Thanks,
>>
>> Donn
>>
>>
>> On Tue, Jun 23, 2009 at 2:01 PM, Marco Nelissen wrote:
>>
>>>
>>> On Tue, Jun 23, 2009 at 6:56 AM, Donn Felker
>>> wrote:
>>> >
>>> > I'm developing an application that responds to certain accelerometer
>>> > events such as movements to the left or right when a certain delta is
>>> > reached. When these deltas are fired I want to play a sound with the
>>> > MediaPlayer.
>>> >
>>> > I'm using the Sensor Simulator by Open Intents to simulate sensor
>>> > events. I have the code set up, and I also have some basic
>>> > android.util.Log.e(...) statements telling me when these events are
>>> > fired. When I simulate the sensor, my deltas are met and my log
>>> > statements are output to LogCat. Therefore I know this is working.
>>> >
>>> > However, I now want to play an audio resource file (mp3).
>>> >
>>> > I added a method inside of the SensorListener definition called
>>> > PlayMedia(). This simply does the following:
>>> >
>>> >
>>> >private void PlayMedia()
>>> >{
>>> >if(mp != null)
>>> >{
>>> >android.util.Log.e("test","mp is not
>>> null, cleaning up!");
>>> >if(mp.isPlaying())
>>> >{
>>> >
>>>  android.util.Log.e("test","Stopping the mp!");
>>> >mp.stop();
>>> >}
>>> >}
>>> >// is not playing.
>>> >android.util.Log.e("test","creating a new mp");
>>> >mp = MediaPlayer.create(getApplicationContext
>>> > (),com.MyCompany.Apps.MyApp.R.raw.mySound);
>>> >
>>> >android.util.Log.e("test","Start the sound");
>>> >mp.start();
>>> >mp.reset();
>>>
>>> MediaPlayer.start() only starts playback, it does not wait for
>>> playback to complete, and so that call to reset() will cause playback
>>> to stop, probably before any sound is played.
>>>
>>>
>>>
>>
>>
>> --
>> Donn
>> http://blog.donnfelker.com/
>>
>>
>>
>>
>
> >
>


-- 
Donn
http://blog.donnfelker.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: SensorListener and MediaPlayer (Audio)

2009-06-23 Thread Marco Nelissen
You can just postpone calling reset() until playback is actually done (using
an OnCompletionListener), or until your application exits.


On Tue, Jun 23, 2009 at 12:32 PM, Donn Felker  wrote:

> Ahh... I think you nailed it.
>
> Right before I checked back for a response, I put on some headphones and
> heard the _start_ of the sound and then it got cut off.
>
> Would you advise firing this playback off in a service? Is there a
> recommended way of doing this?
>
> Thanks,
>
> Donn
>
>
> On Tue, Jun 23, 2009 at 2:01 PM, Marco Nelissen wrote:
>
>>
>> On Tue, Jun 23, 2009 at 6:56 AM, Donn Felker wrote:
>> >
>> > I'm developing an application that responds to certain accelerometer
>> > events such as movements to the left or right when a certain delta is
>> > reached. When these deltas are fired I want to play a sound with the
>> > MediaPlayer.
>> >
>> > I'm using the Sensor Simulator by Open Intents to simulate sensor
>> > events. I have the code set up, and I also have some basic
>> > android.util.Log.e(...) statements telling me when these events are
>> > fired. When I simulate the sensor, my deltas are met and my log
>> > statements are output to LogCat. Therefore I know this is working.
>> >
>> > However, I now want to play an audio resource file (mp3).
>> >
>> > I added a method inside of the SensorListener definition called
>> > PlayMedia(). This simply does the following:
>> >
>> >
>> >private void PlayMedia()
>> >{
>> >if(mp != null)
>> >{
>> >android.util.Log.e("test","mp is not
>> null, cleaning up!");
>> >if(mp.isPlaying())
>> >{
>> >
>>  android.util.Log.e("test","Stopping the mp!");
>> >mp.stop();
>> >}
>> >}
>> >// is not playing.
>> >android.util.Log.e("test","creating a new mp");
>> >mp = MediaPlayer.create(getApplicationContext
>> > (),com.MyCompany.Apps.MyApp.R.raw.mySound);
>> >
>> >android.util.Log.e("test","Start the sound");
>> >mp.start();
>> >mp.reset();
>>
>> MediaPlayer.start() only starts playback, it does not wait for
>> playback to complete, and so that call to reset() will cause playback
>> to stop, probably before any sound is played.
>>
>>
>>
>
>
> --
> Donn
> http://blog.donnfelker.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: Skype Lite Intent Mangement

2009-06-23 Thread Rick

Thanks, I actually have tried this already using the following code:
Intent i = new Intent(Intent.ACTION_VIEW));
i.setComponent(
new ComponentName(
"com.skype.android.lite",
"com.skype.android.lite.SkypeActivity")
);
startActivity(i);

The above code executes the skype client and takes you directly to the
contacts list.
I'm wondering if I can pass parameters to it. Using the Log cat, I was
able to pull this information:
06-22 12:18:27.523: WARN/ActivityManager(58): Activity idle timeout
for HistoryRecord{436421f8 {com.skype.android.lite/
com.skype.android.lite.ChatScreen}}

So it looks like I can open the ChatScreen Activity - I also see a
local database stored on the phone.
I bet if i knew the values to populate it with I might be able to open
up SkypeChat through some intent hackery.

So far all I get are NPE and Security denial errors. So it might not
be possible, too bad Skype doesn't have a more responsive community of
developers.

You can open the Skype Lite application using the following:


On Jun 23, 12:48 pm, RTX  wrote:
> this is from the ADB Logs
>
>  Start proc com.skype.android.lite for activity
> com.skype.android.lite/.SkypeActivity: pid=6561 uid=10035 gids={3003}
>
> try to call this activity :SkypeActivity
> or this intent : activity com.skype.android.lite
>
> hope this heklps
>
> On Jun 23, 11:51 am, "Mark Murphy"  wrote:
>
> > > Does anyone know if it is possible to open up skype lite chat using
> > > intents or some other API?
>
> > Hopefully Skype knows. I think their app is closed source, so it would be
> > difficult for others to know.
>
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > Android App Developer Books:http://commonsware.com/books.html
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: ViewGroup parent for merge

2009-06-23 Thread az9702

Right. In this case, neither LinearLayout or merge is needed.

Thanks for your help.


On Jun 23, 8:13 am, Josh Guilfoyle  wrote:
> This is not a case where  is necessary.  If you have only 1
> widget ultimately, icon_row or icon_text, you simply must put that at
> the root of the XML.  It is not necessary for you to wrap it in a
> LinearLayout, nor is it necessary for your adapter to work exclusively
> with a ViewGroup.
>
> On Jun 22, 12:23 pm, az9702  wrote:
>
> > Josh,
>
> > I have getViewTypeCount (2 here)  & getItemViewType (0/text_row, 1/
> > icon_row) in my adapter so it knows about the two row types.
> > ConvertView is set to the correct row type.
>
> > The question is how correctly apply merge & remove
> > LinearLayout given:
>
> > * layout/icon_row.xml w/ /icon_row
> > * layout/icon_text.xml w/ /icon_text
>
> > If I simply replace  with  in above xml's,
> > inflate will throw exception w/o a ViewGroup parent.
>
> > So I need to pass in ViewGroup to my Adapter somehow.
>
> > Thanks.
>
> > On Jun 22, 11:48 am, Josh Guilfoyle  wrote:
>
> > > You definitely don't want to access the list directly from the
> > > adapter.  Instead for your design what you'd want to do is remove the
> > > outer linear layout if you can and just have two separate XML files
> > > with only 1 view each (text_row or icon_row).  Then in your adapter
> > > override the methods getItemViewType and getViewTypeCount.  These
> > > methods are provided for you to have two or more different types of
> > > layouts for certain rows based.
>
> > > On Jun 22, 10:16 am, az9702  wrote:
>
> > > > Hi,
>
> > > > I have a ListView with two types of custom views.  It inflates
> > > > "icon_row" view if  a drawable exists or a "text_row" if not.
>
> > > > I came up w/ custom views for icon_row & text_row & include them in
> > > > their XML like so :
>
> > > > //text_row.xml
> > > > 
> > > >    < com.test.android.ALS.text_row
> > > >             ...
> > > >             app:text1="..."
> > > >             app:textSize1=".."
> > > >     >
> > > > /LinearLayout>
>
> > > > //icon_row.xml
> > > > 
> > > >      > > >         ...
> > > >         app:imgSrc="..."
> > > >      >
> > > > /LinearLayout>
>
> > > > I have another main.xml that defines the ListView which is set to an
> > > > adpater.
>
> > > > In my adatper's getView (in separate class file), I will inflate:
>
> > > >     if(convertView == null) {
> > > >          if() {
> > > >              convertView = mInflater.inflate(R.layout.text_row. null);
> > > >         }     else {
> > > >               convertView = mInflater.inflate(R.layout.icon_row,
> > > > null);
> > > >         }
> > > >     }
>
> > > > Both of icon_row, text_row have a root LinearLayout that seem to be
> > > > redundant. The row layouts can be directly attached ListView.  This
> > > > may be a case for "merge".
>
> > > > To use merge, I need a ViewGroup in inflate & that ViewGroup should be
> > > > my ListView.
>
> > > > My question is how to obtain a reference to the ListView w/o making
> > > > the adapter as an inner class to the main activity.
>
> > > > Thanks in advance.
>
>
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Instrumentation Tests with Toasts

2009-06-23 Thread Beginner

Hello,

I'm trying to verify error messages that are presented inside Toasts,
using instrumentation tests. Is there a way I can wait for a view to
appear on screen with a timeout?

So I basically want to wait X seconds and see if the Toast appears
during that time.

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: Skype Lite Intent Mangement

2009-06-23 Thread RTX

new Intent(SkypeActivity .class);



On Jun 23, 12:48 pm, RTX  wrote:
> this is from the ADB Logs
>
>  Start proc com.skype.android.lite for activity
> com.skype.android.lite/.SkypeActivity: pid=6561 uid=10035 gids={3003}
>
> try to call this activity :SkypeActivity
> or this intent : activity com.skype.android.lite
>
> hope this heklps
>
> On Jun 23, 11:51 am, "Mark Murphy"  wrote:
>
>
>
> > > Does anyone know if it is possible to open up skype lite chat using
> > > intents or some other API?
>
> > Hopefully Skype knows. I think their app is closed source, so it would be
> > difficult for others to know.
>
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com
> > Android App Developer Books:http://commonsware.com/books.html- Hide quoted 
> > text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Skype Lite Intent Mangement

2009-06-23 Thread RTX


this is from the ADB Logs

 Start proc com.skype.android.lite for activity
com.skype.android.lite/.SkypeActivity: pid=6561 uid=10035 gids={3003}


try to call this activity :SkypeActivity
or this intent : activity com.skype.android.lite


hope this heklps

On Jun 23, 11:51 am, "Mark Murphy"  wrote:
> > Does anyone know if it is possible to open up skype lite chat using
> > intents or some other API?
>
> Hopefully Skype knows. I think their app is closed source, so it would be
> difficult for others to know.
>
> --
> Mark Murphy (a Commons Guy)http://commonsware.com
> Android App Developer Books:http://commonsware.com/books.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] How to save the logs from the phone to a file with out eclipse

2009-06-23 Thread RTX

i want to let the users send me the logs from the device
i wonder how do i extract the logs in to a file on the device ?


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

2009-06-23 Thread Donn Felker
Ahh... I think you nailed it.

Right before I checked back for a response, I put on some headphones and
heard the _start_ of the sound and then it got cut off.

Would you advise firing this playback off in a service? Is there a
recommended way of doing this?

Thanks,

Donn

On Tue, Jun 23, 2009 at 2:01 PM, Marco Nelissen  wrote:

>
> On Tue, Jun 23, 2009 at 6:56 AM, Donn Felker wrote:
> >
> > I'm developing an application that responds to certain accelerometer
> > events such as movements to the left or right when a certain delta is
> > reached. When these deltas are fired I want to play a sound with the
> > MediaPlayer.
> >
> > I'm using the Sensor Simulator by Open Intents to simulate sensor
> > events. I have the code set up, and I also have some basic
> > android.util.Log.e(...) statements telling me when these events are
> > fired. When I simulate the sensor, my deltas are met and my log
> > statements are output to LogCat. Therefore I know this is working.
> >
> > However, I now want to play an audio resource file (mp3).
> >
> > I added a method inside of the SensorListener definition called
> > PlayMedia(). This simply does the following:
> >
> >
> >private void PlayMedia()
> >{
> >if(mp != null)
> >{
> >android.util.Log.e("test","mp is not null,
> cleaning up!");
> >if(mp.isPlaying())
> >{
> >
>  android.util.Log.e("test","Stopping the mp!");
> >mp.stop();
> >}
> >}
> >// is not playing.
> >android.util.Log.e("test","creating a new mp");
> >mp = MediaPlayer.create(getApplicationContext
> > (),com.MyCompany.Apps.MyApp.R.raw.mySound);
> >
> >android.util.Log.e("test","Start the sound");
> >mp.start();
> >mp.reset();
>
> MediaPlayer.start() only starts playback, it does not wait for
> playback to complete, and so that call to reset() will cause playback
> to stop, probably before any sound is played.
>
> >
>


-- 
Donn
http://blog.donnfelker.com/

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



[android-developers] Re: How to hang an outgoing call? (Revisited, Partly solved here)

2009-06-23 Thread Dianne Hackborn
Sorry, there is no way to do this.

On Mon, Jun 22, 2009 at 1:32 PM, N0m0r3l13s  wrote:

>
> Hi all,
>
> I'm just doing an application that controls who to call and how many
> rings let the call do. For example, to not wake up someone in the
> morning we only do 3 tones...
>
> I'm using the standard BroadcastReceiver method to stop the call from
> going out.
>
> I explain here for the people who want to do it, also.
>
> [ Manifiest ]
> 1.- You need enough permissions:
> android:name="android.permission.PROCESS_OUTGOING_CALLS" />
>
>
> To make calls and process outgoing calls.
>
> 2.- You need a broadcast receiver that catches the broadcast intent:
>
>android:enabled="true" >
>
> android:name="android.intent.action.NEW_OUTGOING_CALL" />
>
>
>
> [ Code ]
>
> 3.- You controls who can call in the:
>
> @Override
>public void onReceive(Context context, Intent intent) {
>
> }
>
> 4.- If you don't want to let any call go out you can:
>
> @Override
>public void onReceive(Context context, Intent intent) {
>setResultData(null);
> }
>
> 5.- Use the to get the call information.
>
>Bundle extras = intent.getExtras();
>
>for(Iterator
> it=extras.keySet().iterator(); it.hasNext();)
>{
>String key = it.next();
>Log.d(LOG_TAG, key);
>Log.d(LOG_TAG, "Value: " +
> extras.getString(key));
>}
>
> BUT!
>
> With this I can only censure calls, can't control how many time the
> ring sounds.
>
> the question is:
>
>
> How can I delay a little bit the call cancellation?
>
> I want to make it sound, for example, 3 seconds and then hang up.
>
> Thank you all!
>
> >
>


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

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

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



[android-developers] Help wanted for very small app

2009-06-23 Thread stevenroose

Hi,

I never developed an Android Application before but now I need to make
a very small app that gets very small xml-data from REST server.
Just a simple login screen with user and pass (maybe option to
remember) and when submitted a simple view of the little xml-data
parsed.

Please e-mail me if anyone has some time to help me with it, or maybe
make it itself.

Many thanks is advance!

Steven
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: FLAG_ACTIVITY_NEW_TASK why is it required in onRecieve when starting activity

2009-06-23 Thread Dianne Hackborn
Tasks have nothing to do with threads and processes.  Be sure you read this
overview:

http://developer.android.com/guide/topics/fundamentals.html

You need to use NEW_TASK because you are not starting the activity from an
existing activity, and thus you are not starting it from an existing task.

On Tue, Jun 23, 2009 at 5:31 AM, ani  wrote:

>
> Guys,
>
> I was under the impression that onRecieve runs in the main UI thread
> and we can launch an activity in onRecieve without setting the flag as
> new task.Why do we need to create a new task and launch the activity
> there.Why cant the activtiy launch in the task in which main UI thread
> is running?
>
> regards,
> ani
>
> >
>


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

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

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



[android-developers] Re: Catching ActivityNotFoundException

2009-06-23 Thread Dianne Hackborn
If you know for sure the activity will exist, there is no need to catch the
exception.

On Tue, Jun 23, 2009 at 11:49 AM, n179911  wrote:

>
> The JavaDoc of Context's public abstract void startActivity (Intent
> intent) said:
>
> This method throws ActivityNotFoundException if there was no Activity
> found to run the given Intent.
>
> But when I look at the android source code, it does not catch
> ActivityNotFoundException.
>
> For example in AlarmClock.java:
>
>  digitalClock.setOnClickListener(new OnClickListener() {
>public void onClick(View v) {
>if (true) {
>Intent intent = new
> Intent(AlarmClock.this, SetAlarm.class);
>intent.putExtra(Alarms.ID, id);
>startActivityForResult(intent, SET_ALARM);
>} else {
>// TESTING: immediately pop alarm
>Intent fireAlarm = new
> Intent(AlarmClock.this, AlarmAlert.class);
>fireAlarm.putExtra(Alarms.ID, id);
>
>  fireAlarm.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
>startActivity(fireAlarm);
>}
>}
>});
>
> Can you please tell me what is the code which handles the case when
> there is no activity for that intent?
>
> Thank you.
>
> >
>


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

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

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



[android-developers] Re: MemoryFile between processes

2009-06-23 Thread Dianne Hackborn
Also, fwiw, there is no reason to use a MemoryFile to share between two
threads -- you can just make any object and share it between them.

On Tue, Jun 23, 2009 at 12:14 PM, Marco Nelissen wrote:

> On Mon, Jun 22, 2009 at 1:29 PM, Alec  wrote:
>
>>
>> Hi,
>>
>> I've been able to send data via shared memory between threads within a
>> process using MemoryFile.  I then tried to send data between a service
>> and an activity in different processes, but the data did not get
>> passed.  The name for each call the MemoryFile's constructor was the
>> same.  Is it possible to share data between processes using a
>> MemoryFile?
>
>
> Two MemoryFiles with the same name don't automatically map to the same
> area.
> Currently the only way to use a MemoryFile across processes is to use
> hidden APIs, which you shouldn't do.
>
>
>
> >
>


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

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

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



[android-developers] Re: weird drawing on canvas bitmap

2009-06-23 Thread MrChaz

You might  need to explicitly call setTextSize() and setStyle() on the
Paint object to make sure it's visible

On Jun 23, 4:22 pm, sleith  wrote:
> hi, i'm trying to draw bitmap in canvas.
> the bitmap is used to draw text and background using canvas (named
> canvasBitmap)
> but the text or background that are drown to bitmap is not displayed,
> as if it's out of bounds.
> i have to translate the canvasBitmap at some points to make it draw at
> right position.
> The problem is i don't know how many pixel i should translate to.
>
> here's the code example:
>
> public OnDraw(Canvas c){
>
>   Paint mBackgroundPaint = new Paint();
>   mBackgroundPaint.setColor(Color.RED);
>
>   String mText = "Testing";
>
>   Paint mFontPaint = new Paint();
>   mFontPaint.setColor(Color.WHITE);
>
>   //setting rect
>   Rect mBackgroundRect = new Rect();
>   mFontPaint.getTextBounds(mText, 0, mText.length(), mBackgroundRect);
>
>   //the bitmap to be drawn a text and backgroundRect
>   Bitmap mBitmap = Bitmap.createBitmap(mBackgroundRect.width(),
>                                 mBackgroundRect.height(), 
> Bitmap.Config.ARGB_);
>   Canvas mCanvasBitmap = new Canvas(mBitmap);
>
>   //draw text and background to bitmap
>   mCanvasBitmap.drawColor(Color.CYAN);
>   mCanvasBitmap.drawRect(mBackgroundRect, mBackgroundPaint);
>   mCanvasBitmap.drawText(mText, 0, 0, mFontPaint);
>
>   //draw bitmap to canvas
>   c.drawBitmap(mBitmap, 0, 0, null);
>
> }
>
> this will only drawn Cyan color, the text and red background is not
> displayed
> i have to translate for example :
> mCanvasBitmap.translate(0, mBackgroundRect.height())
>
> to make it displayed (but not 100% correctly position)
> please help >.<
> thx
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: MemoryFile between processes

2009-06-23 Thread Marco Nelissen
On Mon, Jun 22, 2009 at 1:29 PM, Alec  wrote:

>
> Hi,
>
> I've been able to send data via shared memory between threads within a
> process using MemoryFile.  I then tried to send data between a service
> and an activity in different processes, but the data did not get
> passed.  The name for each call the MemoryFile's constructor was the
> same.  Is it possible to share data between processes using a
> MemoryFile?


Two MemoryFiles with the same name don't automatically map to the same area.
Currently the only way to use a MemoryFile across processes is to use hidden
APIs, which you shouldn't do.

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



[android-developers] Re: help me

2009-06-23 Thread Marco Nelissen
You can only get key events in a UI, and a service does not have a UI.


On Tue, Jun 23, 2009 at 2:33 AM, Dorjoo B  wrote:

>
> how to detect key event in android service ? 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: SensorListener and MediaPlayer (Audio)

2009-06-23 Thread Marco Nelissen

On Tue, Jun 23, 2009 at 6:56 AM, Donn Felker wrote:
>
> I'm developing an application that responds to certain accelerometer
> events such as movements to the left or right when a certain delta is
> reached. When these deltas are fired I want to play a sound with the
> MediaPlayer.
>
> I'm using the Sensor Simulator by Open Intents to simulate sensor
> events. I have the code set up, and I also have some basic
> android.util.Log.e(...) statements telling me when these events are
> fired. When I simulate the sensor, my deltas are met and my log
> statements are output to LogCat. Therefore I know this is working.
>
> However, I now want to play an audio resource file (mp3).
>
> I added a method inside of the SensorListener definition called
> PlayMedia(). This simply does the following:
>
>
>                private void PlayMedia()
>                {
>                        if(mp != null)
>                        {
>                                android.util.Log.e("test","mp is not null, 
> cleaning up!");
>                                if(mp.isPlaying())
>                                {
>                                        android.util.Log.e("test","Stopping 
> the mp!");
>                                        mp.stop();
>                                }
>                        }
>                        // is not playing.
>                        android.util.Log.e("test","creating a new mp");
>                        mp = MediaPlayer.create(getApplicationContext
> (),com.MyCompany.Apps.MyApp.R.raw.mySound);
>
>                        android.util.Log.e("test","Start the sound");
>                        mp.start();
>                        mp.reset();

MediaPlayer.start() only starts playback, it does not wait for
playback to complete, and so that call to reset() will cause playback
to stop, probably before any sound is played.

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

2009-06-23 Thread Moxor

Hi,
 me again. I recently changed the sdk 1.5_r1 to 1.5_r2 and the issue
still, but now I can compile and the error doesnt appear in the error
list.  :s

Max.
On 23 jun, 14:20, Moxor  wrote:
> Hi,
>  I have the same problem, did you find the way to fix it?
>
> Thank you.
>
> On 25 mayo, 18:20, TjerkW  wrote:
>
> > I was typing and accidently pressed "send"
>
> > So here again the problem.
>
> > I have a styles.xml with the following content:
>
> > 
> >          > parent="android:Theme.NoTitleBar.Fullscreen">
> >                 true
> >                 #FF00
> >                  > name="android:windowBackground">@drawable/spacebackground > item>
> >   
> > 
>
> > However i get the following message in eclipse
>
> > "The word ''@drawable" is not correctly spelled"
>
> > But that is nonsense!
> > I check the styles.xml that comes with android and found the following
>
> >                 @android:drawable/
> > screen_background_dark
>
> > However even this gives me the error message?!!@
>
> > What am i doing wrong?
>
> > On 25 mei, 23:17, TjerkW  wrote:
>
> > > I am extending a theme by creating a style.xml
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Skype Lite Intent Mangement

2009-06-23 Thread Mark Murphy

> Does anyone know if it is possible to open up skype lite chat using
> intents or some other API?

Hopefully Skype knows. I think their app is closed source, so it would be
difficult for others to know.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html



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



[android-developers] Re: NinePatchDrawable as ItemizedOverlay

2009-06-23 Thread skyman

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

2009-06-23 Thread n179911

The JavaDoc of Context's public abstract void startActivity (Intent
intent) said:

This method throws ActivityNotFoundException if there was no Activity
found to run the given Intent.

But when I look at the android source code, it does not catch
ActivityNotFoundException.

For example in AlarmClock.java:

 digitalClock.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
if (true) {
Intent intent = new
Intent(AlarmClock.this, SetAlarm.class);
intent.putExtra(Alarms.ID, id);
startActivityForResult(intent, SET_ALARM);
} else {
// TESTING: immediately pop alarm
Intent fireAlarm = new
Intent(AlarmClock.this, AlarmAlert.class);
fireAlarm.putExtra(Alarms.ID, id);
fireAlarm.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(fireAlarm);
}
}
});

Can you please tell me what is the code which handles the case when
there is no activity for that intent?

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: Application Needed

2009-06-23 Thread Kent Loobey

"OI Countdown" might do what you want.  Do a search on AndroidMarket.

On Tuesday 23 June 2009 10:17:22 Brian Cloutier wrote:
> While I do not know of such an app, if you give me a week or two I could
> write one for you.
>
> On Tue, Jun 23, 2009 at 9:56 AM, Fred Grott(shareme)
>
> wrote:
> > I would imagine if you would mention your branch of service that might
> > help in getting the help you require.
> >
> > Myself, I am a former Airman, USAF..1980s..
> >
> > Fred Grott
> > http://mobilebytes.wordpress.com
> >
> > On Jun 22, 3:49 am, bizzy401  wrote:
> > > I am an instructor in the military.  I have an instructor evaluation
> > > coming up and I am looking for an application that might be able to
> > > help me out.  When I am instructing a class I have to ask a question
> > > every three to six minutes.  No more no less.  I was looking for an
> > > app that would vibrate in my pocket every four minutes.  Does anyone
> > > know of an app like this?
> > >
> > > Thank you very much for any help that is offered.
>
> 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 get notified when there is a change in Content Provider

2009-06-23 Thread silverburgh

Hi,

I have read
http://developer.android.com/guide/topics/providers/content-providers.html
to understand how query Content Provider works.

But how can I get notified when there is a change in the Contact
Database (add/delete Contact by another Activity)?

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] weird drawing on bitmap to canvas

2009-06-23 Thread sleith

hi, i'm trying to draw bitmap in canvas.
the bitmap is used to draw text and background using canvas (named
canvasBitmap)
but the text or background that are drown to bitmap is not displayed,
as if it's out of bounds.
i have to translate the canvasBitmap at some points to make it draw at
right position.
The problem is i don't know how many pixel i should translate to.

here's the code example:

public OnDraw(Canvas c){

  Paint mBackgroundPaint = new Paint();
  mBackgroundPaint.setColor(Color.RED);

  String mText = "Testing";

  Paint mFontPaint = new Paint();
  mFontPaint.setColor(Color.WHITE);

  //setting rect
  Rect mBackgroundRect = new Rect();
  mFontPaint.getTextBounds(mText, 0, mText.length(), mBackgroundRect);

  //the bitmap to be drawn a text and backgroundRect
  Bitmap mBitmap = Bitmap.createBitmap(mBackgroundRect.width(),
mBackgroundRect.height(), 
Bitmap.Config.ARGB_);
  Canvas mCanvasBitmap = new Canvas(mBitmap);

  //draw text and background to bitmap
  mCanvasBitmap.drawColor(Color.CYAN);
  mCanvasBitmap.drawRect(mBackgroundRect, mBackgroundPaint);
  mCanvasBitmap.drawText(mText, 0, 0, mFontPaint);

  //draw bitmap to canvas
  c.drawBitmap(mBitmap, 0, 0, null);
}

this will only drawn Cyan color, the text and red background is not
displayed
i have to translate for example :
mCanvasBitmap.translate(0, mBackgroundRect.height())

to make it displayed (but not 100% correctly position)
please help >.<
thx

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 get actual Table with borders in display layout ?

2009-06-23 Thread Harshit mapara
Hi guys, I'm new in Android. I searched a lot to get a table with borders,
but I am not getting result. I want a table with two colums, borders, white
backgroud in table. first colums should be right aligned and second column
should be left aligned. With TableLayout, rest of things can be done, but
not I can get table with border in display. Please help Thanks Harshit

-- 
Regards,
Harshit Mapara

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

2009-06-23 Thread Brian Cloutier
While I do not know of such an app, if you give me a week or two I could
write one for you.

On Tue, Jun 23, 2009 at 9:56 AM, Fred Grott(shareme)
wrote:

>
> I would imagine if you would mention your branch of service that might
> help in getting the help you require.
>
> Myself, I am a former Airman, USAF..1980s..
>
> Fred Grott
> http://mobilebytes.wordpress.com
>
>
>
> On Jun 22, 3:49 am, bizzy401  wrote:
> > I am an instructor in the military.  I have an instructor evaluation
> > coming up and I am looking for an application that might be able to
> > help me out.  When I am instructing a class I have to ask a question
> > every three to six minutes.  No more no less.  I was looking for an
> > app that would vibrate in my pocket every four minutes.  Does anyone
> > know of an app like this?
> >
> > Thank you very much for any help that is offered.
> >
>

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

2009-06-23 Thread Rick

Does anyone know if it is possible to open up skype lite chat using
intents or some other API?

Suppose I wanted to create a short cut for a contact and I had their
skypename or skype id or skype email.

Would it be possible to do something like:
Intent i = new Intent(
 Intent.ACTION_VIEW,
 Uri.parse("skype:ladiesman217?chat")
);
i.setComponent(
new ComponentName(
 "com.skype.android.lite",
 "com.skype.android.lite.SkypeActivity")
);
startActivity(i);

I've pinged the Skype developer community about this with no results,
has anyone had any lucky with this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Integrate your own application into the Maps application

2009-06-23 Thread patschius

Hello,

My question is: "Is it possible to alter the standard Maps application
on Android in such a way that it is able to show for example some
specific POIs on the map"

Google Latidude enhances Google Maps for its purposes in this way.

So is it possible for a developer outside of Google to enhance the Map
application too?

I have searched for the source of the Map application but did not
found anything. Is this part not Open Source?

thx for your answers
CP

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] handling events (click, tap, touch) for map (mapview, mapactivity)

2009-06-23 Thread maijau

Hello,

could anyone point me to some documentation or code on what's "the
official" way to handle events on a mapview or within a mapactivity? I
have searched around, there seem to be lots of questions regarding
this issue, few answers, and every answer is different.
As an example, I want to do something similar to the MyTracks
application: on a touch on the map, the builtin zoomcontrols appear,
panning still works, and in addition, other controls (the next/prev)
buttons are shown.

It seems I cannot achieve the desired effect using standard event
handlers, e.g. I could not get it to work by setting an
onClickListener or onTouchListener and implementing onClick()/onTouch
().

What is not clear to me:
- do I have to go directly to using overlays to achieve such an
effect? I understood overlays are more intended to display data on
maps, as opposed to controls?
- do I have to subclass mapview or mapactivity or both?
- is there a way without extending mapview, mapactivity and just
employing the standard event handling interface?

Thanks
Martin

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

2009-06-23 Thread Donn Felker

I'm developing an application that responds to certain accelerometer
events such as movements to the left or right when a certain delta is
reached. When these deltas are fired I want to play a sound with the
MediaPlayer.

I'm using the Sensor Simulator by Open Intents to simulate sensor
events. I have the code set up, and I also have some basic
android.util.Log.e(...) statements telling me when these events are
fired. When I simulate the sensor, my deltas are met and my log
statements are output to LogCat. Therefore I know this is working.

However, I now want to play an audio resource file (mp3).

I added a method inside of the SensorListener definition called
PlayMedia(). This simply does the following:


private void PlayMedia()
{
if(mp != null)
{
android.util.Log.e("test","mp is not null, 
cleaning up!");
if(mp.isPlaying())
{
android.util.Log.e("test","Stopping the 
mp!");
mp.stop();
}
}
// is not playing.
android.util.Log.e("test","creating a new mp");
mp = MediaPlayer.create(getApplicationContext
(),com.MyCompany.Apps.MyApp.R.raw.mySound);

android.util.Log.e("test","Start the sound");
mp.start();
mp.reset();
}

However, when I calll this, no sound ever happens. The log messages
are output into LogCat. Therefore the code is making it into the
method, yet no sound is being output.

The odd thing is, I opened the ApiDemos and rand the Media demos and
they worked perfectly. The resource apidemo worked and played the
sound in the emulator. However, in my testing, I cannot get it to
play.

I've done the following: Moved the player code outside of the
sensorlistener into the activity and then called the PlayMedia() from
within the nested SensorListner, and it still doesnt work.

The only thing different in this code than in the ApiDemo is that my
MediaPlayer is inside of the SensorListener (as shown below). I also
use getApplicationContext() because in the ApiDemo's the example shows
"this" as it is inside of an Activity.

Why would the sound _not_ play? Its a 56kbps file. I've also taken the
same resource from the APiDemo's and tried to use that and still, no
dice.

I'm also noticing that I'm having to fully qualify my resources (R)
which is kind of odd. Anyone know why that would happen? Would that be
the cause? I've deleted, the gen folder and regnerated it a few times
and I still have to fully qualify my Resources. (I'm using Eclipse).

Does anyone know why this would not work?


Thanks,

Donn

--- Code below --

private final SensorListener mListener = new SensorListener() {

private MediaPlayer mp;

private final float[] mScale = new float[] { 2, 2.5f, 0.5f }; //
accel

private float[] mPrev = new float[3];

public void onSensorChanged(int sensor, float[] values) {
boolean show = false;
float[] diff = new float[3];

for (int i = 0; i < 3; i++) {
diff[i] = Math
.round(mScale[i] * (values[i] - 
mPrev[i]) * 0.45f);
if (Math.abs(diff[i]) > 0) {
show = true;
}
mPrev[i] = values[i];
}

if (show) {
// only shows if we think the delta is big enough, in 
an attempt
// to detect "serious" moves left/right or up/down
android.util.Log.e("test", "sensorChanged " + sensor + 
" ("
+ values[0] + ", " + values[1] + ", " + 
values[2] + ")"
+ " diff(" + diff[0] + " " + diff[1] + 
" " + diff[2]
+ ")");
}

long now = android.os.SystemClock.uptimeMillis();
if (now - mLastGestureTime > 1000) {
mLastGestureTime = 0;

float x = diff[0];
float y = diff[1];
boolean gestX = Math.abs(x) > 3;
boolean gestY = Math.abs(y) > 3;




if ((gestX || gestY) && !(gestX && gestY)) {


if (gestX) {
if (x < 0) {
PlayMedia();
android.util.Log.e("test",
" LEFT 

[android-developers] Problem with createBitmap method

2009-06-23 Thread hamlatzis

My application crashes after I try to use the static Bitmap
createBitmap method to get a mutable bitmap in order to fill it later
with data.

If I only create one 1024x1024 the application works just fine, but
when I try to load the same image more than once (first making my
object null in each round) my application crashes on my third or
fourth try.

eg
Bitmap mpBitmap = null;

void CreateBitmap(int nWidth, int nHeight)
{
 if ( mpBitmap != null )
  mpBitmap = null;
 mpBitmap = Bitmap.createBitmap(nWidth, nHeight,
Bitmap.Config.ARGB_);
}


I get the same result if I create a smaller image but then I need more
runs before the crash. In all cases my application works just fine if
I only create the image (even 1024x1024) once, then exit my
application and run it again.

If there is a need for "crash dump" I can provide one.

Any help will be appreciated.

Thanks,

Iosif

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

2009-06-23 Thread sleith

hi, i'm trying to draw bitmap in canvas.
the bitmap is used to draw text and background using canvas (named
canvasBitmap)
but the text or background that are drown to bitmap is not displayed,
as if it's out of bounds.
i have to translate the canvasBitmap at some points to make it draw at
right position.
The problem is i don't know how many pixel i should translate to.

here's the code example:

public OnDraw(Canvas c){

  Paint mBackgroundPaint = new Paint();
  mBackgroundPaint.setColor(Color.RED);

  String mText = "Testing";

  Paint mFontPaint = new Paint();
  mFontPaint.setColor(Color.WHITE);

  //setting rect
  Rect mBackgroundRect = new Rect();
  mFontPaint.getTextBounds(mText, 0, mText.length(), mBackgroundRect);

  //the bitmap to be drawn a text and backgroundRect
  Bitmap mBitmap = Bitmap.createBitmap(mBackgroundRect.width(),
mBackgroundRect.height(), 
Bitmap.Config.ARGB_);
  Canvas mCanvasBitmap = new Canvas(mBitmap);

  //draw text and background to bitmap
  mCanvasBitmap.drawColor(Color.CYAN);
  mCanvasBitmap.drawRect(mBackgroundRect, mBackgroundPaint);
  mCanvasBitmap.drawText(mText, 0, 0, mFontPaint);

  //draw bitmap to canvas
  c.drawBitmap(mBitmap, 0, 0, null);
}

this will only drawn Cyan color, the text and red background is not
displayed
i have to translate for example :
mCanvasBitmap.translate(0, mBackgroundRect.height())

to make it displayed (but not 100% correctly position)
please help >.<
thx

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Calibration with the environment may improve the readings ?!

2009-06-23 Thread Gryyphyn

I haven't looked through the source for the compass but there has to
be a set() method that you can apply a positive or negative value to,
possibly on tha app level. The compass is accurate enough so all you
would really have to do is assign a set() method to a menu calibration
option to allow the user to align with a standard compass and set the
value that modifies the OSD compass alignment, similar to the bubble
app and its calibration with the accelerometers. Just a thought...

Gryyphyn, out.

On Jun 16, 10:21 pm, Delta Foxtrot  wrote:
> 2009/6/17 flegare 
>
>
>
> > I auto answer myself and the poor soul who fall on this post, so far
> > the only way to calibrate is by making big 8-like gesture with the
> > phone. Try it it worked for me.
>
> Yes, the digital compass in the G1 is self calibrating, but you have to make
> figure 8's or similar to make it do it, this isn't something you can do in
> software, the Android OS has magnetic field projections for the earth and if
> the current reading falls outside a specific range either something is
> artificially influencing it, such as the magnetic field in metals or
> electromagnetic fields caused by electronics and cars etc, or it needs
> calibration.

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

2009-06-23 Thread p1erstef

I met the same issue.
Here the workaround I found :

BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 8;
Bitmap bitmap = BitmapFactory.decodeFile(filename, options);
BitmapDrawable drawable = new BitmapDrawable(bitmap);
imageView.setImageDrawable(drawable);

Hope this helps,

Pierre


On Jun 1, 3:36 pm, Android Users  wrote:
> Hi all,
> Can i resize an image to a lower resolution as i am getting an
> OutOfMemoryException when trying to display image with 2048x1536 resolution
> or more?

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

2009-06-23 Thread Brian Cloutier
It's been a while since I last made an Android Application, so take this
with a grain of salt, but can't you just fire an intent to start the dialog
from onStart()?

On Mon, Jun 22, 2009 at 9:06 PM, Georgy  wrote:

>
> Hello,
>
>
> I am trying to initiate a progress bar when my application starts. The
> way my application works is that it collects info from the db that
> takes around 5 to 6 secs where the screen is completely black.  I am
> trying to initiate a progress dialog that gets triggered WITHOUT a
> button click or any other UI interaction but just when the user starts
> the application.
>
> All the previous posts handled something with handlers and UI
> interactions.
>
> any luck?
>
> 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] help me

2009-06-23 Thread Dorjoo B

how to detect key event in android service ? 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] IPsec support ?

2009-06-23 Thread Ram

Hi,

Is there IPsec support on Android.
Does Android support Application developers to make use of the IPsec ?

Thank you,
Ram.

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



[android-developers] Re: listview click problem

2009-06-23 Thread neoLwin

Try setting the width of the list view to "fill_parent".

On Jun 21, 10:13 pm, tstanly  wrote:
> hi all,
>
> i have a listview as bellow,
>
> ---
> Google
> ---
> Yahoo!
> --
>
> if i want to go to the Google,
> just click the "Google" of the list,
> but it just active when i click on the word "Google"
> because i wish can click anywhere if it's click on the same raw of
> "Google" word
>
> but now i must click on the "word"(Google or Yahoo!),
> how can solve??
>
> 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 close activity?

2009-06-23 Thread Fei Zhang
I don't think you need close 2, the system will do it! Is it right?

2009/6/23 tstanly 

>
> hi all,
>
> i have a app,the structure composed three .java,
> 1.java,2.java,3.java
>
> their relationship is:
> 1->2->3
> and 3 can go back to 1
>
> when i was back to 1 from 3,
> i want to close the 2,
>
> how to do this?
> 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] How to add a new text language in my Android when not included?

2009-06-23 Thread camilo.arreaza

How can i add a new text languaje not included as an option when
writing a memo or text mesage in Android?

Imagine you work for a multinational In Switzerland where you might
speak in German and English, you live in a French speaking city and
you are part of the huge comunity from Latin América (nearly 25% of
Geneva's Market place speaks espanish)...you might write e-mails to
your family and olde friends once in a while..but with Android you
can't because that text language is not an option!!..

Using Android i'm surprise to find  that i can ONLY switch between
German, Italian, French, English and Portugues...

When deciding in between the Apple aplication for the Iphone and
Android i'm glad to see that apple let you switch between any single
text language..from Chinese to greek, japanese or Espanish etc..
without restriction..

What if you are part of those 10 thousend Chinese working at ONU
here?, or if your mother language is Sweedish?




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

2009-06-23 Thread Alec

Hi,

I've been able to send data via shared memory between threads within a
process using MemoryFile.  I then tried to send data between a service
and an activity in different processes, but the data did not get
passed.  The name for each call the MemoryFile's constructor was the
same.  Is it possible to share data between processes using a
MemoryFile?

Thanks,
Alec

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

2009-06-23 Thread Brian Cloutier
And posts like that aren't going to help your case.

On Mon, Jun 22, 2009 at 8:36 PM, Rotem Or  wrote:

>
> --
> Thanks
> Rotem Or
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Transparency/Translucency working on emulator but not device

2009-06-23 Thread Carl Minden

I have tried to replicate the Transparency/Translucency effects
created in the API Demo(which works flawlessly) and the code i wrote
works on the emulator but not on my actual device(Google ION)

I copied the styles and colors.xml files from the API demos code and
set the theme of my activity I want to be transparent to "@style/
Theme.Transparent" in my activity i set my content view to a layout
which contains only a TextView containing :
http://schemas.android.com/apk/res/android";
android:id="@+id/text"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical|center_horizontal"
android:text="should have transparent background"
/>
 i have also tried setting the theme using: setTheme
(R.style.Theme_Transparent);

but nothing I try seems to work on the device, Any thoughts? is there
something I am missing?

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] How to hang an outgoing call? (Revisited, Partly solved here)

2009-06-23 Thread N0m0r3l13s

Hi all,

I'm just doing an application that controls who to call and how many
rings let the call do. For example, to not wake up someone in the
morning we only do 3 tones...

I'm using the standard BroadcastReceiver method to stop the call from
going out.

I explain here for the people who want to do it, also.

[ Manifiest ]
1.- You need enough permissions:



To make calls and process outgoing calls.

2.- You need a broadcast receiver that catches the broadcast intent:







[ Code ]

3.- You controls who can call in the:

@Override
public void onReceive(Context context, Intent intent) {

}

4.- If you don't want to let any call go out you can:

@Override
public void onReceive(Context context, Intent intent) {
setResultData(null);
}

5.- Use the to get the call information.

Bundle extras = intent.getExtras();

for(Iterator 
it=extras.keySet().iterator(); it.hasNext();)
{
String key = it.next();
Log.d(LOG_TAG, key);
Log.d(LOG_TAG, "Value: " + 
extras.getString(key));
}

BUT!

With this I can only censure calls, can't control how many time the
ring sounds.

the question is:


How can I delay a little bit the call cancellation?

I want to make it sound, for example, 3 seconds and then hang up.

Thank you all!

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



[android-developers] Porting RDP (Remote Desktop Protocol) to Android -- questions

2009-06-23 Thread kirkbeaty

Attempting to port RDP to Android ... saw someone had started this,
Desktoid/Connectoid, but that effort seems to have stopped .. and I
need this function immediately.   I have initial screen image of the
Desktop displayed (with some local Android GUI expert's help) on the
Android as a Bitmap.

There are several calls that RDP does which I can not find equivalents
in the Android GUI.   Those in the subject and others:

drawGlyph, setClip, Cursor,  IndexColorModel, etc.

Just to get the initial image was not without considerable effort ...
"little" things like which Bitmap.Config was used was key ... seems it
requires Bitmap.Config.RGB_565  (others did not work, and without
understanding as to why ?).

Willing to partner with any experts out there to get this completed.
Think it a very useful utility.

Of course, we need to have real ENTERPRISE WPA (even iPhone has this
out of the box) to really make this complete (instead of doing it on
emulator only :-)

Thanks for any assistance anyone can provide.
Kirk Beaty
kirkbe...@gmail.com

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



[android-developers] Google map does not work.

2009-06-23 Thread Jack

Hello all,

I'm new to android and need some help. I'm creating a basic Mapview
application which will display my current location on the google map.
Initially i had many doubts while creating the application, but thanks
to google archives that helped me to reach this point. I
have followed almost all the threads on the google site
but still unable to see my location on the google maps. It always
shows a white screen on the emulator with google image at the bottom.
Please help to make it work. From most of the threads I learn that we
need to sign our application with the correct fingerprint. I did so
but unsuccessful.

The following will explain the steps:
1. Using sdk version android-sdk-windows-1.0_r1
2. Created a new android application.
3. Signing the application:
a. C:\Program Files\Java\jdk1.6.0_13\bin>keytool.exe -list -alias
androiddebugkey -
keystore "D:\Profiles\fknq86\Local Settings\Application Data
\Android\debug.keyst
ore" -storepass android -keypass android
b. Certificate fingerprint (MD5):
75:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:33
where XX=some alpha numeric data
c. signing up for an Android Maps API key! using link
Sign Up for the Android Maps API - Android Maps API - Google Code
4. Code below: There are 2 applications 1. Find Me 2. ShowMyLoc.
FindMe has a button which directs it to ShowMyLoc (using Intent) to
show the location on the google maps. For simplicity sake i'm pasting
the code only for ShowMyLoc app.

//ShowMyLoc.java
Code:

package org.anddev.android.findme;

import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;

public class ShowMyLoc extends MapActivity {
   private Location myLocation;
   protected MapView myMapView = null;
   protected LocationManager myLocationManager = null;
   protected MapController mapController;

   @Override
   protected boolean isRouteDisplayed() {
   // TODO Auto-generated method stub
   return false;
   }

   @Override
   protected void onCreate(Bundle icicle) {
   // TODO Auto-generated method stub
   super.onCreate(icicle);
   this.myMapView = new MapView(this,
"0ZFOV5MY-5tIiNoVa_UiMuiMf39w_N6T5DalZzg");

   this.setContentView(myMapView);

   mapController = myMapView.getController();
   mapController.setZoom(15);

   this.myLocation = new Location("gps");
   this.myLocation.setLongitude(77.52436144125092);
   this.myLocation.setLatitude(13.05096452223662);
   updateView();
   }

   private void updateView(){
   Double lat = myLocation.getLatitude();
   Double lng = myLocation.getLongitude();

   GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue());
   mapController.setCenter(point);
 }

//Menifest.xml

HTML Code:


http://schemas.android.com/apk/res/android";
 package="org.anddev.android.findme"
 android:versionCode="1"
 android:versionName="1.0.0">
 
 
 
 
 
 
 
 
 
 

   
   
   
   
   

06-23 16:49:43.218: ERROR/vold(538): Error opening switch name path '/
sys/class/switch/test2' (No such file or directory)
06-23 16:49:43.218: ERROR/vold(538): Error bootstrapping switch '/sys/
class/switch/test2' (m)

06-23 16:49:43.218: ERROR/vold(538): Error opening switch name path '/
sys/class/switch/test' (No such file or directory)

06-23 16:49:43.218: ERROR/vold(538): Error bootstrapping switch '/sys/
class/switch/test' (m)

06-23 16:49:43.388: ERROR/flash_image(544): can't find recovery
partition

06-23 16:50:01.388: ERROR/MemoryHeapBase(572): error opening /dev/
pmem: No such file or directory

06-23 16:50:01.398: ERROR/SurfaceFlinger(572): Couldn't open /sys/
power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake

06-23 16:50:01.468: ERROR/GLLogger(572): couldn't load 
library (Cannot find library)

06-23 16:50:03.027: ERROR/GLLogger(572): couldn't load 
library (Cannot find library)

06-23 16:50:07.187: ERROR/BatteryService(572): Could not open '/sys/
class/power_supply/usb/online'

06-23 16:50:07.196: ERROR/BatteryService(572): Could not open '/sys/
class/power_supply/battery/batt_vol'

06-23 16:50:07.207: ERROR/BatteryService(572): Could not open '/sys/
class/power_supply/battery/batt_temp'

06-23 16:50:07.748: ERROR/EventHub(572): could not get driver version
for /dev/input/mouse0, Not a typewriter

06-23 16:50:07.786: ERROR/EventHub(572): could not get driver version
for /dev/input/mice, Not a typewriter

06-23 16:50:08.007: ERROR/System(572): Failure starting core service

06-23 16:50:08.007: ERROR/System(572): java.lang.SecurityException

06-23 16:50:08.007: ERROR/System(572): at
android.os.BinderProxy.transact(Native M

[android-developers] Retrieving the default email from the email client provided by Android

2009-06-23 Thread Eddie Ayling

Hi Everyone,
I am developing an application which requires to autopopulate a
default email field.
The logical choice is to retrieve the email address from the email
client provided by android.
I searched the content providers and did not find anything about the
email client.
How is this information stored?
How can I reach it?

Cheers,
Eddie

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] FLAG_ACTIVITY_NEW_TASK why is it required in onRecieve when starting activity

2009-06-23 Thread ani

Guys,

I was under the impression that onRecieve runs in the main UI thread
and we can launch an activity in onRecieve without setting the flag as
new task.Why do we need to create a new task and launch the activity
there.Why cant the activtiy launch in the task in which main UI thread
is running?

regards,
ani

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

2009-06-23 Thread N0m0r3l13s

Hi.

I suppose there must be an Intent to call the camera app.

Other thing is if you want to capture video directly from camera.
The best way you can do it is analyzing the camera application that
comes from
google. And follow up the steps to set it up in you program.

Sorry, cannot help more.


On 23 jun, 07:38, cindy  wrote:
> I want to call camera application from my own application, take video.
> Then I want to get the video back and return to my application. How
> Can I do it?
>
> Thanks!
>
> April

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

2009-06-23 Thread ani

Guys,

I would like to know the reason behind this behaviour.I have a
broadcast reciever and in onrecieve i am trying to start an
activity,however if i am not giving the flags it is giving an
exception .On declaring the flags it is working perfectly fine,why?

I was under the impression that onRecieve runs in the main UI thread
and we can launch an activity in onRecieve.Error given by the emulator
is self explanatory but still why do i need to create an activity in a
new task(only in onRecieve)?

onRecieve {
Intent intent4activity2 = new Intent
("android.intent.action.activity2");
//intent4activity2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
arg0.startActivity(intent4activity2);
}

regards,
ani

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



[android-developers] Re: One activity per view

2009-06-23 Thread 张飞
Maybe u can write youe AndroidManifest.xml  like this:


   
   
   
   

   
   
   
   

2009/6/22 bsbi...@googlemail.com 

>
> Hi,
>
> Thanks.
>
> I have currently have three pages and have three activities. The
> problem is that when I deploy the app on my phone I see three app
> icons
>
> Any ideas?
>
> How do I say activityOne is the default activity and the other two are
> sub-activities of activityOne?
>
> android:label="@string/app_name">
>
> android:name="android.intent.action.MAIN" />
> android:name="android.intent.category.LAUNCHER" />
>
>
> android:label="@string/
> app_name">
>
> android:label="@string/
> app_name">
>
>
>
>
>
>
>
>
>
>
> On Jun 22, 12:49 pm, Mark Murphy  wrote:
>  > bsbi...@googlemail.com wrote:
> > > I am developing an app with there pages (views). Would each page be a
> > > separate activity?
> >
> > Possibly. You can go either way. I usually assume separate activities
> > until something forces my hand to go to multiple "pages" in one activity.
> >
> > --
> > Mark Murphy (a Commons Guy)http://commonsware.com|
> http://twitter.com/commonsguy
> >
> > Looking for Android opportunties?http://wiki.andmob.org/hado
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 get actual Table with borders in display layout ?

2009-06-23 Thread Mapara,Harshit Nitinkumar

Hi guys,

I'm new in Android. I searched a lot to get a table with borders, but
I am not getting result.

I want a table with two colums, borders, white backgroud in table.
first colums should be right aligned and second column should be left
aligned.

With TableLayout, rest of things can be done, but not I can get table
with border in display.

Please help
Thanks

Harshit

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

2009-06-23 Thread KoZinE

Hi,

I am currently doing an application which will play a sound from a
selection via a spinner. I've tried many ways but I still cannot get
it to play a sound.

Here is my code for the constraints and spinner.

// List-based Constants
public static final int HAPPY = 0;
public static final int LAUGHTER = 1;

//code for spinner
Spinner s = (Spinner) findViewById(R.id.SoundSpinner);
ArrayAdapter adapter = ArrayAdapter.createFromResource
(
   this, R.array.Sounds,
android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource
(android.R.layout.simple_spinner_dropdown_item);
s.setAdapter(adapter);
s.setOnItemSelectedListener(OnItemSelectedListener);

Spinner.OnItemSelectedListener OnItemSelectedListerner
= new
OnItemSelectedListener() {
public void onItemSelected(AdapterView parent,
View v, int idNum,
long id) {


switch (idNum){
case HAPPY:
  Music.play(this, R.raw.happy);
break;
case LAUGHTER:
Music.play(this, 
R.raw.laughter);
break;

 }
 }
 public void onNothingSelected(AdapterView
arg0) {}
 };

I know android's spinner does not respond to setOnItemClickListener.
However, when I changed it to onClick, I get confused with the code
and the application quits by itself when I run it on the emulator. Can
anyone help me? Thank you so much! (:

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



[android-developers] Build apk from command line

2009-06-23 Thread sumd

Hi,

 Is is possible to build apk with jar, Manifest.xml, and res
directory?

 I've a jar file with one activity. Application which will use this
jar can come from external.
I'm not giving my jar file to the app developer. I would like to build
an apk which includes my jar, application jar, application manifest
and resources.
According to this thread
http://groups.google.com/group/android-developers/browse_thread/thread/11aa21996839cef5/9d3d978fdfcd48e9?hide_quotes=no,
we can't include resources and manifest in a jar.
 My goal is to edit the manifest to list my activity (the one inside
jar) and make it as a launcher activity, and build apk with
application jar, resources and my jar. I understand ant needs other
things like build.xml and project properties.

Is there any other way to build apk from command line with jar,
manifest, biuld.xml and resources?

Thanks,
sumd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Possible bug when extending themes

2009-06-23 Thread Moxor

Hi,
 I have the same problem, did you find the way to fix it?

Thank you.

On 25 mayo, 18:20, TjerkW  wrote:
> I was typing and accidently pressed "send"
>
> So here again the problem.
>
> I have a styles.xml with the following content:
>
> 
>          parent="android:Theme.NoTitleBar.Fullscreen">
>                 true
>                 #FF00
>                  name="android:windowBackground">@drawable/spacebackground item>
>   
> 
>
> However i get the following message in eclipse
>
> "The word ''@drawable" is not correctly spelled"
>
> But that is nonsense!
> I check the styles.xml that comes with android and found the following
>
>                 @android:drawable/
> screen_background_dark
>
> However even this gives me the error message?!!@
>
> What am i doing wrong?
>
> On 25 mei, 23:17, TjerkW  wrote:
>
> > I am extending a theme by creating a style.xml
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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: Does anyone make video recording work at Android 1.5?

2009-06-23 Thread cindy

please help me!

On Jun 22, 9:45 am, cindy  wrote:
> I have tried 1.5 video API. I could not make it work.It even can't do
> preview.
>
>  following is my code:
> private boolean initializeVideo() {
>         Log.v(TAG, "initializeVideo");
>
>         if(Common.mRecordedVideo!=null && Common.mRecordedVideo.exists())
>                 Common.mRecordedVideo.delete();
>         File sDir = Environment.getExternalStorageDirectory();
>         String baseDir = sDir + Common.BASE_DIR;
>         File sampleDir=new File(baseDir);
>         if(!sampleDir.canWrite()) // Workaround for broken sdcard
> support on the device.
>             sampleDir = new File("/sdcard/sdcard");
>
>         try
>         {
>             Common.mRecordedVideo = File.createTempFile(PREFIX,
> EXTENSION, sampleDir);
>         }
>         catch(IOException e)
>         {
>             AlertDialog.Builder ab = new AlertDialog.Builder
> (VideoRecord.this);
>             ab.setTitle("Error");
>             ab.setMessage(" can't write audio data to storage");
>             ab.setIcon(R.drawable.error);
>             ab.setNeutralButton("Close", new
> DialogInterface.OnClickListener()
>             {
>                 public void onClick(DialogInterface dialog, int
> whichButton)
>                 {
>                 }
>             });
>             ab.show();
>             return false;
>         }
>
>         Intent intent = getIntent();
>         releaseMediaRecorder();
>
>         if (mSurfaceHolder == null) {
>             Log.v(TAG, "SurfaceHolder is null");
>             return false;
>         }
>
>         mMediaRecorder = new MediaRecorder();
>
>          mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
>
>         mMediaRecorder.setVideoSource
> (MediaRecorder.VideoSource.CAMERA);
>         mMediaRecorder.setOutputFormat
> (MediaRecorder.OutputFormat.THREE_GPP);
>
>         mMediaRecorder.setMaxDuration(MAX_RECORDING_DURATION_MS);
>         mMediaRecorder.setOutputFile
> (Common.mRecordedVideo.getAbsolutePath());
>
>         // Use the same frame rate for both, since internally
>         // if the frame rate is too large, it can cause camera to
> become
>         // unstable. We need to fix the MediaRecorder to disable the
> support
>         // of setting frame rate for now.
>         mMediaRecorder.setVideoFrameRate(20);
>        mMediaRecorder.setVideoSize(352,288);
>
>         mMediaRecorder.setVideoEncoder
> (MediaRecorder.VideoEncoder.H263);
>
>         mMediaRecorder.setPreviewDisplay(mSurfaceHolder.getSurface());
>
>         try {
>             mMediaRecorder.prepare();
>         } catch (IOException exception) {
>             Log.e(TAG, "prepare failed for " );
>             releaseMediaRecorder();
>             // TODO: add more exception handling logic here
>             return false;
>         }
>         mMediaRecorderRecording = false;
>
>         return true;
>     }
>
>  private void startVideoRecording() {
>         Log.v(TAG, "startVideoRecording");
>         if (!mMediaRecorderRecording)
>         {
>                 // Check mMediaRecorder to see whether it is initialized or
> not.
>             if (mMediaRecorder == null && initializeVideo() ==
> false )
>             {
>                 Log.e(TAG, "Initialize video (MediaRecorder)
> failed.");
>                 return;
>             }
>             try
>             {
>                 mMediaRecorder.setOnErrorListener(this);
>                 mMediaRecorder.setOnInfoListener(this);
>                 mMediaRecorder.start();   // Recording is now started
>             } catch (RuntimeException e) {
>                 Log.e(TAG, "Could not start media recorder. ", e);
>                 return;
>             }
>             mMediaRecorderRecording = true;
>             mRecordingStartTime = SystemClock.uptimeMillis();
>             updateRecordingIndicator(true);
>             mRecordingTimeView.setText("");
>             mRecordingTimeView.setVisibility(View.VISIBLE);
>             mHandler.sendEmptyMessage(UPDATE_RECORD_TIME);
>             setScreenTimeoutInfinite();
>         }
>     }
>
> On Jun 21, 6:05 pm, cindy  wrote:
>
> > do you have any simple sample code for video recording?
>
> > Thanks!
>
> > Cindy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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] Get a unique string / serial number?

2009-06-23 Thread dapaintballer331

Is there any way to get some type of serial number or unique string,
that no other android device should have?

It can't be relative to the sim card, I'm looking for some type of
hardware identification number...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Application Needed

2009-06-23 Thread Fred Grott(shareme)

I would imagine if you would mention your branch of service that might
help in getting the help you require.

Myself, I am a former Airman, USAF..1980s..

Fred Grott
http://mobilebytes.wordpress.com



On Jun 22, 3:49 am, bizzy401  wrote:
> I am an instructor in the military.  I have an instructor evaluation
> coming up and I am looking for an application that might be able to
> help me out.  When I am instructing a class I have to ask a question
> every three to six minutes.  No more no less.  I was looking for an
> app that would vibrate in my pocket every four minutes.  Does anyone
> know of an app like this?
>
> Thank you very much for any help that is offered.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, 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 on video recording

2009-06-23 Thread cindy

I have tried a long time to recording video using 1.5's new API. I
really could not make it work. Have you try it? Do you know any sample
demo code for video recording ?

Thanks!

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

2009-06-23 Thread Fred Grott(shareme)

If I remember correctly Google MAps API does not supply geocoding so
you would need to integrate with one o f the free ones out there and
that should enable you to match up to business data..

Search this forum as there are some posts about it..listing the free
API/services and etc


Fred Grott
http://mobilebytes.wordpress.com


On Jun 21, 3:09 pm, Chris  wrote:
> Hi,
>
> I am looking for ways to get information on nearby businesses like
> restaurants etc., given a GPS long/lat item.
>
> 1. Reverse Geocoding does not seem to give me this information.
>
> 2. Google Maps/Earth has a "Businesses" overlay, is this data somehow
> accessible?
>
> 3. Can I perform a Google Search Engine search? The AJAX Search API
> does not seem to be available on Android.
>
> 4. When I do a normal Google Search on a City and e.g. Starbucks, I
> get much more hits than in 2., that's why I could prefer 3.
>
> Any Ideads are appreciated!
> Thanks,
> Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



  1   2   >