[android-developers] Re: cost of view instantiation versus memory bloat

2013-03-05 Thread momo
ey might not be done the best), re-using will be the proper way to go. > > On Tuesday, March 5, 2013 6:57:24 AM UTC+2, momo wrote: >> >> I have a widget that potentially uses many Views. In looking at the >> source for other view-intensive widgets (like ListView), I understand t

[android-developers] cost of view instantiation versus memory bloat

2013-03-04 Thread momo
I have a widget that potentially uses many Views. In looking at the source for other view-intensive widgets (like ListView), I understand that it's a fairly computationally expensive process to instantiate Views. I see they're recycling children - creating them on demand, then caching them, a

[android-developers] Re: When and how are LayoutParams examined, aside from onLayout and onMeasure

2013-03-03 Thread momo
on others. > > P.S - Maybe its because of there's missing code here, but it seems like > you're just having the parent layout having the same size as the child > layout (basically both have wrap_content on width and height)... why do you > need a custom class for that? >

[android-developers] When and how are LayoutParams examined, aside from onLayout and onMeasure

2013-03-01 Thread momo
I have a custom ViewGroup that's only ever managing the size and position of one child. I've override onMeasure and onLayout so that LayoutParams are never examined, yet it fails unless I do provide LayoutParams. Here are abbreviated summaries of the relevant portions of the class: public cl

[android-developers] Reacting once after initial layout is complete

2012-12-07 Thread momo
This question has been asked several times in various forms but I haven't found a definitive answer. I need to be able to get dimensions and positions of descendant Views after the initial layout of a container (a contentView). The dimensions required in this case are of a View(Group) that is

[android-developers] Re: Simple touch event management

2012-05-03 Thread momo
... and the answer is ACTION_CANCEL... every time i post to this list I find the answer 10 minutes later. 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 u

[android-developers] Simple touch event management

2012-05-03 Thread momo
I've got a component that I want to make various changes to content and display when touched, and revert when the finger goes back up. The following works in general, but if the user's finger wanders out off the component itself before lifting, ACTION_UP never fires, so it never reverts to the

[android-developers] Fetching remote image data - byteArray vs createFromStream vs decodeStream

2012-04-30 Thread momo
I've been looking at the source for several open-source image loaders, and am comparing the approaches. Looks like when processing the image data, most involve URL.openStream, but from there it looks like there are a couple different ways of decoding that stream to a Bitmap: 1. URL.openStream

[android-developers] removing image data from memory

2012-04-30 Thread momo
I have to believe there's a way to clear image data from memory once it's no longer required, but despite exhaustive searching I can't find a solution. Both this list and stack are full of questions regarding OOM errors, specifically "bitmap size exceeds VM budget", but I still don't see a cle

[android-developers] Re: Event propagation

2012-04-28 Thread momo
It looks like returning super.onTouchEvent(event); works. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-develop

[android-developers] Event propagation

2012-04-28 Thread momo
The Android FW event model is a little confusing. Since we're generally limited to a single listener, I've run into a couple issues I'm not sure how to handle correctly. In both cases, I was able to eventually get the net result to work, but generally with some hacky workarounds. I wonder if

Re: [android-developers] TabHost widget causes FC after upgrade

2012-04-17 Thread momo
Here's the basics of the tabhost: public class ChooserView extends TabHost { public FrameLayout tabContent; public TabWidget tabs; public ChooserView(Context context) { super(context); setId(android.R.id.tabhost); setBackgroundResource(R.drawable.cobblestone); LinearLayout ll = new LinearLayo

[android-developers] TabHost widget causes FC after upgrade

2012-04-16 Thread momo
I wrote a small app for a colleague, that uses a TabHost widget. He said he upgraded his phone's OS recently and the app now crashes when attempting to access the Activity containing the TabHost. After some remote support, I was able to get little of the log: Caused by: android.content.res.Re

Re: [android-developers] Prevent a click from being consumed, to pass to containers onTouchEvent

2012-03-31 Thread momo
Thanks for the reply. Imagine that over 75% of the scrollable area was covered by these hotspots - I need the ACTION_DOWN to return true so that the click event does fire when the finger goes up (on that same child view), but *also* pass the event to the scrolling container's onTouchEvent - so

[android-developers] Prevent a click from being consumed, to pass to containers onTouchEvent

2012-03-31 Thread momo
I've got a container that allows 2-d scrolling, fling, pinch etc. This has several layers within it - a viewgroup for image tiles, another for path drawing, another for markers, etc. This all works fine. However, in one particular implementation I have several "invisible buttons" to indicate

[android-developers] Re: Android, SQLite, massive (5000%+) loss of performance on a certain query, on a certain device

