[android-developers] How to control ViewFlipper in honeycomb app widget?
I am coding an app widget for Honeycomb. I am attempting to use a ViewFlipper, which Honeycomb docs say is supported in app widgets now. I would expect to be able to use one of the following APIs for this ViewFlipper: RemoteViews.showNext(int viewId) or RemoteViews.setInt(int viewId, String methodName, int value) How am I supposed to control when the view flipper flips?? It's unacceptable to me to have it automatically flipping, like for a slide show. Here are the exceptions for reference: W/AppWidgetHostView( 450): android.widget.RemoteViews $ActionException: view: android.widget.ViewFlipper can't use method with RemoteViews: showNext() W/AppWidgetHostView( 450): at android.widget.RemoteViews $ReflectionActionWithoutParams.apply(RemoteViews.java:556) W/AppWidgetHostView( 450): at android.widget.RemoteViews.performApply(RemoteViews.java:1515) W/AppWidgetHostView( 450): at android.widget.RemoteViews.apply(RemoteViews.java:1492) W/AppWidgetHostView( 450): at android.appwidget.AppWidgetHostView.updateAppWidget(AppWidgetHostView.java: 225) W/AppWidgetHostView( 450): at android.appwidget.AppWidgetHost.createView(AppWidgetHost.java:234) W/AppWidgetHostView( 450): at com.android.launcher2.Launcher.completeAddAppWidget(Launcher.java: 1233) W/AppWidgetHostView( 450): at com.android.launcher2.Launcher.addAppWidgetImpl(Launcher.java:1728) W/AppWidgetHostView( 450): at com.android.launcher2.Launcher.addAppWidgetFromDrop(Launcher.java: 1672) W/AppWidgetHostView( 450): at com.android.launcher2.Workspace.onDropExternal(Workspace.java:2754) W/AppWidgetHostView( 450): at com.android.launcher2.Workspace.onDrop(Workspace.java:2207) W/AppWidgetHostView( 450): at com.android.launcher2.DragController.drop(DragController.java:597) W/AppWidgetHostView( 450): at com.android.launcher2.DragController.onTouchEvent(DragController.java: 576) W/AppWidgetHostView( 450): at com.android.launcher2.DragLayer.onTouchEvent(DragLayer.java:64) W/AppWidgetHostView( 450): android.widget.RemoteViews $ActionException: view: android.widget.ViewFlipper can't use method with RemoteViews: setDisplayedChild(int) W/AppWidgetHostView( 450): at android.widget.RemoteViews $ReflectionAction.apply(RemoteViews.java:778) W/AppWidgetHostView( 450): at android.widget.RemoteViews.performApply(RemoteViews.java:1515) W/AppWidgetHostView( 450): at android.widget.RemoteViews.apply(RemoteViews.java:1492) W/AppWidgetHostView( 450): at android.appwidget.AppWidgetHostView.updateAppWidget(AppWidgetHostView.java: 225) W/AppWidgetHostView( 450): at android.appwidget.AppWidgetHost.updateAppWidgetView(AppWidgetHost.java: 266) W/AppWidgetHostView( 450): at android.appwidget.AppWidgetHost $UpdateHandler.handleMessage(AppWidgetHost.java:81) W/AppWidgetHostView( 450): at android.os.Handler.dispatchMessage(Handler.java:99) W/AppWidgetHostView( 450): at android.os.Looper.loop(Looper.java: 126) W/AppWidgetHostView( 450): at android.app.ActivityThread.main(ActivityThread.java:3997) W/AppWidgetHostView( 450): at java.lang.reflect.Method.invokeNative(Native Method) W/AppWidgetHostView( 450): at java.lang.reflect.Method.invoke(Method.java:491) Please note I opened issue 14956 to try to get Google's official help too. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] App widget animations possible with Gingerbread?
I got an email from my Google partner advocate contact stating that basic animations are already supported in app widgets in gingerbread. Can someone please give me a pointer to the attribute or method/API that I need to use to get this working? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: App widget animations possible with Gingerbread?
I am looking for a technical answer, with a pointer to an API. On Feb 17, 12:37 pm, TreKing treking...@gmail.com wrote: On Thu, Feb 17, 2011 at 11:42 AM, Cheryl Sedota cherylsed...@gmail.comwrote: I got an email from my Google partner advocate contact stating that basic animations are already supported in app widgets in gingerbread. What is a Google partner advocate contact, how did you get anyone at Google to email you, and who do I have to sleep with to get me one of those? Can someone please give me a pointer to the attribute or method/API that I need to use to get this working? In all seriousness, why didn't you ask your Google buddy this? - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] What layout objects are allowed in honeycomb app widgets?
Reading through the Honeycomb highlights doc here: http://developer.android.com/sdk/android-3.0-highlights.html It says: Android 3.0 lets developers take home screen widgets to the next level, offering more types of content and new modes of interaction with users. Developers can now use more standard UI widget types home screen widgets, including widgets that let users flip through collections of content as 3D stacks, grids, or lists. Users can interact with the home screen widgets in new ways, such as by using touch gestures to scroll and flip the content displayed in a widget. However, as a developer I am not clear on what this means exactly. In the honeycomb SDK docs, there are no new layout/viewgroup types that are called out as being 'newly allowed' in honeycomb app widgets, however by looking at the samples I saw that there is a StackView in one app widget. Can you please give us more details about which layout objects are allowed in honeycomb app widgets? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] onRestoreInstanceState exception only on froyo for a simple textview
I have an application with an activity group, and it uses the local activity manager class to start a subactivity and insert that subactivity's view. I do not have any custom onSaveInstanceState logic written anywhere in my app. I have a nested layout of relative layout - textview within that subactivity's view, and the text view's id is recent_apps_label. I get this exception every time I rotate the device to/from portrait/landscape orientation on froyo ONLY, never saw this on eclair. Please help - I have NO idea as to how the parcelable object getting sent to onRestoreInstanceState would be for a list view. I even changed the id to something even more unique and it didn't fix the problem. I have a different layout file for the containing layout in layout-land-mdpi, layout-port-mdpi, and layout-port-hdpi FYI. Here is the exception: E/AndroidRuntime( 1106): java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.widget.AbsListView$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/recent_apps_label. Make sure other views do not use the same id. E/AndroidRuntime( 1106):at android.view.View.onRestoreInstanceState(View.java:6162) E/AndroidRuntime( 1106):at android.widget.TextView.onRestoreInstanceState(TextView.java:2422) E/AndroidRuntime( 1106):at android.view.View.dispatchRestoreInstanceState(View.java:6138) E/AndroidRuntime( 1106):at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106):at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106):at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106):at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106):at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106):at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106):at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106):at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106):at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106):at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106):at android.view.View.restoreHierarchyState(View.java:6117) E/AndroidRuntime( 1106):at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java: 1530) E/AndroidRuntime( 1106):at android.app.Activity.onRestoreInstanceState(Activity.java:843) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: onRestoreInstanceState exception only on froyo for a simple textview
I subclasses TextView for this one control and logged calls to onSaveInstanceState and onRestoreInstanceState - I never return an AbsListView.SavedState in onSaveInstanceState but I am seeing it get sent to my onRestoreInstanceState method: I/TestTextView( 1739): In onSaveInstanceState with android.view.abssavedstat...@400bae90 I/TestTextView( 1739): In onSaveInstanceState with android.view.abssavedstat...@400bae90 I/TestTextView( 1739): In onSaveInstanceState with android.view.abssavedstat...@400bae90 I/TestTextView( 1739): In onRestoreInstanceState with android.view.abssavedstat...@400bae90 I/TestTextView( 1739): In onSaveInstanceState with android.view.abssavedstat...@400bae90 I/TestTextView( 1739): In onRestoreInstanceState with AbsListView.SavedState{45128f10 selectedId=-9223372036854775808 firstId=1 viewTop=0 position=0 height=455 filter=null} On Aug 13, 10:15 am, Cheryl Sedota cherylsed...@gmail.com wrote: I have an application with an activity group, and it uses the local activity manager class to start a subactivity and insert that subactivity's view. I do not have any custom onSaveInstanceState logic written anywhere in my app. I have a nested layout of relative layout - textview within that subactivity's view, and the text view's id is recent_apps_label. I get this exception every time I rotate the device to/from portrait/landscape orientation on froyo ONLY, never saw this on eclair. Please help - I have NO idea as to how the parcelable object getting sent to onRestoreInstanceState would be for a list view. I even changed the id to something even more unique and it didn't fix the problem. I have a different layout file for the containing layout in layout-land-mdpi, layout-port-mdpi, and layout-port-hdpi FYI. Here is the exception: E/AndroidRuntime( 1106): java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.widget.AbsListView$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/recent_apps_label. Make sure other views do not use the same id. E/AndroidRuntime( 1106): at android.view.View.onRestoreInstanceState(View.java:6162) E/AndroidRuntime( 1106): at android.widget.TextView.onRestoreInstanceState(TextView.java:2422) E/AndroidRuntime( 1106): at android.view.View.dispatchRestoreInstanceState(View.java:6138) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.View.restoreHierarchyState(View.java:6117) E/AndroidRuntime( 1106): at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java: 1530) E/AndroidRuntime( 1106): at android.app.Activity.onRestoreInstanceState(Activity.java:843) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: onRestoreInstanceState exception only on froyo for a simple textview
It appears that there is a bug in android where subactivities' views are not kept isolated from each other (like AppWidgetHostView does). Android generates the same set of id's across applications and I found that another subactivity in the activity group has the same id assigned to it and it's a list view. I am going to suppress saving instance state for now, as a temporary fix but I understand that won't enable me to get the default state saving functionality built into android. Should I open a bug? On Aug 13, 10:28 am, Cheryl Sedota cherylsed...@gmail.com wrote: I subclasses TextView for this one control and logged calls to onSaveInstanceState and onRestoreInstanceState - I never return an AbsListView.SavedState in onSaveInstanceState but I am seeing it get sent to my onRestoreInstanceState method: I/TestTextView( 1739): In onSaveInstanceState with android.view.abssavedstat...@400bae90 I/TestTextView( 1739): In onSaveInstanceState with android.view.abssavedstat...@400bae90 I/TestTextView( 1739): In onSaveInstanceState with android.view.abssavedstat...@400bae90 I/TestTextView( 1739): In onRestoreInstanceState with android.view.abssavedstat...@400bae90 I/TestTextView( 1739): In onSaveInstanceState with android.view.abssavedstat...@400bae90 I/TestTextView( 1739): In onRestoreInstanceState with AbsListView.SavedState{45128f10 selectedId=-9223372036854775808 firstId=1 viewTop=0 position=0 height=455 filter=null} On Aug 13, 10:15 am, Cheryl Sedota cherylsed...@gmail.com wrote: I have an application with an activity group, and it uses the local activity manager class to start a subactivity and insert that subactivity's view. I do not have any custom onSaveInstanceState logic written anywhere in my app. I have a nested layout of relative layout - textview within that subactivity's view, and the text view's id is recent_apps_label. I get this exception every time I rotate the device to/from portrait/landscape orientation on froyo ONLY, never saw this on eclair. Please help - I have NO idea as to how the parcelable object getting sent to onRestoreInstanceState would be for a list view. I even changed the id to something even more unique and it didn't fix the problem. I have a different layout file for the containing layout in layout-land-mdpi, layout-port-mdpi, and layout-port-hdpi FYI. Here is the exception: E/AndroidRuntime( 1106): java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.widget.AbsListView$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/recent_apps_label. Make sure other views do not use the same id. E/AndroidRuntime( 1106): at android.view.View.onRestoreInstanceState(View.java:6162) E/AndroidRuntime( 1106): at android.widget.TextView.onRestoreInstanceState(TextView.java:2422) E/AndroidRuntime( 1106): at android.view.View.dispatchRestoreInstanceState(View.java:6138) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java: 1209) E/AndroidRuntime( 1106): at android.view.View.restoreHierarchyState(View.java:6117) E/AndroidRuntime( 1106): at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java: 1530) E/AndroidRuntime( 1106): at android.app.Activity.onRestoreInstanceState(Activity.java:843) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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 get notified when startActivity is called?
Is there any way for a 3rd party app to get notified when startActivity has been called (from any app or the framework)? My specific need is to keep track of the number of times activities have been launched from my 3rd party app... I just need to know when startActivity has been called to launch a new screen, and then I'd like to also read the FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY flag that is set when an app is launched from the recent apps dialog: From frameworks/policies/base/phone/com/android/internal/policy/impl/ RecentApplicationsDialog.java ... // prepare a launch intent and send it Intent intent = (Intent)b.getTag(); intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY); getContext().startActivity(intent); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Gmail app - part of system?
Is the gmail app part of the android system, in that it is not able to be updated without a system-wide update? Or is it possible for the gmail app to be periodically updated (thru market or some other mechanism?) without upgrading the platform itself? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] ADEProxy.exe and adb server out of date?
I have a process running called ADEProxy.exe - it runs automatically upon windows startup, and I think it is the core reason that I keep repeatedly getting the error: adb server is out of date. killing... Can someone tell me why this adb server is out of date. killing... error occurs, how I can stop it for good, and why I have a service/ process that starts up automatically when windows starts? It is so odd to me, because the SDK simply gets unzipped, not installed, so how would I get a service that automatically starts? I am afraid that the root issue is that I have more than one SDK installed (out of necessity - a custom device that I am developing for has a custom SDK) and there are conflicts somehow. I have tried rebooting my machine deleting my C:\Documents and Settings \User\.android folder, emptying my temp folder, etc, to no avail. Do I need to clear something in the registry? Thanks, Cheryl -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: ADEProxy.exe and adb server out of date?
I have a little more info now - this ADEProxy.exe process starts up when the device is first attached via USB data cable... I had the device attached at windows startup previously. Anyone know where I can go to disable this? On Mar 18, 10:08 am, Cheryl Sedota cherylsed...@gmail.com wrote: I have a process running called ADEProxy.exe - it runs automatically upon windows startup, and I think it is the core reason that I keep repeatedly getting the error: adb server is out of date. killing... Can someone tell me why this adb server is out of date. killing... error occurs, how I can stop it for good, and why I have a service/ process that starts up automatically when windows starts? It is so odd to me, because the SDK simply gets unzipped, not installed, so how would I get a service that automatically starts? I am afraid that the root issue is that I have more than one SDK installed (out of necessity - a custom device that I am developing for has a custom SDK) and there are conflicts somehow. I have tried rebooting my machine deleting my C:\Documents and Settings \User\.android folder, emptying my temp folder, etc, to no avail. Do I need to clear something in the registry? Thanks, Cheryl -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Android's support for multiple screens
My team has developed a suite of applications for a specific device/ screen - it's a medium density, large sized screen according to the parameters defined here: http://developer.android.com/guide/practices/screens_support.html#qualifiers I would like to know if it's possible to leverage android 1.6's multiple screen support infrastructure to get these applications to automatically scale the drawable images down such that they display properly (even if they are too small to interact with) on a medium density, normal sized screen (like the G1). As far as I can tell there is no way to get Android to do this automatically for me, because both devices are considered mdpi and drawables are typically divided up into alternate resource folders by density. I tried the following definition in my Android manifest but it did not work: supports-screens anyDensity=false largeScreens=true smallScreens=false normalScreens=false / Please advise. Thanks!! Cheryl -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How can my view access mScrollX and mScrollY in computeScroll method?
I tried that too, It doesn't work properly. For the same reason that HorizontalScrollView can't call scrollTo/scrollBy in its computeScroll method. On Dec 8, 10:59 pm, Romain Guy romain...@android.com wrote: Use scrollTo()/scrollBy() :) On Tue, Dec 8, 2009 at 7:40 PM, Cheryl Sedota cherylsed...@gmail.com wrote: I should have been more clear - in computeScroll, it's typical to need to set the scroll x and scroll y. I don't know of any way to do that - any suggestions? The root issue I am having here is that the duration of the scroll is too small and scrolls are too fast. I need to set a shorter duration for the mScroller.startScroll call and I also would like to set a custom interpolator on the mScroller object. However, I don't have any access to the mScroller object within a HorizontalScrollView (it's private) so my only option is to implement a class that is similar to HorizontalScrollView, and that is where I run into the issues where my computeScroll method needs to set mScrollX and mScrollY so that the super-super-superclass, View, will render and draw my horizontal scroll view properly. On Dec 8, 12:18 pm, Romain Guy romain...@android.com wrote: Hi, You can just use getScrollX() and getScrollY(). On Tue, Dec 8, 2009 at 10:07 AM, Cheryl Sedota cherylsed...@gmail.com wrote: The View class has a computeScroll method whose documentation states: Called by a parent to request that a child update its values for mScrollX and mScrollY if necessary. This will typically be done if the child is animating a scroll using a Scroller object. Seehttp://developer.android.com/reference/android/view/View.html#compute... I am using the 1.5 SDK and I do not have access from within my application to the mScrollX and mScrollY protected member variables of the View class. However, I MUST have a custom scroller object for my view. Please advise. Thanks, Cheryl -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How can my view access mScrollX and mScrollY in computeScroll method?
The View class has a computeScroll method whose documentation states: Called by a parent to request that a child update its values for mScrollX and mScrollY if necessary. This will typically be done if the child is animating a scroll using a Scroller object. See http://developer.android.com/reference/android/view/View.html#computeScroll%28%29 I am using the 1.5 SDK and I do not have access from within my application to the mScrollX and mScrollY protected member variables of the View class. However, I MUST have a custom scroller object for my view. Please advise. Thanks, Cheryl -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How can my view access mScrollX and mScrollY in computeScroll method?
I should have been more clear - in computeScroll, it's typical to need to set the scroll x and scroll y. I don't know of any way to do that - any suggestions? The root issue I am having here is that the duration of the scroll is too small and scrolls are too fast. I need to set a shorter duration for the mScroller.startScroll call and I also would like to set a custom interpolator on the mScroller object. However, I don't have any access to the mScroller object within a HorizontalScrollView (it's private) so my only option is to implement a class that is similar to HorizontalScrollView, and that is where I run into the issues where my computeScroll method needs to set mScrollX and mScrollY so that the super-super-superclass, View, will render and draw my horizontal scroll view properly. On Dec 8, 12:18 pm, Romain Guy romain...@android.com wrote: Hi, You can just use getScrollX() and getScrollY(). On Tue, Dec 8, 2009 at 10:07 AM, Cheryl Sedota cherylsed...@gmail.com wrote: The View class has a computeScroll method whose documentation states: Called by a parent to request that a child update its values for mScrollX and mScrollY if necessary. This will typically be done if the child is animating a scroll using a Scroller object. Seehttp://developer.android.com/reference/android/view/View.html#compute... I am using the 1.5 SDK and I do not have access from within my application to the mScrollX and mScrollY protected member variables of the View class. However, I MUST have a custom scroller object for my view. Please advise. Thanks, Cheryl -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How can an activity detect that its application is about to run out of memory?
How can an activity detect that its application/process is about to run out of memory? The 'onLowMemory' API only seems to get called when the system is running low on memory but I'd like to be able to determine when my activity itself needs to tighten its belt to avoid an OutOfMemoryError because the application heap has exceeded the 16MB limit. Thanks!! Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Drawable doesn't load sometimes
Romain, What is the bug number for this? Was it fixed in the 1.0 r2 SDK? - Cheryl On Nov 12, 7:25 am, blindfold seeingwithso...@gmail.com wrote: Interesting. In case this Android bug/feature not only applies to input streams, this might also explain why I no longer had memory related crashes on the G1 after recently switching to using BitmapFactory.decodeResource(getResources() instead of getResources ().getDrawable() to retrieve background images from my resources. Regards On Nov 12, 5:30 am, Romain Guy romain...@google.com wrote: This is a known bug. Here is a workaround: in = new BufferedInputStream(new URL(getUrl(size)).openStream(), IO_BUFFER_SIZE); final ByteArrayOutputStream dataStream = new ByteArrayOutputStream(); out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE); copy(in, out); out.flush(); final byte[] data = dataStream.toByteArray(); bitmap = BitmapFactory.decodeByteArray(data, 0, data.length); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email 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: Drawable doesn't load sometimes
Romain, Can you please give details on the exact problem with the current 1.0 SDK? Should we avoid Drawables completely in favor of setting resource id's or bitmap objects? Or is the problem specific to a use case like loading remote images (via URL)? Based on the comment above that BitmapFactory.decodeResource(getResources()...) behaves better than getResources().getDrawable() I am assuming local images are problematic as well? Thanks!! Cheryl On Dec 15, 4:46 pm, Romain Guy romain...@google.com wrote: It wasn't fixed in 1.0r2. We cannot put fixes in the SDK if they are not available on the phones. Also, the bug is internal, it's not on the external tracker. On Mon, Dec 15, 2008 at 11:30 PM, Cheryl Sedota cherylsed...@gmail.com wrote: Romain, What is the bug number for this? Was it fixed in the 1.0 r2 SDK? - Cheryl On Nov 12, 7:25 am, blindfold seeingwithso...@gmail.com wrote: Interesting. In case this Android bug/feature not only applies to input streams, this might also explain why I no longer had memory related crashes on the G1 after recently switching to using BitmapFactory.decodeResource(getResources() instead of getResources ().getDrawable() to retrieve background images from my resources. Regards On Nov 12, 5:30 am, Romain Guy romain...@google.com wrote: This is a known bug. Here is a workaround: in = new BufferedInputStream(new URL(getUrl(size)).openStream(), IO_BUFFER_SIZE); final ByteArrayOutputStream dataStream = new ByteArrayOutputStream(); out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE); copy(in, out); out.flush(); final byte[] data = dataStream.toByteArray(); bitmap = BitmapFactory.decodeByteArray(data, 0, data.length); -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Is there a way to tell the emulator to kill an activity?
Is there a way to tell the emulator to kill an activity (not the entire process / just the activity)? An adb or ddms command perhaps? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How to set the 'singleActivityMode' flag for an activity group's constructor?
How can I set the 'singleActivityMode' flag for an activity group's constructor? http://code.google.com/android/reference/android/app/ActivityGroup.html#ActivityGroup(boolean) The problem I am encountering is that although my activity group's onResume/onPause methods are getting called, the onResume/onPause methods of each of the activities started by the activity group's local activity manager are not getting called. I looked at the source code for LocalActivityManager's dispatchPause() and dispatchResume() APIs and I see that when this 'singleActivityMode' flag is 'true' (which is the default), the underlying activities' onPause/ onResume lifecycle events don't get called. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to set the 'singleActivityMode' flag for an activity group's constructor?
Is there any XML attribute I can set in the android manifest when declaring the activity group by any chance? :) On Nov 21, 4:22 pm, Dianne Hackborn [EMAIL PROTECTED] wrote: This can't be changed dynamically after the ActivityGroup/LocalActivityManager is created. On Fri, Nov 21, 2008 at 2:17 PM, Cheryl Sedota [EMAIL PROTECTED]wrote: How can I set the 'singleActivityMode' flag for an activity group's constructor? http://code.google.com/android/reference/android/app/ActivityGroup.ht...)http://code.google.com/android/reference/android/app/ActivityGroup.ht... The problem I am encountering is that although my activity group's onResume/onPause methods are getting called, the onResume/onPause methods of each of the activities started by the activity group's local activity manager are not getting called. I looked at the source code for LocalActivityManager's dispatchPause() and dispatchResume() APIs and I see that when this 'singleActivityMode' flag is 'true' (which is the default), the underlying activities' onPause/ onResume lifecycle events don't get called. -- Dianne Hackborn Android framework engineer [EMAIL PROTECTED] 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Problem with Service Permission
We solved the issue by getting the application context and calling startService/bindService on that context rather than the activity's context (which is within an activity group - which is why it didn't work for some reason). On Nov 13, 3:46 pm, Raktim Das [EMAIL PROTECTED] wrote: Hi, I am coming back to you on a related issue. Now the situation is like this: I have application App1 which hosts the service and also has the client Activity. Plus I have App2 which has an ActivityGroup. I launch App1 client Activity from this App2 ActivityGroup. The client Activity code is like this - Intent intent = new Intent(com.abc.xyz.service.BackgroundService, null, this, com.abc.xyz.service.BackgroundService.class); startService(intent); result = bindService(intent, mConnection, Context.BIND_AUTO_CREATE); and the service element in the manifest like this - service android:name=.service.BackgroundService android:permission=com.abc.permission.ACCESS_BACKGROUND_SERVICE android:process=:remote android:exported=true intent-filter action android:name=com.abc.xyz.service.BackgroundService / /intent-filter /service The uses-permission tag remains in the client manifest file, which is the service manifest file too (since they are in the same app). I have put the same uses-permission tag in the manifest file of App2 as well - uses-permission android:name=com.abc.permission.ACCESS_BACKGROUND_SERVICE / When I launch App1 client Activity directly, it runs fine. Service gets initiated and bound to. But when I launch App1 client Activity via App2 ActivityGroup, I get these logs - - WARN/ActivityManager(51): Binding with unknown activity: [EMAIL PROTECTED] - INFO/ActivityManager(51): Start proc com.abc.xyz:remote for service com.abc.xyz/.service.BackgroundService: pid=417 uid=10015 gids={3003} and the value of 'result' is 'false'. I am loading App1 first, then App2 into the emulator. On Nov 11, 10:25 pm, Raktim Das [EMAIL PROTECTED] wrote: Thanks a ton. It worked! On Nov 11, 3:42 pm, hackbod [EMAIL PROTECTED] wrote: Be sure you install the .apk providing the permission before the one using it. You can see what permissions your app has been granted by digging through the output of adb shell dumpsys package. Also PLEASE DO NOT use the name android.permission. The namespaces android.* and com.android.* are reserved for the android platforms, and applications MUST NOT USE THEM. On Nov 11, 11:43 am, Raktim Das [EMAIL PROTECTED] wrote: Thanks a lot for analyzing the problem. First, my comment on your second point - This I had already been doing - as in the client application's manifest, the service application's manifest too has this entry under the manifest tag: uses-permission android:name=android.permission.ACCESS_BACKGROUND_SERVICE / Now coming to the first point, I changed the client code line from - Intent intent = new Intent(this, com.abc.xyz.service.BackgroundService.class); to Intent intent = new Intent(com.abc.xyz.service.BackgroundService); After the change, it seems the service is identified and the earlier warning message - Unable to start service Intent{ comp={com.abc.xyz.client/ com.abc.xyz.service.BackgroundService} }:not found is not coming. But then the permission related SecurityException is coming at the client statement startService(intent) as below: - WARN/PackageManager(57): Not granting permission android.permission.ACCESS_BACKGROUND_SERVICE to package com.abc.xyz.client (protectionLevel=3 flags=0x44) - ERROR/AndroidRuntime(): ERROR: thread attach failed - WARN/ActivityManager(57): Permission Denial: Accessing service ComponentInfo{com.abc.xyz/com.abc.xyz.service.BackgroundService} from pid=57, uid=1000 requires android.permission.ACCESS_BACKGROUND_SERVICE - ERROR/AndroidRuntime(1120): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.abc.xyz.client/ com.abc.xyz.client.ClientActivity}: java.lang.SecurityException: Not allowed to start service Intent { action=com.abc.xyz.service.BackgroundService } without permission android.permission.ACCESS_BACKGROUND_SERVICE I think I am missing something with the declaration of permission in the manifest(s). What is your opinion? Thanks, Raktim. On Nov 11, 4:48 am, hackbod [EMAIL PROTECTED] wrote: The Intent you are making to bind to the service is trying to find a component in your own .apk, not the other. The last permission error you mention is because you need to explicitly request to use even your own permissions. On Nov 10, 9:31 pm, Raktim Das [EMAIL PROTECTED] wrote: Hi, I am using 0.9 beta SDK. I want to have a service defined within one application to be invokable from another. The application hosting the service
[android-developers] Re: Tips for Orientation
FYI: I have a bug open against Android for not respecting the activity's request to handle orientation changes itself: http://code.google.com/p/android/issues/detail?id=969 On Oct 30, 7:01 am, Mark Hansen [EMAIL PROTECTED] wrote: You need to store whatever information determines the state of your application, use the following overrides: @Override public void onSaveInstanceState(Bundle savedInstanceState) { // example savedInstanceState.putString(someKey, someString); } then on the load: @Override public void onRestoreInstanceState(Bundle savedInstanceState) { // example String someString = savedInstanceState.getString(someKey); } A side note to this is there is some wackiness that goes on with the first install that I never really got an answer too, if you can figure it out let me know.. the post is here: http://groups.google.com/group/android-developers/browse_thread/threa... Good luck. On Oct 30, 6:56 am, Imran [EMAIL PROTECTED] wrote: Haii Al... The activity gets restarted when the mode changes form landscape to portrait or vice-versa is there any way to stop the activity getting restarted. help me out guys Thanks in advance for any Replays..!! Cheers Imran On Oct 25, 1:21 am, Peli [EMAIL PROTECTED] wrote: You could use yet another method: :-) Define a textview with id=R.id.text_portrait in yourportraitlayout, and in thelandscapelayout as R.id.text_landscape. Now, if findViewById(R.id.text_portrait) returns null, you know that currently thelandscapelayout is being displayed :-) But seriously, I'm surprised that there are so many ways to obtain the same information, and I have no idea which would be the preferred one... Peli On Oct 24, 10:00 pm, ksmith44 [EMAIL PROTECTED] wrote: Right. I have done that too, and it works great. The problem is that aside from using a different layout, my Activity actually needs to do slightly different logic bassed on the orientation, (it builds its options menu differently forlandscapethan forportrait), which means I need to be able to detect which orientation I am using. Currently, I am using the Configuration method mentioned above and it does seem to work. But with so many different classes, methods and constants available to get theoretically the exact same information, I wondered if there was a preferred method. On Oct 24, 12:39 pm, Mark Hansen [EMAIL PROTECTED] wrote: Setting this android:screenOrientation=sensor as mentioned above worked perfect.. it switched the view as the phone changed. I then only created alternate XML files for the layouts that needed tweaking and it worked like a charm. On Oct 24, 2:24 pm, ksmith44 [EMAIL PROTECTED] wrote: As a followup, I have now found at least 3 ways do determine the orientation, all of which use different constants with different values. * There is the aforementioned Activity.getRequestedOrientation which uses the ActivityInfo constants whereinlandscape=0 andportrait=1 * Then there is getResources().getConfiguration().orientation which uses the Configuration constants whereinlandscape=2 andportrait=1 * Then there is getWindow().getWindowManager().getDefaultDisplay().getOrientation(). I am not sure what constants this is using, but it returns exactly the opposite of the first:landscape=1 andportrait=0 There are probably more. Does anyone know the correct or preferred method? On Oct 23, 12:40 pm, ksmith44 [EMAIL PROTECTED] wrote: How can you determine the current orientation? Most of my pages rotate just fine, but I have one page on which I actually need to do slightly different logic based on the orientation (specifically, I want to add additional menu options inlandscape mode). When I use getRequestedOrientation(), I always get back a -1 (UNSPECIFIED). It appears as if this method only works if an orientation has been requested by the code using setRequestedOrientation. Is there a better way to determine the current orientation? BTW, thanks hackbod for the gem about ctrl-F12. I never found that in the documentation and had been changing the android:screenOrientation var in my manifest file and restarting every time I wanted to test in the alternate orientation.- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: INSTALL_FAILED_UPDATE_INCOMPATIBLE
I am getting this error on the G1 (so the advice to -wipe-data is not possible) and need help getting around it. Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE] Package com.frogdesign.test1 signatures do not match the previously installed version; ignoring Package couldn't be installed in /data/app/com.frogdesign.test1.apk I have a few apps with a 'shared user id' - I installed two apps that use the same shared user id and the two apps were built on different machines so I realize that is the source of the problem. However, I am stuck! I uninstalled (via adb uninstall package name) all of my apps and tried to re-install a new build (suite of apps) which was completely built on the same machine. It appears that the system is keeping around some old data (maybe in the cache?) for the apps that I uninstalled because I get that error when I try to install the fresh apps. If anyone can please help I would really appreciate it, it's completely blocking us from testing our apps on the G1. Thanks, Cheryl On Oct 6, 6:26 am, Mark Murphy [EMAIL PROTECTED] wrote: Christine wrote: However, now I can't install from Eclipse any more. Have to do a wipe again. Is it possible to have two different emulator instances, one for testing, one for development? I haven't tried this, but, quoting from the emulator documentation: To run multiple emulator instances and let each maintain user data across sessions, start the instances with the -data option (see Startup Options) and supply the path to a user-data file. http://code.google.com/android/reference/emulator.html -- Mark Murphy (a Commons Guy)http://commonsware.com Android Training on the Ranch! -- Mar 16-20, 2009http://www.bignerdranch.com/schedule.shtml --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Has anyone built IM.apk and ImProvider.apk?
Has anyone built IM.apk and ImProvider.apk? If so, can you please post those .apk files? They are not shipped with the 1.0 SDK and I don't have a mac or linux machine that I can use to build them myself now that the source code has been released. Thanks!!! Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How to suppress the window title/chrome completely at all times?
Despite the fact that I set the FEATURE_NO_TITLE param in my activity's onCreate method, there is a period of time while the activity is loading that I see the title/chrome on the 1.0 SDK (and all previous SDK versions too): //Hide the title bar requestWindowFeature(Window.FEATURE_NO_TITLE); Is there any way to ensure that we never see that title/chrome, not even for the first second or two of activity startup? Thanks, Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Draw children manually in custom ViewGroup
Romain, Now that the FLAG_SUPPORT_STATIC_TRANSFORMATIONS flag is gone in the 1.0 SDK, what do you recommend for such a scenario? Thanks, Cheryl On Aug 21, 10:30 am, Erik Calissendorff [EMAIL PROTECTED] wrote: Thanks, that was a much easier way to modify the views at drawing. Some tips which I learned as I tested this approach: You indicate that the ViewGroup supports static transformation with: this.mGroupFlags = this.mGroupFlags | FLAG_SUPPORT_STATIC_TRANSFORMATIONS; For the modified transformation to be performed you should return true from: boolean getChildStaticTransformation(View child, Transformation t) Kindest regards, //Erik On Aug 14, 5:12 pm, Romain Guy [EMAIL PROTECTED] wrote: You need to translate the canvas to the right position for each child and take into account the scroll offsets. I highly advise against overriding dispatchDraw() because it does a number of delicate things. The next version of the SDK will make ViewGroup.drawChild() protected so that you can override dispatchDraw() more safely. To move, scale and apply transparency to your Views at drawing time, it's a lot simpler than what you are doing. You can simply override the getChildStaticTransformation() method (I'm not sure of the exact name) and make sure your ViewGroup indicates it supports static transformations. Then simply return the appropriate Transformation that translates, scales and applies alpha. This is what Gallery does for instance. On Thu, Aug 14, 2008 at 5:15 AM, Erik Calissendorff [EMAIL PROTECTED] wrote: I'm trying to draw the children manually in my custom ViewGroup but the code below only displays the left top most child. I have tried not to clip the canvas and simply just call the child draw(Canvas c) method directly but that results in that all children are drawn on top of each other. What I like to accomplish is to be able to manually move,scale and modify the transparency of theViewat each draw call from the parent. I hope that someone can inform me how to make this work. Below is a my onLayout and dispatchDraw functions as they are now. [EMAIL PROTECTED] protected void onLayout(boolean changed, int l, int t, int r, int b) { for(int i=0;ithis.getChildCount();i++) { Viewchild = this.getChildAt(i); Rectrect=this.mCellPositions[i]; child.layout(rect.left,rect.top,rect.right,rect.bottom); } } [EMAIL PROTECTED] protected void dispatchDraw(Canvas canvas) { for(int i=0;ithis.getChildCount();i++) { Viewview= this.getChildAt(i); Rectcell=this.mCellPositions[i]; canvas.save(); if(canvas.clipRect(cell,Op.REPLACE)) { if(!canvas.quickReject(view.getLeft(),view.getTop(), view.getRight(),view.getBottom(), EdgeType.BW)) { view.draw(canvas); } } canvas.restore(); } } -- Romain Guywww.curious-creature.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Draw children manually in custom ViewGroup
Thanks, Romain. On Oct 13, 5:57 pm, Romain Guy [EMAIL PROTECTED] wrote: Note that this is a mistake from us. The flag (actually a setter method) will be back in the next version of Android. I already made sure of that. Without this flag, unfortunately, you need to override ViewGroup's drawChild()/onLayout() manually and apply the transformation yourself. On Mon, Oct 13, 2008 at 3:42 PM, Cheryl Sedota [EMAIL PROTECTED] wrote: Romain, Now that the FLAG_SUPPORT_STATIC_TRANSFORMATIONS flag is gone in the 1.0 SDK, what do you recommend for such a scenario? Thanks, Cheryl On Aug 21, 10:30 am, Erik Calissendorff [EMAIL PROTECTED] wrote: Thanks, that was a much easier way to modify the views at drawing. Some tips which I learned as I tested this approach: You indicate that the ViewGroup supports static transformation with: this.mGroupFlags = this.mGroupFlags | FLAG_SUPPORT_STATIC_TRANSFORMATIONS; For the modified transformation to be performed you should return true from: boolean getChildStaticTransformation(View child, Transformation t) Kindest regards, //Erik On Aug 14, 5:12 pm, Romain Guy [EMAIL PROTECTED] wrote: You need to translate the canvas to the right position for each child and take into account the scroll offsets. I highly advise against overriding dispatchDraw() because it does a number of delicate things. The next version of the SDK will make ViewGroup.drawChild() protected so that you can override dispatchDraw() more safely. To move, scale and apply transparency to your Views at drawing time, it's a lot simpler than what you are doing. You can simply override the getChildStaticTransformation() method (I'm not sure of the exact name) and make sure your ViewGroup indicates it supports static transformations. Then simply return the appropriate Transformation that translates, scales and applies alpha. This is what Gallery does for instance. On Thu, Aug 14, 2008 at 5:15 AM, Erik Calissendorff [EMAIL PROTECTED] wrote: I'm trying to draw the children manually in my custom ViewGroup but the code below only displays the left top most child. I have tried not to clip the canvas and simply just call the child draw(Canvas c) method directly but that results in that all children are drawn on top of each other. What I like to accomplish is to be able to manually move,scale and modify the transparency of theViewat each draw call from the parent. I hope that someone can inform me how to make this work. Below is a my onLayout and dispatchDraw functions as they are now. [EMAIL PROTECTED] protected void onLayout(boolean changed, int l, int t, int r, int b) { for(int i=0;ithis.getChildCount();i++) { Viewchild = this.getChildAt(i); Rectrect=this.mCellPositions[i]; child.layout(rect.left,rect.top,rect.right,rect.bottom); } } [EMAIL PROTECTED] protected void dispatchDraw(Canvas canvas) { for(int i=0;ithis.getChildCount();i++) { Viewview= this.getChildAt(i); Rectcell=this.mCellPositions[i]; canvas.save(); if(canvas.clipRect(cell,Op.REPLACE)) { if(!canvas.quickReject(view.getLeft(),view.getTop(), view.getRight(),view.getBottom(), EdgeType.BW)) { view.draw(canvas); } } canvas.restore(); } } -- Romain Guywww.curious-creature.org -- Romain Guywww.curious-creature.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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: qemu emulator flag not supported anymore in the 1.0 SDK?
Google, please tell us how to increase the amount of memory available for our emulator in the 1.0 SDK. On Sep 25, 12:56 am, Volker Gropp [EMAIL PROTECTED] wrote: Hi, same Problem here with the SDK1.0 emulator on Linux. Im really missing the qemu network settings to be able to use the SDK1.0. Volker Gropp On Sep 24, 5:38 pm, Cheryl Sedota [EMAIL PROTECTED] wrote: In the 1.0 SDK, trying to run: emulator.bat -qemu-m 256 on Windows XP does not work - I get this error: w: invalid option -- '-qemu' This used to work in the beta (0.9) SDK and the emulator's usage hint in the 1.0 SD indicates that the option is valid: -qemuargs... pass arguments toqemu -qemu-h displayqemuhelp Please advise. Thanks, Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: qemu emulator flag not supported anymore in the 1.0 SDK?
Note that a defect has been opened for this issue: http://code.google.com/p/android/issues/detail?id=906 On Sep 30, 8:59 am, Cheryl Sedota [EMAIL PROTECTED] wrote: Google, please tell us how to increase the amount of memory available for our emulator in the 1.0 SDK. On Sep 25, 12:56 am, Volker Gropp [EMAIL PROTECTED] wrote: Hi, same Problem here with the SDK1.0 emulator on Linux. Im really missing the qemu network settings to be able to use the SDK1.0. Volker Gropp On Sep 24, 5:38 pm, Cheryl Sedota [EMAIL PROTECTED] wrote: In the 1.0 SDK, trying to run: emulator.bat -qemu-m 256 on Windows XP does not work - I get this error: w: invalid option -- '-qemu' This used to work in the beta (0.9) SDK and the emulator's usage hint in the 1.0 SD indicates that the option is valid: -qemuargs... pass arguments toqemu -qemu-h displayqemuhelp Please advise. Thanks, Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] qemu emulator flag not supported anymore in the 1.0 SDK?
In the 1.0 SDK, trying to run: emulator.bat -qemu -m 256 on Windows XP does not work - I get this error: w: invalid option -- '-qemu' This used to work in the beta (0.9) SDK and the emulator's usage hint in the 1.0 SD indicates that the option is valid: -qemu args... pass arguments to qemu -qemu -hdisplay qemu help Please advise. Thanks, Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Beta support for resource sharing
Hi Dianne, I was able to get a separate Context object that corresponds to the common resources app using the createPackageContext API you referenced. Is there any easy way to reference a resource from another app in XML? For example, to reference a drawable from the current app, you would do something like this: ImageView android:src=@drawable/thumbnail_background ... / How can we easily reference a drawable from another app from an XML layout? Thanks, Cheryl On Sep 18, 3:08 pm, hackbod [EMAIL PROTECTED] wrote: On Sep 18, 10:22 am, joebowbeer [EMAIL PROTECTED] wrote: It may be safe to load resources in any process, but is it permitted? Can any app load resources from any other app, with or without a matching signature or sharedUserId? Yes: http://code.google.com/android/reference/android/content/Context.html...) Is it now possible, say, for one app apk to provide a Theme that other apps can then freely use? No, sorry. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Beta support for resource sharing
The beta SDK release notes found here http://code.google.com/android/RELEASENOTES.html state: Starting with this release, Android .apk files must be cryptographically signed, or the system will reject them upon installation. The purpose of this requirement is to securely and uniquely identify developers, so that the system can -- for example -- safely let multiple .apk files signed by the same developer share resources Can you please tell us what is meant by this statement? We are developing numerous applications and we'd like to put all of our shared resources (images, layouts, etc) into a common resources project and have all other apps load them from this common resources app. I created a common app and a leveraging app, and I built them both in the same environment (which should mean that they have the same signature according to Xavier's post here http://groups.google.com/group/android-developers/browse_thread/thread/f59f63e0bd7c9dc8/a081b08e871a9f0b ) with a common sharedUserId declared in the AndroidManifest.xml, but still the following code does not work, indicating that the leveraging app is not able to retrieve a resource from the common resource apk: int resourceId = myAppContext.getResources().getIdentifier(my_image, drawable, com.frogdesign.common.resources); What am I doing wrong? Is there another way to accomplish this? Please advise. Thanks!! Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Beta support for resource sharing
I am getting a return value of '0' which essentially means resource not found AFAIK. Note that I am passing the context for the leveraging app, but the package name declared in the AndroidManifest of the common app. Thanks! Cheryl On Sep 18, 11:18 am, hackbod [EMAIL PROTECTED] wrote: Could you please expand on does not work? Are there error messages in the log? What value are you getting back, or are you getting an except? Specifically for resources, the change to require signing has no impact, because it is safe to load and use resources in any process (the resources aren't code that can run in the process loading them). Also the ONLY thing that changed in all of this is that now, instead of using that bogus android:signature value in the manifest to determine if two .apks trust each other, we compare their certificates/ signatures. On Sep 18, 7:58 am, Cheryl Sedota [EMAIL PROTECTED] wrote: The beta SDK release notes found herehttp://code.google.com/android/RELEASENOTES.html state: Starting with this release, Android .apk files must be cryptographically signed, or the system will reject them upon installation. The purpose of this requirement is to securely and uniquely identify developers, so that the system can -- for example -- safely let multiple .apk files signed by the same developer share resources Can you please tell us what is meant by this statement? We are developing numerous applications and we'd like to put all of our shared resources (images, layouts, etc) into a common resources project and have all other apps load them from this common resources app. I created a common app and a leveraging app, and I built them both in the same environment (which should mean that they have the same signature according to Xavier's post herehttp://groups.google.com/group/android-developers/browse_thread/threa... ) with a common sharedUserId declared in the AndroidManifest.xml, but still the following code does not work, indicating that the leveraging app is not able to retrieve a resource from the common resource apk: int resourceId = myAppContext.getResources().getIdentifier(my_image, drawable, com.frogdesign.common.resources); What am I doing wrong? Is there another way to accomplish this? Please advise. Thanks!! Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Bitmap recycle/createBitmap freeing memory properly?
Hi, I am getting this exception in the beta SD which I never got on the m5 SDK - I have changed some logic so I am not 100% sure that it's not my code that is causing this, but would you mind checking whether or not Android properly frees all memory when Bitmap.recycle() is called and also when a bitmap is cropped using the Bitmap.createBitmap() API and later goes out of scope (i.e. can be garbage collected)? Here is the stack trace for my issue: D/dalvikvm( 414): GC freed 15290 objects / 1630400 bytes in 90ms E/dalvikvm-heap( 414): 194184-byte external allocation too large for this process. E/( 414): VM won't let us allocate 194184 bytes D/AndroidRuntime( 414): Shutting down VM W/dalvikvm( 414): threadid=3: thread exiting with uncaught exception (group=0x40010e28) E/AndroidRuntime( 414): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 414): java.lang.RuntimeException: can't alloc pixels E/AndroidRuntime( 414):at android.graphics.Bitmap.nativeCreate(Native Method) E/AndroidRuntime( 414):at android.graphics.Bitmap.createBitmap(Bitmap.java:343) E/AndroidRuntime( 414):at android.graphics.Bitmap.createBitmap(Bitmap.java:303) E/AndroidRuntime( 414):at android.graphics.Bitmap.createBitmap(Bitmap.java:253) E/AndroidRuntime( 414):at com.frogdesign.VideoHelper.cropBitmap(VideoHelper.java:580) Thanks so much, Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to re-use the photo picker activity in my application
Thanks Megha - it started working when I relaunched Android - I have no idea why it wasn't working before - I definitely had the SD card installed because I was selecting from images on the SD card in the photo picker. On Aug 29, 5:28 pm, Megha Joshi [EMAIL PROTECTED] wrote: Did you launch this with sdcard installed? Are there any Pictures in your Pictures app? If not, you should install sdcard, take pictures from the Camera app and then try app. I tried executing your code and onActivityResult() is being called. I tested it on Linux, but the OS shouldn't matter in this case. When your app launches the Pictures application, pick a picture and you should see the logcat output of Got the result... 2008/8/29 Cheryl Sedota [EMAIL PROTECTED] Hi, I have some code that attempts to invoke the photo picker activity for result. I can successfully launch the photo picker activity, but my activity does not receive a result at all (onActivityResult() is never called). Can anyone help? Thanks!!! - Cheryl [EMAIL PROTECTED] public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button = (Button) findViewById(R.id.pick_button); button.setOnClickListener(new View.OnClickListener() { [EMAIL PROTECTED] public void onClick(View view) { Log.i(TAG, Trying to start the photo picker activity); Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); // Intent photoPickerIntent = new // Intent(Intent.ACTION_GET_CONTENT); photoPickerIntent.setType(image/*); startActivityForResult(photoPickerIntent, 1); } }); } [EMAIL PROTECTED] protected void onActivityResult(int i, int j, Intent intent) { super.onActivityResult(i, j, intent); // TODO: figure out why this method never gets invoked Log.i(TAG, Got the result: + intent.getDataString()); } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: StackOverflowError when clearing and refocusing a ghosted text view
Oh! Thanks, Romain :) On Aug 28, 5:28 pm, Romain Guy [EMAIL PROTECTED] wrote: The ghost text you are talking about is called hint in TextView/EditText. On Thu, Aug 28, 2008 at 3:19 PM, Cheryl Sedota [EMAIL PROTECTED] wrote: I am getting a StackOverflowError when I try to clear a ghosted text view's focus - see below. I have gotten this error in the past when my UI layout hierarchy was very deep but in this case it's not extremely deep. Is there an alternate way I can clear focus from a field and update the ghost text of the newly focused view without incurring this large overhead? On a side note, do you plan on exposing the ghost text functionality that can be seen since m5 in the contact details screen? Thanks, Cheryl 08-28 15:25:34.502: WARN/dalvikvm(450): threadid=3: thread exiting with uncaught exception (group=0x40010e28) 08-28 15:25:34.512: ERROR/ AndroidRuntime(450): Uncaught handler: thread main exiting due to uncaught exception 08-28 15:25:34.562: ERROR/AndroidRuntime(450): java.lang.StackOverflowError08-28 15:25:34.562: ERROR/ AndroidRuntime(450): at java.lang.NullPointerException.init(NullPointerException.java:34) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.os.MessageQueue.removeMessages(MessageQueue.java:279) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.os.Handler.removeCallbacks(Handler.java:299) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView.makeBlink(TextView.java:4261) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView.access$800(TextView.java:149) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView $ChangeWatcher.spanChange(TextView.java:4202) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView $ChangeWatcher.onSpanAdded(TextView.java:4241) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.text.SpannableStringBuilder.sendSpanAdded(SpannableStringBuilder.java: 902) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java: 607) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java: 510) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.text.Selection.setSelection(Selection.java:76) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.text.Selection.setSelection(Selection.java:85) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.text.method.ArrowKeyMovementMethod.initialize(ArrowKeyMovementMethod.java: 228) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView.setText(TextView.java:2221) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView.setText(TextView.java:2117) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.EditText.setText(EditText.java:72) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView.setText(TextView.java:2093) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at com.frogdesign.common.ui.text.GhostedEditText $OnFocusChangeListener.onFocusChange(GhostedEditText.java:230) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.View.onFocusChanged(View.java:2302) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView.onFocusChanged(TextView.java:4323) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.View.handleFocusGainInternal(View.java:2144) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.View.requestFocus(View.java:3021) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.ScrollView.onRequestFocusInDescendants(ScrollView.java: 1064) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.requestFocus(ViewGroup.java:937) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:978) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.requestFocus(ViewGroup.java:934) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:978) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.requestFocus(ViewGroup.java:934) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:978) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.requestFocus(ViewGroup.java:934) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:978) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.requestFocus(ViewGroup.java:934) 08-28 15:25:34.562: ERROR
[android-developers] How to re-use the photo picker activity in my application
Hi, I have some code that attempts to invoke the photo picker activity for result. I can successfully launch the photo picker activity, but my activity does not receive a result at all (onActivityResult() is never called). Can anyone help? Thanks!!! - Cheryl @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button = (Button) findViewById(R.id.pick_button); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Log.i(TAG, Trying to start the photo picker activity); Intent photoPickerIntent = new Intent(Intent.ACTION_PICK); // Intent photoPickerIntent = new // Intent(Intent.ACTION_GET_CONTENT); photoPickerIntent.setType(image/*); startActivityForResult(photoPickerIntent, 1); } }); } @Override protected void onActivityResult(int i, int j, Intent intent) { super.onActivityResult(i, j, intent); // TODO: figure out why this method never gets invoked Log.i(TAG, Got the result: + intent.getDataString()); } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to push a .so file to /system/lib in version beta 0.9???
Even still, if I rebuild the system image the emulator will not successfully load that new system image. In my case I am swapping the default Droid font out for my own font and the emulator just loops through initialization code but never actually comes up with the modified beta system image. I had no problems on the m5 emulator. I am using mkfs.yaffs2. On Aug 20, 9:25 pm, Alan [EMAIL PROTECTED] wrote: Thank you all guys I finally realize how to do it Use adb remount command is all what I have to do I supposed that I have to re-create a writable system image._ The document doesn't mention the command option remount at all... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] StackOverflowError when clearing and refocusing a ghosted text view
I am getting a StackOverflowError when I try to clear a ghosted text view's focus - see below. I have gotten this error in the past when my UI layout hierarchy was very deep but in this case it's not extremely deep. Is there an alternate way I can clear focus from a field and update the ghost text of the newly focused view without incurring this large overhead? On a side note, do you plan on exposing the ghost text functionality that can be seen since m5 in the contact details screen? Thanks, Cheryl 08-28 15:25:34.502: WARN/dalvikvm(450): threadid=3: thread exiting with uncaught exception (group=0x40010e28) 08-28 15:25:34.512: ERROR/ AndroidRuntime(450): Uncaught handler: thread main exiting due to uncaught exception 08-28 15:25:34.562: ERROR/AndroidRuntime(450): java.lang.StackOverflowError08-28 15:25:34.562: ERROR/ AndroidRuntime(450): at java.lang.NullPointerException.init(NullPointerException.java:34) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.os.MessageQueue.removeMessages(MessageQueue.java:279) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.os.Handler.removeCallbacks(Handler.java:299) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView.makeBlink(TextView.java:4261) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView.access$800(TextView.java:149) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView $ChangeWatcher.spanChange(TextView.java:4202) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView $ChangeWatcher.onSpanAdded(TextView.java:4241) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.text.SpannableStringBuilder.sendSpanAdded(SpannableStringBuilder.java: 902) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java: 607) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java: 510) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.text.Selection.setSelection(Selection.java:76) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.text.Selection.setSelection(Selection.java:85) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.text.method.ArrowKeyMovementMethod.initialize(ArrowKeyMovementMethod.java: 228) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView.setText(TextView.java:2221) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView.setText(TextView.java:2117) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.EditText.setText(EditText.java:72) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView.setText(TextView.java:2093) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at com.frogdesign.common.ui.text.GhostedEditText $OnFocusChangeListener.onFocusChange(GhostedEditText.java:230) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.View.onFocusChanged(View.java:2302) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.TextView.onFocusChanged(TextView.java:4323) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.View.handleFocusGainInternal(View.java:2144) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.View.requestFocus(View.java:3021) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.widget.ScrollView.onRequestFocusInDescendants(ScrollView.java: 1064) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.requestFocus(ViewGroup.java:937) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:978) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.requestFocus(ViewGroup.java:934) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:978) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.requestFocus(ViewGroup.java:934) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:978) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.requestFocus(ViewGroup.java:934) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:978) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.requestFocus(ViewGroup.java:934) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:978) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.requestFocus(ViewGroup.java:934) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at android.view.ViewGroup.onRequestFocusInDescendants(ViewGroup.java:978) 08-28 15:25:34.562: ERROR/AndroidRuntime(450): at
[android-developers] 'adb wait-for-device' does not work in beta SDK
The 'wait-for-device' adb flag does not work in the beta SDK... I try executing this: adb wait-for-device shell am start -a android.intent.action.MAIN -n com.frogdesign.sampleapp/com.frogdesign.sampleapp.MyActivity ... and I get this: Error type 2 Error: Unable to connect to activity manager; is the system running? usage: am [start|broadcast|instrument] am start -D INTENT am broadcast INTENT am instrument [-r] [-e ARG_NAME ARG_VALUE] [-p PROF_FILE] [-w] COMPONENT INTENT is described with: [-a ACTION] [-d DATA_URI] [-t MIME_TYPE] [-c CATEGORY [-c CATEGORY] ...] [-e|--es EXTRA_KEY EXTRA_STRING_VALUE ...] [--ez EXTRA_KEY EXTRA_BOOLEAN_VALUE ...] [-e|--ei EXTRA_KEY EXTRA_INT_VALUE ...] [-n COMPONENT] [URI] and also this when i try to wait before installing an app: adb wait-for-device install .\MyApp.apk 1525 KB/s (0 bytes in 2071216.001s) Error Type 1: Could not access the Package Manager! usage: pm [list|path|install|uninstall] pm list packages [-f] pm list permission-groups pm list permissions [-g] [-f] [-d] [-u] [GROUP] pm path PACKAGE pm install [-l] [-r] PATH pm uninstall [-k] PACKAGE Please advise. I think this should work per the documentation here: http://code.google.com/android/reference/adb.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 [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: VideoView won't display video for some videos in the beta SDK
Thanks for helping to investigate, Megha. The URL is: http://feeds.feedburner.com/~r/IdolsOnEllen/~5/265429513/idolcast0407_dl.m4v On Aug 20, 7:05 pm, Megha Joshi [EMAIL PROTECTED] wrote: Please post your Video1 file.. On Wed, Aug 20, 2008 at 4:57 PM, Cheryl Sedota [EMAIL PROTECTED]wrote: The VideoView seems to be a bit broken in the new beta (v0.9) SDK: I have two videos that are of the same format/encoding. Video1 has 29 frames per second with dimensions 640x426. Video2 has 23 frames per second with dimensions 320x180. Video2 plays just fine using the VideoView (audio + video). Video1 only has audio playing and the VideoView is empty visually. I am running the emulator on Windows XP. Please advise. Thanks, Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] ActivityGroup error - app context getting mixed up?
I have an activity group in ApplicationA that started an Activity2 in ApplicationB, and everything worked perfectly in the m5 SDK. In the beta SDK, I get errors when the activity group in ApplicationA starts Activity2 and Activity2's view is being initialized - specifically when a TextView is being created. The problem seems to be that ApplicationA defines a color constant white in its colors.xml, and ApplicationB also defines a color white in its colors.xml, and Android is mixing the two application's contexts up - it's essentially sending ApplicationA's resource identifier for the color white along to a view being initialized in ApplicationB. Here is the exception we see: ERROR/AndroidRuntime(696): Caused by: android.content.res.Resources $NotFoundException: Resource is not a ColorStateList (color or path): TypedValue{t=0x1/d=0x7f040002 a=1 r=0x7f040002} ERROR/AndroidRuntime(696): at android.content.res.Resources.loadColorStateList(Resources.java:1506) 08-20 17:00:39.608: ERROR/AndroidRuntime(696): at android.content.res.TypedArray.getColorStateList(TypedArray.java:261) ERROR/AndroidRuntime(696): at android.widget.TextView.init(TextView.java:511) ERROR/AndroidRuntime(696): at android.widget.TextView.init(TextView.java:215) ERROR/AndroidRuntime(696): at android.widget.TextView.init(TextView.java:210) ERROR/AndroidRuntime(696): at com.frogdesign.common.ui.MyView.init(MyView.java:73) In ApplicationA's R.java file I see: public static final class color { public static final int black=0x7f040004; public static final int faded_white=0x7f040001; public static final int hyperlink_gray=0x7f040005; public static final int text_bottom_gray=0x7f040003; public static final int transparent=0x7f04; public static final int white=0x7f040002; } In ApplicationB's R.java file I see: public static final class color { public static final int black=0x7f050003; public static final int button_price=0x7f050009; public static final int dark_blue=0x7f05000a; public static final int faded_white=0x7f050001; public static final int hyperlink_gray=0x7f050004; public static final int light_gray=0x7f05000b; public static final int song_artist=0x7f050008; public static final int song_title=0x7f050007; public static final int text_black=0x7f050006; public static final int text_bottom_gray=0x7f050005; public static final int transparent=0x7f05; public static final int white=0x7f050002; } Is this a bug? I feel that it is, because ApplicationB's view should operate completely independently of ApplicationA, even if an ActivityGroup in ApplicationA is starting an activity in ApplicationB. I can think of several hacks to get around it but they are not reliable - this is a critical problem that is impacting our application from functioning properly on the beta SDK, we appreciate any info you can give as soon as you can. Thanks, Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: 'signature' attribute of Android Manifest no longer valid in beta SDK (v0.9)
You guys are exactly right - I used my own custom shared ID and made sure to build the .apks on the same machine (thus reusing the same C: \Documents and Settings\Cheryl.Sedota\Local Settings\Application Data \Android\debug.keystore signature) and it works perfectly. THANKS!! Cheryl On Aug 19, 8:38 pm, hackbod [EMAIL PROTECTED] wrote: The android:signature attribute was a temporary facility until .apk signing was implemented. Now that it is, the actual .apk signature is used (so this is actually secure). Thus, for two .apks to share the same android:sharedUserId, they must be signed with the same certificate. From Xav's comments, it sounds like you are signing your .apks with different certificates. On Aug 19, 3:43 pm, Cheryl Sedota [EMAIL PROTECTED] wrote: Hi, In the past Diane showed me how to use two attributes of the Android manifest in order to get ActivityGroups working properly (i.e. all the apps whose activities will be combined using the ActivityGroup will be accessible) - those attributes are 'sharedUserId' and 'signature'. http://groups.google.com/group/android-developers/browse_thread/threa... This is what I had working in the past: manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.frogdesign.desktop android:sharedUserId=android.uid.system android:signature=android.signature.system ... With the beta SDK that was just released, this mechanism is broken, as the 'signature' attribute is no longer valid. Please advise on how to implement ActivityGroups where Activities are in different apps with the new SDK. The docs still indicate that the signature is still required for userid match to occur:http://code.google.com/android/reference/android/R.styleable.html#And... ... and in the logs I see: From the console: [2008-08-19 17:26:52 - FrogDesktop] Installation error: INSTALL_FAILED_SHARED_USER_INCOMPATIBLE From logcat: DEBUG/PackageManager(56): Scanning package com.frogdesign.desktop DEBUG/PackageManager(56): Shared UserID android.uid.system (uid=1000): packages=[PackageSetting{433aa490 com.frogdesign.desktop/1000}, PackageSetting{43540b50 com.frogdesign.desktop/1000}, PackageSetting{434275a0 com.android.providers.settings/1000}, PackageSetting{434eeea0 android/1000}] ERROR/PackageManager(56): Package com.frogdesign.desktop has no signatures that match those in shared user android.uid.system; ignoring! WARN/PackageManager(56): Package couldn't be installed in /data/app/ com.frogdesign.desktop.apk Thanks!! Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] 'signature' attribute of Android Manifest no longer valid in beta SDK (v0.9)
Hi, In the past Diane showed me how to use two attributes of the Android manifest in order to get ActivityGroups working properly (i.e. all the apps whose activities will be combined using the ActivityGroup will be accessible) - those attributes are 'sharedUserId' and 'signature'. http://groups.google.com/group/android-developers/browse_thread/thread/4dec6c72fabf101/b61e179023762556?lnk=gstq=ActivityGroup This is what I had working in the past: manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.frogdesign.desktop android:sharedUserId=android.uid.system android:signature=android.signature.system ... With the beta SDK that was just released, this mechanism is broken, as the 'signature' attribute is no longer valid. Please advise on how to implement ActivityGroups where Activities are in different apps with the new SDK. The docs still indicate that the signature is still required for userid match to occur: http://code.google.com/android/reference/android/R.styleable.html#AndroidManifest ... and in the logs I see: From the console: [2008-08-19 17:26:52 - FrogDesktop] Installation error: INSTALL_FAILED_SHARED_USER_INCOMPATIBLE From logcat: DEBUG/PackageManager(56): Scanning package com.frogdesign.desktop DEBUG/PackageManager(56): Shared UserID android.uid.system (uid=1000): packages=[PackageSetting{433aa490 com.frogdesign.desktop/1000}, PackageSetting{43540b50 com.frogdesign.desktop/1000}, PackageSetting{434275a0 com.android.providers.settings/1000}, PackageSetting{434eeea0 android/1000}] ERROR/PackageManager(56): Package com.frogdesign.desktop has no signatures that match those in shared user android.uid.system; ignoring! WARN/PackageManager(56): Package couldn't be installed in /data/app/ com.frogdesign.desktop.apk Thanks!! Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new Android 0.9 SDK beta! http://android-developers.blogspot.com/2008/08/announcing-beta-release-of-android-sdk.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Gradient TextView foreground instead of a solid color?
Will the 1.0 SDK support gradient text? By that I mean the equivalent of creating my own component and implementing an onDraw method like this, but also getting the text alignment, padding, etc that the TextView already gives you? private Paint mTextPaint = null; ... LinearGradient lg = new LinearGradient(0, 0, 0, 40, new int[] { 0xFF00, 0x }, null, TileMode.CLAMP); mTextPaint.setShader(lg); canvas.drawText(GRADIENT TEXT, 0, 20, mTextPaint); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How to use a WindowAnimation?
This seems like a necessary feature to use in order to transition from one activity to another in such a way that they animate synchronously (one slides out while the other slides in, etc). http://code.google.com/android/reference/android/R.styleable.html#WindowAnimation --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Can we customize status bar height?
Is it possible to change the height of the status bar? We need to maximize our use of the existing screen real estate for our application content, but can't just hide the status bar. Thanks! Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Can we customize status bar height?
Will carriers or OEMs have the ability to customize the status bar height? On Jul 8, 11:43 am, hackbod [EMAIL PROTECTED] wrote: Sorry, that is owned by the system, and can't be modified by apps. On Jul 8, 8:31 am, Cheryl Sedota [EMAIL PROTECTED] wrote: Is it possible to change the height of the status bar? We need to maximize our use of the existing screen real estate for our application content, but can't just hide the status bar. Thanks! Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: is this still true?
This works beautifully, thanks Dianne! One additional question - we've found that we can also press the '9' key to rotate the entire emulator window 90 degrees so that the user can view the device as it would be seen had the user physically rotated it - is there a way for us to invoke that rotation programatically too? Thanks Cheryl On Mar 28, 8:15 pm, hackbod [EMAIL PROTECTED] wrote: To add a little -- most of the orientation work is in M5, though there is still some to be done. Some initial docs are here: http://code.google.com/android/reference/android/app/Activity.html#Co... On Mar 28, 2:35 pm, Megha Joshi [EMAIL PROTECTED] wrote: Hi, You can change the current orientation of the window by using the WindowManager.LayoutParams class. This class provides the following flags: int FLAG_ORIENTATION_DEFAULThttp://code.google.com/android/reference/android/view/WindowManager.L... Windowflag: Force the display to the user's current orientation setting, regardless of the windows behind it. 12288 0x3000 int FLAG_ORIENTATION_LANDSCAPEhttp://code.google.com/android/reference/android/view/WindowManager.L... Windowflag: The display must be in a landscape orientation when this window is at the top. 8192 0x2000 int FLAG_ORIENTATION_PORTRAIThttp://code.google.com/android/reference/android/view/WindowManager.L... Windowflag: The display must be in a portrait orientation when this window is at the top. 4096 0x1000 Get your current Activity's Window object and set the flags above to change orientation of the window: getWindow().setFlags( WindowManager.LayoutParams.FLAG_ORIENTATION_PORTRAIT, WindowManager.LayoutParams.FLAG_ORIENTATION_DEFAULT); or getWindow().setFlags( WindowManager.LayoutParams.FLAG_ORIENTATION_LANDSCAPE, WindowManager.LayoutParams.FLAG_ORIENTATION_DEFAULT); When you change the orientation, it is a configuration change which will cause your current activity to be *destroyed*, you may want to bypass restarting of your activity by setting android:configChangeshttp://code.google.com/android/reference/android/R.attr.html#configCh...attribute in its manifest as follows: activity android:name=.OrientationTest android:label=OrientationTest android:configChanges=orientation intent-filter ... /intent-filter /activity More details on this are under the Configuration Changes section in the link below:http://code.google.com/android/reference/android/app/Activity.html Thanks, Megha On Fri, Mar 28, 2008 at 1:03 PM, CJ [EMAIL PROTECTED] wrote: Hi, guys I saw this statement in the forum which was posted in Jan08 *quote: The current SDK doesn't have complete support for orientations, and definitely not orientation switching while running. * First of all, is it still true? Also, can anybody give a reference? Thanks CJ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Any one tried uisng mediaplayer example ,I ma unable to play video file from local directory
I can play a video from a local directory just fine. I am using a video podcast intended for the iPhone and I put it in an sdcard image and accessed it at /sdcard/myVideos/TheVideoPodcast.m4v Then use VideoView in your layout XML and set its URI programatically in your activity: VideoView vv = (VideoView) findViewById(R.id.video_playback_screen); vv.setVideoURI(Uri.parse(videoFile)); vv.requestFocus(); Hope that helps. Cheryl On Apr 4, 12:42 am, acopernicus [EMAIL PROTECTED] wrote: I was unable to play the streaming .mp4 file as well. Curiously, the MediaPlayer example doesn't even seem capable of streaming an mp4 file out of the box as the url is sets for the MediaPlayer is just : path = http://;; I updated it to point to my file here: path = http://www.pocketjourney.com/audio.mp4;; Has anyone been able to stream an .mp4 file? It's supposed to be supported but I can't find any proof that this claim is true. Anthony --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: What attribute replaced menuItemBackground in the m5 emulator?
I opened a bug to track this issue: http://code.google.com/p/android/issues/detail?id=577 On Mar 25, 5:09 pm, Cheryl Sedota [EMAIL PROTECTED] wrote: This post (which is closed to further posts):http://groups.google.com/group/android-developers/browse_thread/threa... ... suggests that the menuItemBackground attribute can be specified in the theme in order to change the background image that is shown when a list item is selected (it's orange by default in the current m5 SDK). However, that theme attribute got removed in the m5 SDK. Please advise how to get rid of the orange background image that shows up when a list item is clicked. Thanks, Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How to post a new key event?
I am developing an on-screen keyboard activity and need to post a key event to Android. I can't figure out how to do it. I've intercepted some key events to see what Android methods are on the stack, and it seems that I need to call getParent() from my view until I get to the view root (android.view.ViewRoot, which is not an accessible class in Android application code) and then call this method: public void dispatchKey(KeyEvent event) ... I tried calling that method on my view root object using java reflection and passed the key event object that I created. That call was successful but no new text shows up in my EditText control which is located within the keyboard activity. My first goal is for the EditText control that is located within the keyboard activity (which maintains focus even while the key image is pressed) to show the text that I have entered using the keyboard. My second goal is for an EditText control that is in the Activity behind my keyboard activity to show the text that I have entered using the keyboard. I appreciate any help anyone can provide!! Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to post a new key event?
Hi, I am not trying to listen for the onKeyDown event in my keyboard view class or keyboard activity - I want the EditText control that is in the same viewgroup as my keyboard view to listen for and respond to it. Do I have to explicitly set EditText views as focusable? I wouldn't think so because I can type on the Android off-screen keyboard and the text shows up in the EditText view just fine. On Mar 26, 3:50 pm, Rui Martins [EMAIL PROTECTED] wrote: Is your keyboard event handle, onKeyDown(...) method, returning the correct values when they process a specific key ? Do you call the super.onKeyDown(...) and return it's result, when you don't process a key that you don't recognize ? Does commenting the onKeyDown(...) method make the EditText Control, work correctly again ? Maybe you are just forgetting to call the following on your view: setFocusable( true ); // Make sure we get keys NOTE: without Focus you don't receive any keyboard input ! On 26 mar, 18:26, Cheryl Sedota [EMAIL PROTECTED] wrote: I am developing an on-screen keyboard activity and need to post a key event to Android. I can't figure out how to do it. I've intercepted some key events to see what Android methods are on the stack, and it seems that I need to call getParent() from my view until I get to the view root (android.view.ViewRoot, which is not an accessible class in Android application code) and then call this method: public void dispatchKey(KeyEvent event) ... I tried calling that method on my view root object using java reflection and passed the key event object that I created. That call was successful but no new text shows up in my EditText control which is located within the keyboard activity. My first goal is for the EditText control that is located within the keyboard activity (which maintains focus even while the key image is pressed) to show the text that I have entered using the keyboard. My second goal is for an EditText control that is in the Activity behind my keyboard activity to show the text that I have entered using the keyboard. I appreciate any help anyone can provide!! Cheryl- 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to implement non-modal floating windows?
Thanks Dianne! Adding the FLAG_NOT_TOUCH_MODAL worked :) WindowManager.LayoutParams wlp = getWindow().getAttributes(); wlp.gravity = Gravity.BOTTOM; wlp.flags = wlp.flags | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL; getWindow().addContentView(keyboardView, wlp); On Mar 24, 8:25 pm, hackbod [EMAIL PROTECTED] wrote: All of the window control is does through the WindowManager.LayoutParams; there are APIs on Window (retrieved with Dialog.getWindow()) for manipulating them. http://code.google.com/android/reference/android/view/WindowManager.L... In particular, the things it sounds like you want are: http://code.google.com/android/reference/android/view/WindowManager.L...http://code.google.com/android/reference/android/view/WindowManager.L... On Mar 24, 4:40 pm, Cheryl Sedota [EMAIL PROTECTED] wrote: I have a keyboard activity that slides in from the bottom of the screen. I would like the activity that is displayed behind/above the keyboard window to receive touch events even when the keyboard activity view is visible (basically I don't want the keyboard activity to eat touch events if the events don't occur within the floating keyboard activity window's boundaries). Please help me figure out how to accomplish this. The keyboard activity's content view is set to: ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=vertical android:layout_width=fill_parent android:layout_height=wrap_content android:gravity=bottom android:layoutAnimation=@anim/layout_anim_slide_up ImageView android:layout_width=wrap_content android:layout_height=wrap_content android:src=@drawable/keyboard1 / /LinearLayout The only way I could get the window to stay anchored to the bottom of the screen without setting the linear layout's height to fill_parent was to add the keyboard view like this (see below) instead of using setContentView(R.layout.keyboard1): View keyboardView = getViewInflate().inflate(R.layout.keyboard1, null, null); WindowManager.LayoutParams wlp = getWindow().getAttributes(); wlp.gravity = Gravity.BOTTOM; getWindow().addContentView(keyboardView, wlp); The following theme is applied to the keyboard activity (because I am using the translucent background, I can tell for sure that the window is not covering the entire screen because behind the small keyboard activity window, I can still clearly see the activity that was in the foreground before the keyboard was launched. resources !-- Base application theme is the default theme. -- style name=Theme parent=android:Theme /style !-- Base application theme is the dark theme. -- style name=Theme.Keyboard item name=android:textSize18sp/item item name=android:textColor#fff/item item name=android:textStylenormal/item item name=android:windowBackground@drawable/ translucent_background/item item name=android:windowNoTitletrue/item item name=android:windowIsFloatingtrue/item item name=android:gravitybottom/item /style /resources Thanks!! Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] What attribute replaced menuItemBackground in the m5 emulator?
This post (which is closed to further posts): http://groups.google.com/group/android-developers/browse_thread/thread/14ad8df23264f7c1/ba750c4b6e4c5d04?lnk=stq=menuItemBackground#ba750c4b6e4c5d04 ... suggests that the menuItemBackground attribute can be specified in the theme in order to change the background image that is shown when a list item is selected (it's orange by default in the current m5 SDK). However, that theme attribute got removed in the m5 SDK. Please advise how to get rid of the orange background image that shows up when a list item is clicked. Thanks, Cheryl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---