[android-developers] Library Projects with Resources to Jar using r14
When I saw the update notes for r14 regarding library projects, I was ecstatic. It's a dream come true to be able to export a library project as a JAR file! From the latest release notes, it looks like things are coming along, however it appears that resources are still not bundled in the new Jar files created in Eclipse. In the Android Developers Blog, Xavier Ducrohet wrote: This solves the implementation fragility in Eclipse and will allow us to, later, enable distribution of libraries as a single jar file. Does anyone know what parts are still missing? Is there any way to hack the resources in? With the new resource indexes in R14 it seems there might be a manual way to get it done now. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Fragment.onActivityResult is not called
I think Peter's response is accurate. There seems to be a bug in the FragmentActivity.startActivityFromFragment method. I went back and looked at the ApiDemos code and it does work as long as requestCode = 0. However, if you change the request code to anything other than zero, the ApiDemos will fail. I reported the issue here: http://code.google.com/p/android/issues/detail?id=15394 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Fragment.onActivityResult is not called
I have an application that targets 2.1. I'm using the Android Compatibility Package to migrate the code in my Activities to Fragments. I had an Activity which was launching a contact picker as follows: Intent contactPickerIntent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI); startActivityForResult(contactPickerIntent, CONTACT_PICKER_RESULT); The result was appropriately handled in the onActivityResult for the Activity: @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode != Activity.RESULT_OK) return; switch (requestCode) { case CONTACT_PICKER_RESULT: handleResult(data); break; } } Now, I've migrated both the startActivityForResult call and the onActivityResult into a Fragment. I have also extended FragmentActivity in the hosting Activity. The contact picker still launches correctly, but onActivityResult in the fragment is never called. If I override onActivityResult in the FragmentActivity, it *IS* called. However, I don't want to handle the result there because it breaks the encapsulation philosophy of the new fragments. Shouldn't onActivityResult in the fragment be called? Am I missing something? Thanks for your assistance! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Identify phone number on web page
Take a look at the Linkify class. It may be quite useful. You would need to use it to add markup to the html before the webview renders it. http://developer.android.com/reference/android/text/util/Linkify.html On Mar 9, 6:22 am, Anndy see.n...@gmail.com wrote: Hi All, I have a html page which i am going to open in a WebView. Is there a way I can identify a phone number on the page and when click on it, calls the number. Regards, Anndy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Honeycomb / Fragments: can't remove a fragment added in XML layout
I reproduced your issue. It seems the same for me. FragmentTransaction.hide(Fragment) seems to work, but remove does not. Also, the second attempt generates an exception as you described. 1up. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: HTC Incredible, unified media content provider for internal/external storage
The content URI for images in the “phoneStorage” seems to be content://media/phoneStorage/images/media Can you try using that Uri instead of EXTERNAL_CONTENT_URI? Of course this will require some conditional code specifically for the Incredible, but at least you may be able to get to the content. It *looks* like it works in my test, but my fixture doesn’t display the image so I’m only 90% sure here. I got the URI using this: Uri contenturi = Images.Media.getContentUri(“phoneStorage”); … where phoneStorage is the volume name. There may be some other code you can use to iterate volume names so that the code isn’t totally Incredible specific. I hope this helps. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] ADB working with HTC Droid Eris?
I'm trying to debug apps with the new HTC Droid Eris and ADB doesn't seem to recognize the device. I have the latest SDK installed with Usb Driver Package, Revsion 2 downloaded through the Android SDK and AVD Manager. When the device is connected, it recognizes new hardware and I point it to the usb_driver folder to install the drivers. Windows accepts and installs the drivers. However, adb devices from a command prompt never lists the phone. I've tried this on two different Windows XP systems. I have Unknown Sources and USB Debugging checked under Application Settings, Development. Is anyone else debugging with the Eris? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: My appwidget broken Donut when keyboard slide out/in
I'm seeing the same issue. I've even tried commenting out all of the onUpdate code and the widget still crashes aCore. This problem only seems to occur with 1.6. Any ideas? Anyone else having the same issue? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] launch calendar app with generic intent
There's seemingly no way to launch the calendar app in a generic way. I've written a widget which allows you to launch the calendar. I use the following Intent: Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClassName(com.android.calendar, com.android.calendar.LaunchActivity); startActivity(i); However, this doesn't work on the Hero because HTC has apparently replaced the calendar in their Sense UI. I'm looking for a standard way to reach the calendar. I'd like for something like this to be standardized: Intent i = new Intent(Intent.ACTION_VIEW); i.setType(text/calendar); startActivity(i); Does anyone think it would be worth trying to add this to the source? It seems like there is a missing chunk of standards around calendar events and/or iCal / vCal support. Does anyone know why? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: WM-DRM Support
PacketVideo has all of the answers. They contributed heavily to the development of the OpenCore and I think they could sell you some WM- DRM if you have a commercial product. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Create/Send Email using Draft/Template
Intent i = new Intent(Intent.ACTION_SEND); i.putExtra(Intent.EXTRA_EMAIL, new String[]{webmas...@website.com}); i.putExtra(Intent.EXTRA_SUBJECT, mySubject); i.putExtra(Intent.EXTRA_TEXT, myBodyText); startActivity(i); have fun. On Sep 3, 9:16 pm, rooster 808 rich.al...@gmail.com wrote: I've been trying to do the following: A user is viewing content/page on my View/Activity, and I have an email button, they select email and popup a prefilled in email/ subject asking for the to: addressor some way to launch teh default email client with a pre-composed email awaiting the sender to be filled in. . . .ala, check out this link/content' Possible? I can see how to do a mailto:// link, but trying to leverage the built-in contacts and email app, but to compose and stuff the email contents with contents. Thanks, Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: how to re-draw the listview ?
Look at the notifyDataSetChanged() and notifyDataSetInvalidated() methods on your adapter. I'm not sure if this is the most elegant way to get the job done, but they will cause the list to dump any cached views and redraw 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] Any way to use getChildDrawingOrder? where do we set FLAG_USE_CHILD_DRAWING_ORDER?
I'm writing a custom widget in which I need to control the child drawing order. My control extends AbsoluteLayout. I can see that getChildDrawingOrder is overrideable. The following note is in the javadocs for this method: NOTE: In order for this method to be called, the FLAG_USE_CHILD_DRAWING_ORDER must be set. However, I can find no setter to allow me to set this flag. There are setters for similar flags such as the add states for children, but seemingly nothing for the child drawing order. GalleryView uses this flag, but it does so by accessing mGroupFlags which is a protected and hidden property of ViewGroup. What am I missing? Shouldn't this flag be exposed in some way to allow widget developers to utilize it? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Extending AdapterView - getting only 1 level of children
Diane, et. al. I've looked at this extensively without resolution. The widget that is most similar to what I'm trying to create is the Gallery. In the Gallery, there is a private setUpChild method. This method has the following (stuff omitted for brevity): Gallery.LayoutParams lp = (Gallery.LayoutParams) child.getLayoutParams (); addViewInLayout(child, fromLeft ? -1 : 0, lp); child.measure(childWidthSpec, childHeightSpec); child.layout(childLeft, childTop, childRight, childBottom); The gallery calls setUpChild from it's onLayout override. So I understand the basic process to be 1. addViewInLayout, 2. measure it 3. layout the child. However, when I follow these steps in my extension of AdapterView, I get no visible sub children. If you notice my magicitem.xml the children expand to an ImageView nested inside a FrameLayout. I can see the frame , but not the image. I know the ImageView is inflated because an eclipse breakpoint and watch reveals the ImageView as a child of the FrameLayout. All of the properties of the ImageView seem to be set appropriately. I've tried to create extensions up and down the hierarchy, extending ViewGroup, AdapterView, and even Gallery. All tests have the same result. Children do not show their child view collections. I'm sure there's a simple step I'm missing or something is out of order. Does anyone have any idea what I'm missing here? Has anyone else tried an extension of ViewGroup or more specifically AdapterView? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 add transparent button to screen
Try using an image drawable or ninepatch drawable PNG with some alpha in it. This is an example that's already in the framework. Set this as the background of a FrameLayout: @android:drawable/gallery_thumb On Feb 22, 12:08 am, cindy ypu01...@yahoo.com wrote: Hi all, When I use android's camera, the buttons are transparent. Does anyone knows how to do that? A lot of 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] Extending AdapterView - getting only 1 level of children
I'm creating a custom widget that extends AdapterView. Imagine something like a ListView except that the list items can overlap each other with some transparency. Because of the overlap, I'm trying to control the layout and drawing order of the children. My issue is that the control renders it's children, but ONLY one level deep. Each child is inflated from an XML resource that contains a FrameLayout and an ImageView. The FrameLayout draws, but the ImageView is never visible. I assume I need to call some method to tell the FrameLayout to layout or draw it's children, but I'm not sure what, why, or where. Does anyone know what I'm missing? Here is the relevant code for my custom widget: public class MagicList extends AdapterViewAdapter { // blah stuff omitted... @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { this.removeAllViewsInLayout(); // fetch only the visible views for(int i = 0; i vcount; i++) { layeredviews[i] = allviews[vfirst+i]; } // sort them in drawing order Arrays.sort(layeredviews, new ViewComparator()); // add them back as children in the right order for(int i = 0; i vcount; i++) { this.addViewInLayout(layeredviews[i], i, this.generateDefaultLayoutParams()); } } @Override public void setAdapter(Adapter value) { adapter = value; allviews = new View[adapter.getCount()]; } // more blah omitted } Here is relevant stuff from the adapter used to inflate the list items: public class MagicAdapter extends BaseAdapter { // blah adapter stuff omitted. public View getView(int position, View convertView, ViewGroup parent) { View v = inflater.inflate(R.layout.magicitem, null); return v; } } Here is the magicitem XML that is inflated as the child views that the MagicList is handling. Note that I NEVER see the image view. I only see the drawable background for the FrameLayout. ?xml version=1.0 encoding=UTF-8? FrameLayout xmlns:android=http://schemas.android.com/apk/res/ android android:layout_width=wrap_content android:layout_height=wrap_content android:background=@drawable/tab ImageView android:layout_width=wrap_content android:layout_height=wrap_content android:src=@drawable/icon / /FrameLayout --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Broken Gallery View? using Gallery.setSelection(int position, boolean animate)
I'm trying to set the selection of a Gallery in code. I would like to have the Gallery smoothly roll down a few items over the duration of a second or two. At frist glance, it appears that two members would to the trick: Gallery.setAnimationDuration(int animationDurationMillis); Gallery.setSelection(int position, boolean animate); It turns out that the setAnimationDuration only seems to affect the rubber-bandy return-to-center effect of the Gallery. In other words, when a gallery comes to rest after a fling, and a gallery item is off center, the animationDurationMillis is used to control the duration of the Gallery centering up the item. However, the value seems to have no effect on the setSelection. No matter what value is set with setAnimationDuration, the Gallery seems to render about 2 or 3 frames when flying between items 1 and 10 for example. Is this working as designed? Does anyone know a trick or workaround that would let me properly animate setSelection? I'd be especially grateful if we could do it with an Ease Out effect. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Scale a View's Frame
Hey Ryan. I saw you never got an answer to this. Hopefully this helps: I'm scaling a view by overriding onDraw. Inside the onDraw method of my view I'm calling layout(l1, t1, r1, b1). The l,t,r, and b values are external to the view so as they change, the view changes size. The effect looks the same as an animation. On Jan 6, 4:23 am, Ryan ryankelly...@hotmail.com wrote: Hi, I'm looking for a way to scale a view's frame. E.G. I would like to apply the same effect to a view as running a scale animation. However, without having to run the animation. I have discovered how to scale the view's canvas. But this doesn't seem to increase the views frame size, like a scale animation does. Maybe I'm missing something obvious? Many thanks, Ryan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: RunningTaskInfo.thumbnail is always null and onCreateThumbnail never called
Hey Dianne, Thanks for your reply! I need this functionality and I've built something similar into the internals. However, something tells me that you guys did a much better job. :) I can see that most of your work is still there, but I can't seem to follow it completely. Can you tell me where to turn it back on and/or move this thread to the internals discussion? On Jan 21, 1:46 pm, Dianne Hackborn hack...@android.com wrote: This is not currently supported. We weren't using it anywhere in the UI on the G1, so we turned it off to avoid wasting time/space. On Wed, Jan 21, 2009 at 6:46 AM, drasticp drast...@gmail.com wrote: I'd like to get some thumbnail images of the running applications. The combination of RunningTaskInfo.thumbnail and Activity.onCreateThumbnail seems like just the thing but I don't see it working. I've overridden onCreateThumbnail in my main Activity. According to the documentation, this method is called by the framework when the activity is paused. I've set a breakpoint in the method and it never seems to be hit. The base implementation of onCreateThumbnail would work just fine if it would fire. @Override public boolean onCreateThumbnail(Bitmap outBitmap, Canvas canvas) { return super.onCreateThumbnail(outBitmap, canvas); } Also, I've written some simple code to getRunningTasks from the ActivityManager. The RunningTaskInfo.thumbnail property is always null. Is there something I need to set within an application so that it will generate it's thumbnail before onPause? Is something needed in the manifest. The documentation on this feature is sparse. Here's some [simplified] code I use in an extension of BaseAdapter to fetch the running tasks: ActivityManager manager = (ActivityManager)context.getSystemService (Context.ACTIVITY_SERVICE); ListRunningTaskInfo tasks = manager.getRunningTasks(10); RunningTaskInfo info = tasks.get(arg0); LayoutInflater inflater = (LayoutInflater)context.getSystemService (Context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.taskitem, null); ImageView image = (ImageView)view.findViewById(R.id.image); TextView label = (TextView)view.findViewById(R.id.label); label.setText(info.baseActivity.getPackageName()); Bitmap bmp = info.thumbnail; image.setImageBitmap(bmp); -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] RunningTaskInfo.thumbnail is always null and onCreateThumbnail never called
I'd like to get some thumbnail images of the running applications. The combination of RunningTaskInfo.thumbnail and Activity.onCreateThumbnail seems like just the thing but I don't see it working. I've overridden onCreateThumbnail in my main Activity. According to the documentation, this method is called by the framework when the activity is paused. I've set a breakpoint in the method and it never seems to be hit. The base implementation of onCreateThumbnail would work just fine if it would fire. @Override public boolean onCreateThumbnail(Bitmap outBitmap, Canvas canvas) { return super.onCreateThumbnail(outBitmap, canvas); } Also, I've written some simple code to getRunningTasks from the ActivityManager. The RunningTaskInfo.thumbnail property is always null. Is there something I need to set within an application so that it will generate it's thumbnail before onPause? Is something needed in the manifest. The documentation on this feature is sparse. Here's some [simplified] code I use in an extension of BaseAdapter to fetch the running tasks: ActivityManager manager = (ActivityManager)context.getSystemService (Context.ACTIVITY_SERVICE); ListRunningTaskInfo tasks = manager.getRunningTasks(10); RunningTaskInfo info = tasks.get(arg0); LayoutInflater inflater = (LayoutInflater)context.getSystemService (Context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(R.layout.taskitem, null); ImageView image = (ImageView)view.findViewById(R.id.image); TextView label = (TextView)view.findViewById(R.id.label); label.setText(info.baseActivity.getPackageName()); Bitmap bmp = info.thumbnail; image.setImageBitmap(bmp); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---