2012-03-20 Thread momo
that was it - i had forgotten to pk one id column in one of the join tables - adding that and it's night-and-day - under 1 second, compared with ~30 before. thanks all for reinforcing that concept. very glad i didn't try to convert the whole thing to a Java model. -- You received this messag

[android-developers] Android, SQLite, massive (5000%+) loss of performance on a certain query, on a certain device

2012-03-20 Thread momo
I'm rewriting a simple translation app with a SQLite db. There is an extreme hit to performance between two queries, but only on certain devices. One query lists the english words in a ListView, the other lists the secondary language in a list view. The data is structured differently, and is

Re: [android-developers] Re: Window, WindowManager, PolicyManager classes - or - implementing a custom overlay

2012-03-19 Thread momo
And animating child views is similarly limited? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubs

[android-developers] Re: Window, WindowManager, PolicyManager classes - or - implementing a custom overlay

2012-03-19 Thread momo
So the solution to adding a new "layer" via WindowManager is pretty simple: WindowManager.LayoutParams wlp = new WindowManager.LayoutParams(); // ... position, dimension, ets WindowManager wm = (WindowManager) getSystemService("window"); wm.addView(someView, wlp); However, I'm unable to apply any

[android-developers] Window, WindowManager, PolicyManager classes - or - implementing a custom overlay

2012-03-18 Thread momo
I'm creating a component that needs to appear above (and separate from) the existing UI, similar to the Dialog, PopupWindow and ContextMenu widgets. I'd like it to be modular and portable (again like those widgets I just mentioned), so pre-supposing a particular type of layout for the Activit

Re: [android-developers] Re: application failing on similar devices

2012-03-17 Thread momo
thanks all - good info. > > -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.c

Re: [android-developers] Re: application failing on similar devices

2012-03-17 Thread momo
I think the only real chance of success is for me to go find the device locally. More generally, do you see anything especially problematic with this: 1. a single sqlite query joining 2 tables via a 3rd bridge table, selecting 2 colums with an order by and collate unicode, that'll return 3000-4

[android-developers] Re: application failing on similar devices

2012-03-17 Thread momo
taking too long to populate the ListView. You are > probably doing > work on the UI thread that takes more than a few seconds. > > On Mar 16, 7:34 pm, momo wrote: > > I debug with a Samsung Galaxy SII, running 2.3.6. I created an app that > > runs fine, every time, ev

[android-developers] application failing on similar devices

2012-03-16 Thread momo
I debug with a Samsung Galaxy SII, running 2.3.6. I created an app that runs fine, every time, even under stress, on this device. I uploaded for a colleague in another state, using a device with 2.3.7 (I believe it's a Nexus One). On his device, the app gives a "Not responding - Force Close o

[android-developers] Custom layout - why is behavior different when laying out a ViewGroup (vs View) as a child

2012-03-02 Thread momo
I've got a custom layout for positioning tooltips on a pan-n-zoom tiled map (also custom), in reaction to touch events. The tooltips should appear above and centered to the marker that fired it. Everything works perfectly when using normal Views (ImageView, TextView) as children. However, when

[android-developers] Re: positioning a view based on it's calculated dimensions

2012-03-02 Thread momo
the answer is to manage positioning by override onLayout of the containing ViewGroup, rather than the View itself. E.g., @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { int count = getChildCount(); for (int i = 0; i < count; i++) { View child = ge

[android-developers] positioning a view based on it's calculated dimensions

2012-03-02 Thread momo
I've got a tiled pan-n-zoom component that uses several FrameLayouts to position image tiles (that scale), markers (that move, but don't scale) and controls (which neither move nor scale). It works fine. Markers are positioned in a FrameLayout with topMargin and leftMargin. So far so good. W

[android-developers] unable to find source of dispatchDraw / drawChild error

2012-02-28 Thread momo
In a custom component that displays a small-scale tiled map (similar to iOS CATiledLayer), I'm rendering tiles on-demand based on the scale level the user has supplied (via pinch events or zoom controls). I'm using an AsyncTask to load up the bitmaps and rendering them with publishProgress. This

[android-developers] Re: ADB with docking station

2012-02-21 Thread momo
I hadn't heard of it until your reply - I googled it and found an app for it - installed but when I tried to run it, said my phone must be rooted. Is there a way to do what you're describing without the above? On Feb 21, 1:29 pm, Chrystian Vieyra wrote: > Have you tried wireless adb? -- You re

[android-developers] ADB with docking station

2012-02-21 Thread momo
I would like to debug on my device while it's attached to a docking station, but ADB does not recognize the device when connected that way. ADB works fine when the device is connected directly to my computer. Is there a workaround? TYIA. -- You received this message because you are subscribed

[android-developers] Application Pc-Android

2012-02-16 Thread amara momo
je besoin d'une application qui me permet d'envoyer des message de Pc vers Android :) -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group,

[android-developers] Re: Android custom tween - Timer vs ScheduledThreadPoolExecutor, or alternative

2012-02-11 Thread momo
On Feb 11, 4:35 pm, Kostya Vasilyev wrote: > This is not a multithreaded environment you've got here. > > Your code most likely creates the Handler object on the UI thread, and > if so, that's where it receives messages. This is correct, since the > Android UI framework is not thread-safe and your

[android-developers] Re: Android custom tween - Timer vs ScheduledThreadPoolExecutor, or alternative

2012-02-11 Thread momo
> hmm, seems OK to me, anyway you have working (not bad) solution w/ > Handler :) > > what i like in Animation approach is that interpolatedTime [0..1] but > if it doesn't work... tough luck > > pskink I just created a custom class to get interpolatedTime... package com.whatever.utils; public

[android-developers] Re: Android custom tween - Timer vs ScheduledThreadPoolExecutor, or alternative

2012-02-11 Thread momo
i had tried something very similar: package com.whatever.tests; import android.view.animation.Animation; import android.view.animation.Transformation; public class MapScaleAnimation extends Animation { private OnUpdateListener onUpdateListener; public void setOnUpdateListener(

[android-developers] Re: Android custom tween - Timer vs ScheduledThreadPoolExecutor, or alternative

2012-02-11 Thread momo
hey pskink, i tried that pure-Handler approach you first suggested, and it works a treat - in fact i was able to omit the delay entirely, just sendEmptyMessage (and use a simple time keeper class to determine the delta) - very smooth, very simple. thanks a lot for your help. -- You received thi

[android-developers] Re: Android custom tween - Timer vs ScheduledThreadPoolExecutor, or alternative

2012-02-11 Thread momo
On Feb 11, 4:35 am, skink wrote: > forgot to mention that built-in animations run with no delay - in > short they just call invalidate() in drawing phase in order to make > next frame of animation > > pskink interesting - before reading this, i spent some time looking around for the exact mechani

[android-developers] Re: Android custom tween - Timer vs ScheduledThreadPoolExecutor, or alternative

2012-02-10 Thread momo
awesome, i'll look into both approaches. thanks for the info -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-dev

[android-developers] Re: Android custom tween - Timer vs ScheduledThreadPoolExecutor, or alternative

2012-02-10 Thread momo
thanks for the reply. you'd suggest just using sendMessageDelayed? Would you call each interval as a reaction in handleMessage, or just send a batach of delayedMessages at once with the delay incremented? Would you expect the performance gains to be significant enough to compare to the built

[android-developers] Android custom tween - Timer vs ScheduledThreadPoolExecutor, or alternative

2012-02-10 Thread momo
I'm working on a custom tween effect targeting Android 2.2. This is not a straight View animation (many things are happening based on the progress of the tween), so the Animation classes available in 2.2 aren't sufficient (apparently Animator does this but is not available). I've implemented the

[android-developers] Constraining FrameLayout dimensions (greater than viewport) using LayoutParams after scaling children

2012-02-07 Thread momo
Sorry about the poor title - it's hard to summarize the issue in one line. I'm working on a map tiling system for small-scale maps (imagine building interiors), with zoom and pan functionality. Most of this is working properly, but after a scale operation I try to limit the scrollable area using

[android-developers] Android User Experience and UI refinements

2009-10-27 Thread momo
I think Android has a ton of functionalities and that's definitely wonderful. I am not trying to be overally critical since I know the Android team has been working hard and this is highly appreciated. However in all systems, there are rooms for improvement and here are a few areas where I think

[android-developers] Re: Google: please change your release process

2009-10-26 Thread momo
I can't agree more. Release beta SDKs for each of your releases for developers or any developers who already has an application in the Market. As changes are being implemented, update the beta SDKs to new versions. This way developers are GIVEN MORE TIME to verify that their apps work. Sigh so

[android-developers] Re: Alarm is canceled if app is stopped

2009-10-13 Thread momo
Maybe make another API call that allows killing the service, notifications, and etc of an application except for alarms? I think other applications are affected the most by their alarms getting totally wiped out by another application. Too many task killing applications are using this API call.

[android-developers] How to prevent Failed Binder Transaction

2009-07-13 Thread momo
I have a small piece of code that does this Process process = Runtime.getRuntime().exec(COMMAND); InputStream in = process.getInputStream(); InputReader inr = new InputStreamReader(in); BufferedReader br = new BufferedReader(inr); Then I go through a while loop to read the content of the inputSt