[android-developers] Grey appears pink when scrolling - ListView scrollCache

2011-04-19 Thread Richard Leggett
Hi all,

I think I could be out of luck with this one, but does anyone know
whether ListView does anything to colors when using scrolling cache?

I have a ListView with a background color of #F3F3F3, opaque light
grey. When scrolling the list, the grey turns a grey-pink and usually
resets to grey again when at rest.

Setting scrollingCache to false prevents the pink from appearing, but
I'm worried about the performance hit.

Setting the cacheColorHint to transparent has no effect.

BitmapDrawable and ColorDrawables behave the same.

As it happens the designer has used a lot of F3F3F3 grey in this app,
so I'm seeing quite a lot of pink (Nexus One, 2.3.3).

Here's hoping I missed something.

Regards,
Richard

-- 
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


Re: [android-developers] Grey appears pink when scrolling - ListView scrollCache

2011-04-19 Thread Richard Leggett
Hi Dianne,

I've just spent some time looking at the cache code in View, I was trying to 
force it to use a higher color depth but as you point out the screen may be 
16bit anyway so many thanks I'll just switch to F2F2F2!

I remember reading about some Window colorspace changes on the blog, but I 
forget which platform version.  A quick test:

  getWindow().setFormat(PixelFormat.RGBA_);

sees the problem vanish, but I'll not be using that of course, and just stick 
to F2F2F2.

Cheers,
Richard

On 19 Apr 2011, at 17:44, Dianne Hackborn wrote:

 The cache is often 16bpp.  Pick a color that can be rendered well at 16bpp, 
 such as #f2f2f2.
 
 You want to do this anyway because if your app is running on a 16bpp screen 
 you will also get these kinds of artifacts.
 
 On Tue, Apr 19, 2011 at 9:20 AM, Richard Leggett richard.legg...@gmail.com 
 wrote:
 Hi all,
 
 I think I could be out of luck with this one, but does anyone know
 whether ListView does anything to colors when using scrolling cache?
 
 I have a ListView with a background color of #F3F3F3, opaque light
 grey. When scrolling the list, the grey turns a grey-pink and usually
 resets to grey again when at rest.
 
 Setting scrollingCache to false prevents the pink from appearing, but
 I'm worried about the performance hit.
 
 Setting the cacheColorHint to transparent has no effect.
 
 BitmapDrawable and ColorDrawables behave the same.
 
 As it happens the designer has used a lot of F3F3F3 grey in this app,
 so I'm seeing quite a lot of pink (Nexus One, 2.3.3).
 
 Here's hoping I missed something.
 
 Regards,
 Richard
 
 --
 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
 
 
 
 -- 
 Dianne Hackborn
 Android framework engineer
 hack...@android.com
 
 Note: please don't send private questions to me, as I don't have time to 
 provide private support, and so won't reply to such e-mails.  All such 
 questions should be posted on public forums, where I and others can see and 
 answer them.
 
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
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

Re: [android-developers] Re: Unable to start activity ComponentInfo during TabActivity initialization

2011-02-16 Thread Richard Leggett
I'm afraid you may have to post your layout XML, or as much of it as you can. 
This error is usually related to an incorrectly names/qualified custom control 
or something along these lines.

On 16 Feb 2011, at 08:28, MerlinBG wrote:

 Sorry, forgot to mention - in the activiry that should be displayed in the 
 tab, there is include clause, if this is important.
 Again, the activity is displayed fine when not in tab.
 
 -- 
 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

-- 
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

Re: [android-developers] Re: Unable to start activity ComponentInfo during TabActivity initialization

2011-02-16 Thread Richard Leggett
...but it can also be the referenced control throwing an error in onCreate(), 
so a few things to look into, I'd start by looking at the XML, and then 
stepping through any custom controls' onCreate() methods.

On 16 Feb 2011, at 10:07, Richard Leggett wrote:

 I'm afraid you may have to post your layout XML, or as much of it as you can. 
 This error is usually related to an incorrectly names/qualified custom 
 control or something along these lines.
 
 On 16 Feb 2011, at 08:28, MerlinBG wrote:
 
 Sorry, forgot to mention - in the activiry that should be displayed in the 
 tab, there is include clause, if this is important.
 Again, the activity is displayed fine when not in tab.
 
 -- 
 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
 

-- 
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

Re: [android-developers] bug in bitmap tileMode=repeat / within layer-list ?

2011-02-15 Thread Richard Leggett
I've also experienced tileMode on drawables being ignored (1.6 SDK), generally 
when extending the existing height of a ViewGroup by adding children after the 
initial layout pass. It doesn't always exhibit the behaviour.

I didn't have time to fully investigate the problem at the SDK code level just 
yet, but this quick workaround might help you in the meantime...

BitmapDrawable drawable = (BitmapDrawable)myList.getBackground();
drawable.setTileModeY(TileMode.REPEAT);

Rich

On 15 Feb 2011, at 13:25, Marco Alexander Schmitz wrote:

 hello :)
 
 I've got a ListView and items with their own xml.
 
 these items do have a xml background.
 
 this xml background is a layer-list with 4 items, one of them is a
 bitmap tileMode=repeat /. the others are just an alpha-gradient
 and a blue rectangle painted on top.
 
 sometimes my tile-bitmap (just a small cirlcle.png) is painted
 correctly (lots of small small circles everywhere), sometimes there is
 only one circle which is zoomed to fill_parent.
 
 are there any workarounds for this bug ?
 
 btw: tested on 1.5 1.6 2.1 2.2 emulators and lots of different devices
 (desire, nexus one, galaxy, galaxy tab, x10mini, wildfire, ...)
 
 here comes my xml:
 ?xml version=1.0 encoding=utf-8?
 layer-list xmlns:android=http://schemas.android.com/apk/res/
 android
 
item
shape android:shape=rectangle
solid android:color=@color/white /
/shape
/item
 
item android:top=5dip android:right=5dip
 android:bottom=5dip android:left=5dip
bitmap android:src=@drawable/background_tile_blue
 android:tileMode=repeat /
/item
 
item android:top=5dip android:right=5dip
 android:bottom=5dip android:left=5dip
shape android:shape=rectangle
gradient android:startColor=#ddff
 android:endColor=#00ff android:angle=0 android:type=linear /
 
/shape
/item
 
item android:top=5dip android:right=5dip
 android:bottom=5dip android:left=5dip
nine-patch android:src=@drawable/background_border_blue
 android:dither=true /
/item
 
 /layer-list
 
 greetings,
 marco schmitz
 
 -- 
 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

-- 
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


Re: [android-developers] Density independent values through code for views

2011-02-15 Thread Richard Leggett
You can look into writing a utility method e.g. :

public class Util {
private static float DIP_SCALE = -1;

public static int dipsToPx(int dips, Context context) {
if(DIP_SCALE == -1) DIP_SCALE = 
context.getResources().getDisplayMetrics().density; 
return (int)(dips * DIP_SCALE + 0.5f); 
}
}

and using that in your code...

On 15 Feb 2011, at 14:13, Pepijn Van Eeckhoudt wrote:

 On 15/02/2011 15:03, Deepak Kumar wrote:
 
One of the solution can be multiplying these values with 
 ratio (according to device).Is there any other way to do the same?
 In code, I define constants in 'dp' and then multiply with 
 DisplayMetrics#density at runtime to get the correct pixel value.
 
 Pepijn
 
 -- 
 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

-- 
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

Re: [android-developers] Re: Poor relevancy in Android market since yesterday.

2011-02-12 Thread Richard Leggett
Something weird is going on here, for example if you search on the Market 
website for twitter you get the official app, and also games like Radiant HD, 
but you don't get TweetDeck which has Twitter in the title and does appear as 
the 2nd related app for Twitter (official).

Very strange.

On 12 Feb 2011, at 00:10, TreKing wrote:

 On Fri, Feb 11, 2011 at 3:53 PM, Nathan critter...@crittermap.com wrote:
 On Feb 11, 1:19 pm, JonFHancock jonfhanc...@gmail.com wrote:
  Getting a little cynical these days, huh TreKing? ;-)
 
 
 These days?
 
 LOL - you took my response :-P
 
 -
 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

-- 
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

Re: [android-developers] Re: SoundPool - sample XXX not READY

2011-01-27 Thread Richard Leggett
This doesn't solve your 256 limit problem but I just wanted to point out you 
can still see sample XXX not READY even if you're only using 2 or 3 very 
short sound samples. I've seen this with a 1 second OGG file on the Nexus One.

Now I'm not suggesting this is the best way to deal with it, but I play sounds 
from a non UI thread and use code similar to this to prevent the need to reload 
samples:

http://code.google.com/p/cgmd2010/source/browse/trunk/src/at/ac/tuwien/cg/cgmd/bifth2010/level84/SoundManager.java?spec=svn1192r=1192

Additionally, to deal with the larger samples (still under 1 second) not being 
ready I use this awful fix.

int result = 0;
int abortCount = 100;   
do {
 result = mSoundPool.play(mSoundPoolMap.get(resID), streamVolume, streamVolume, 
1, 0, 1f);
  if(result == 0) {
try {
Thread.sleep(2);
} catch (InterruptedException e) {
e.printStackTrace();
}
  }
} while(result == 0  abortCount--  0); 

This is not good, I'm aware of that, it can make the background thread sleep 
for up to 200msecs before the sound is actually ready (in reality it's never 
more than a couple of iterations). The point is it works, and I don't see any 
callbacks for SoundPool (pre 2.2 / SoundPool.OnLoadCompleteListener) to let you 
know when a sound sample is ready to play. If anyone can enlighten us that 
would be brilliant.

You could look into using MediaPlayer for longer samples, the above I just used 
for quick sound FX but that doesn't sound like a good fit for your case.

Richard

On 26 Jan 2011, at 01:06, Steve wrote:

 Okay, from a little more experimentation it appears after loading/
 unloading 256 sounds things start to go awry. It seems to be 100%
 reproducible in my application. I wasn't actually running the latest
 Android SDK so I updated to latest, and specified the minimum/target
 SDK version to be eight (instead of four) just for good measure, but
 this doesn't help. After 256 sounds have been unloaded, the next load
 never appears to complete.
 
 After more searching on Google (I think I have read every result it
 returns now), I came across this web page (in Japanese):
 
 http://d.hatena.ne.jp/itog/20100927/1285550195
 
 The Google translation does a good enough job for me to get the point
 being conveyed (I believe). It says:
 
 [Begin quote]
 256 Wall
 
 
 load () will be returned in the id is incremented from 0, for
 convenience of memory management in the region of 256 native id
 number. Me a total 257 load () error when trying to become.
 
 ERROR / SoundPool (2693): Unable to load sample: (null)
 
 unload () even if the load () can retrieve the id is not reused. To
 clear the id
 
 soundPool.release ()
 The only state to clean everything once.
 [End quote]
 
 My interpretation of that is that there is an integer index, ever time
 you load a sound you get back an incremented index. On the 257th load,
 the index value you get back is 257, that this causes it to fail to
 load with the above message (I actually get the above message with the
 latest SDK and target version set to eight). When you get to this
 stage, the only option appears to be to release the entire SoundPool,
 create a new one, and carry on.
 
 This seems to completely match what I am experiencing, so if this is
 the case I am at least happy that my code is correct, but I am sad
 that this is as good as it gets. It is not convenient for me to have
 to destroy the SoundPool once an arbitrary number of sounds have been
 loaded and unloaded. On the positive side, I can make some special
 case code in my current application to have a sensible time to dump
 out all sounds, clear the sound pool and recreate it, but it is far
 from neat, and certainly not going to be a project generic, or
 platform generic solution (I have never seen a platform like this
 before where there is such a limit - certainly none of my other cross
 compile targets suffer from this issue).
 
 I would be interested to hear of anyone that believes that can
 actually beat this 256 limit without calling 'release' on their
 SoundPool. I do not feel my application is being particularly
 demanding in terms of the SFX requirements. It is a platform based
 game, and each level loads in a bunch of SFX specific for that level,
 each level is relatively quick (some can just be a few seconds) so if
 you play for a moderate amount of time, it is rather easy to have
 loaded more than 256 sounds loaded and unloaded.
 
 darrinps: It would be interesting to know if you have overcome this
 hurdle, or if you simply haven't hit the 256 limit.
 
 Steve
 
 On Jan 25, 11:47 pm, Steve rockthesm...@gmail.com wrote:
 Unfortunately I am rather confident that all my play's have matching
 stops, and my loads have matching unloads.
 
 I have managed to create my bug quite quickly at least, if I just
 quickly jump between a couple of levels continually until it has
 loaded/unloaded 500 or so samples that seems to break 

Re: [android-developers] Re: Count of activities in App's stack

2011-01-18 Thread Richard Leggett
You might try along the lines of using:

android.permission.GET_TASKS

In your manifest and then code similar to:

http://davanum.wordpress.com/2007/12/18/android-task-manager-primitive-prototype/

But I would strongly recommend you don't ask for that permission and instead do 
what Kumar suggested, perhaps increment/decrement a static AtomicInteger if you 
only care about Activities within your own Application.

Richard

On 17 Jan 2011, at 21:11, Hari Edo wrote:

 
 If you make a new class MyActivity extending Activity, then you make
 all of your activites extend MyActivity instead, then you can
 implement whatever instance tracking you'd like to do.  But Java (and
 thus Dalvik) have no way to reflect and iterate all object instances
 of a class, extended class, or interface implementors.
 
 I don't think the android stack is exposed for inspection either.
 
 On Jan 17, 3:54 pm, Sudhakar Chavali sudhakar.koundi...@gmail.com
 wrote:
 Hello All
 
 Is there a way to know the count of activities exists in Application
 stack?
 
 Thanks  Regards
 Sudhakar Chavali
 
 -- 
 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

-- 
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

Re: [android-developers] Re: image background - how to repeat an image rather than strech it

2011-01-14 Thread Richard Leggett
An easy way of making a bitmap repeat is to create an XML file in the drawable 
folder which looks something like this:

?xml version=1.0 encoding=utf-8?
bitmap xmlns:android=http://schemas.android.com/apk/res/android;
android:src=@drawable/background 
android:tileMode=repeat /

background is a PNG in the same folder, it doesn't sound like you need a 9 
patch in this case. Simply assign @drawable/repeatingbackground or whatever you 
called the file, in place of the original bitmap. 

As for rounding corners, you can subclass the view you are rendering (let's say 
an ImageView) and use clipping to mask the corners, there are a few examples 
here:

http://stackoverflow.com/questions/2459916/how-to-make-an-imageview-to-have-rounded-corners

I'm presenting techniques here that are more generalised and re-useable and not 
a specific one-off which could be better performance-wise (so if you are making 
a component that's like a progress bar, you'd do this clipping and 
repeat-bitmap drawing in the onDraw() rather than increasing rendertime by 
compositing a separate RoundedImageView and a repeatable BitmapDrawable 
described above).

Rich


On 13 Jan 2011, at 08:07, Muhammad Ali wrote:

 You can create a bitmap in memory, using your own file and draw it in
 background. It will help you like the repeat image.
 
 
 
 On Jan 12, 1:57 pm, liordav lior...@gmail.com wrote:
 Hi,
 I have an image I want to use as a background to some layout.
 the problem is the image contains a texture of slant lines, so if i
 use a 1 pixel width image or a 9 patch the image is stretched and the
 texture is Twitching, so i can see the slant lines as latitude lines.
 I saw that he android emulator uses a similar texture in the progress
 bar indeterminate animation, is there a special/simple definition to
 order the background image to repeat itself rather than stretch? is
 there a way to do it with 9 patch, cause eventualy i also need the
 corners to be round.
 thanks for the help.
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
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

Re: [android-developers] Re: Is there a Horizontal ListView?

2010-12-29 Thread Richard Leggett
I did some digging around this a while back and Mark is on the money, it'll 
take a big chunk of time. But I would agree there are plenty of uses for things 
like horizontal lists, in fact there's a very prominent one in the core SMS app 
which allows you to choose a word from a list of predictions. So in answer to 
the question, perhaps you can make use of the code for that to give you a head 
start, found in:

  CandidateView.java

This doesn't extend ListView, or BaseAdapterView but simply View.

I had to slightly modify ListView and ended up having to jump through many 
hoops to make a small change, I'm finishing up an app which has very styled 
user interface elements and I've found the SDK makes creating custom components 
very easy, but extending existing components is very hard because it is 
understandably restrictive. This is quite often than not to do with ListView 
because it has so much useful functionality baked in to support adapters, 
states, touch, keyboard and trackball input that is just frustrating to 
re-implement. It's a problem because we want to be creating more expressive UIs 
where it improves on the standard, right now that usually means spending an 
great deal of time studying the source code and seeing if it can be achieved 
through composition or existing methods (sometimes over-complicating the view 
hierarchy) and more often copying the entire source code for one (often two) 
base classes so that you can modify a key private field and not lose out on 
performance. 

The easy answer is to just stick to the basics UIs we're used to seeing, but I 
really hope things get a bit more flexible so that more people can creative 
compelling-looking apps that don't just look like they've been put together in 
a drag and drop GUI form builder.

Regards,
Richard

On 25 Dec 2010, at 23:41, Mark Murphy wrote:

 On Sat, Dec 25, 2010 at 6:27 PM, jotobjects jotobje...@gmail.com wrote:
 But UI designers don't
 take the API doesn't do that as a reason for changing the design.
 
 UI designers can ask for whatever they want. It is up to engineers to
 explain to management that the designers are asking for things that
 are not natively implemented on the platform and therefore will
 require significant additional engineering time. It is then
 management's responsibility to determine whether the UI designers
 feature is worth that additional engineering time.
 
 There are lots of posts in this forum with developers asking for
 horizontal scrolling and horizontal list views.  It's a natural UI
 design element for some kinds of lists. It behaves somewhat like a
 drop down list (in that is is expandable) without obscuring the other
 widgets on the screen.  The user can drag it (scroll) back and forth.
 
 I'm not saying it's a bad idea. I am saying you have your work cut out
 for you, and I am saying that I believe that it has not been done a
 100 times already.
 
 -- 
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy
 
 Android Training in Atlanta: http://bignerdranch.com/classes/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, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
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] ADT is no longer launching APK on device

2010-12-03 Thread Richard Leggett
Hi all,

I've had a very strange thing happen here, one minute I'm debugging my
app (on a Nexus One), no problems, the next it refuses to launch after
installation every time. My logcat contains the following (hopefully
the relevant parts, trimmed out GC logs etc):

D/PackageParser(21026): Scanning package: /data/app/vmdl26933.tmp
I/PackageManager(21026): Removing non-system package:com.domain.proj
I/ActivityManager(21026): Force stopping package com.domain.proj
uid=10046
D/PackageManager(21026): Scanning package com.domain.proj
I/PackageManager(21026): /data/app/com.domain.proj-2.apk changed;
unpacking
I/PackageManager(21026): Package com.domain.proj codePath changed
from /data/app/com.domain.proj-1.apk to /data/app/
com.domain.proj-2.apk; Retaining data and using new
D/installd(   61): DexInv: --- BEGIN '/data/app/com.domain.proj-2.apk'
---
D/dalvikvm(30993): creating instr width table
D/dalvikvm(30993): DexOpt: load 24ms, verify 62ms, opt 2ms
D/installd(   61): DexInv: --- END '/data/app/
com.domain.proj-2.apk' (success) ---
D/PackageManager(21026):   Activities: com.domain.proj.[...snip for
brevity...]
I/ActivityManager(21026): Force stopping package com.domain.proj
uid=10046
W/PackageManager(21026): Code path for pkg : com.domain.proj changing
from /data/app/com.domain.proj-1.apk to /data/app/
com.domain.proj-2.apk
W/PackageManager(21026): Resource path for pkg : com.domain.proj
changing from /data/app/com.domain.proj-1.apk to /data/app/
com.domain.proj-2.apk
I/installd(   61): move /data/dalvik-cache/
d...@app@com.domain.proj-2@classes.dex - /data/dalvik-cache/
d...@app@com.domain.proj-2@classes.dex
D/PackageManager(21026): New package installed in /data/app/
com.domain.proj-2.apk
I/ActivityManager(21026): Force stopping package com.domain.proj
uid=10046
D/VoiceDialerReceiver(21629): onReceive Intent
{ act=android.intent.action.PACKAGE_REMOVED
dat=package:com.domain.proj flg=0x1000
cmp=com.android.voicedialer/.VoiceDialerReceiver (has extras) }
V/RecognizerEngine(21629): deleteCachedGrammarFiles /data/data/
com.android.voicedialer/files/openentries.txt
D/VoiceDialerReceiver(21629): onReceive Intent
{ act=android.intent.action.PACKAGE_ADDED dat=package:com.domain.proj
flg=0x1000 cmp=com.android.voicedialer/.VoiceDialerReceiver (has
extras) }
V/RecognizerEngine(21629): deleteCachedGrammarFiles /data/data/
com.android.voicedialer/files/openentries.txt
D/vending (21454): [79] LocalAssetCache.updateOnePackage(): No local
info for com.domain.proj
I/installd(   61): unlink /data/dalvik-cache/
d...@app@com.domain.proj-1@classes.dex
D/vending (21454): [81] LocalAssetCache.updateOnePackage(): No local
info for com.domain.proj
D/AndroidRuntime(30985): Shutting down VM
I/AndroidRuntime(30985): NOTE: attach of thread 'Binder Thread #3'
failed

That's it, the app icon refreshes in the launcher but it doesn't then
run. This applies to any projects I try to run on the phone, not just
this app.

I should say it launches fine on the emulator, and I have tried
installing eclipse and ADT afresh, creating a new workspace,
uninstalling the app on the phone, rebooting phone and Mac several
times.

Does anyone have an ideas on the cause of this? I can't seem to find
anything online, some bits regarding dalvik-cache but nothing that I
can try out.

Many thanks,
Richard

-- 
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


Re: [android-developers] Re: Sony Ericsson LiveView ™ micro display SDK is released

2010-11-30 Thread Richard Leggett
If I remember rightly you don't need a SE phone to use with the LiveView, I'll 
be testing with a Nexus One in the next week (should it arrive).

Regards,
Richard

On 29 Nov 2010, at 20:33, Leon Moreyn-Android Development wrote:

 Ba hum bug. Its not good for US developers as most of the Xperia line
 in the USA will not receive update to 2.1 until most likely well into
 the new year.
 
 On Nov 29, 3:40 am, Najat Baker najat.ba...@sonyericsson.com wrote:
 You can now download LiveView™ SDK here:
 
 http://developer.sonyericsson.com/wportal/devworld/downloads/download...
 
 And you can find LiveView™ micro display developer tutorial here:
 
 http://developer.sonyericsson.com/wportal/devworld/downloads/download...
 
 Best regards
 
 Najat
 
 -- 
 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

-- 
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


Re: [android-developers] Re: how to implement Two line text with different colors on one button

2010-11-24 Thread Richard Leggett
You can also use a SpannableStringBuilder. Here's a contrived example, but it 
shows the basics:

TextAppearanceSpan  span = new TextAppearanceSpan(mContext, 
R.style.MyTextAppearance);
SpannableStringBuilder builder = new SpannableStringBuilder();
builder.append(First line\nSecond line);
builder.setSpan(span, 0, 10, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
text.setText(builder);

That assumes you've got a text style in styles.xml, something like:

style name=MyTextAppearance
item name=android:textColor#/item
/style

Rich

On 24 Nov 2010, at 14:26, pedr0 wrote:

 If your text will never change you can apply an image at  your botton,
 in your image you can do that without problem.
 
 
 On 24 Nov, 14:57, xi developer xidevelope...@gmail.com wrote:
 In my android app development, I have one button, the button text is
 not a single color text, it is two lines text, with each line uses
 different color for line text. How to implement this? Two lines can
 be simply implemented by adding \n in the text, I don know how to
 set different colors for each line text on the button. Anyone can help
 (with details)?
 
 -- 
 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

-- 
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] iOS UI Patterns Bleeding into Android apps

2010-11-04 Thread Richard Leggett
Twitter for Android is an excellent app, but the lastest update shows
how a lot of iOS UI patterns are bleeding over to Android apps,
potentially confusing things.

To note a couple:

1. Pull down ListView (beyond top) to refresh.
2. Swipe finger across a ListView row to bring up actions/edit.

First of all, iOS has some extremely well thought at and sensible UI/
UX patterns, many of them designed to get around the limitation of
having one physical button (always needing a back button on screen, no
menu key and so on).

The danger here is that as Android developers we don't have this stuff
built into the SDK, if you've tried to implement iOS's overshoot/
elastic ScrollViews which are purported to be coming to Gingerbread,
you'll know how much extra work this can be, and potentially how
brittle that might make code, especially if this particular feature is
going to be built in.

In response to the numbered points above, what about Android's click
list view header to scroll to top, and what about the long-press for
bringing up actions/options for an item. TweetDeck is one of the best
examples of Android done right IMHO, fully embracing a lot of the
design and interaction guidelines that are beginning to emerge.

Are we going to confuse users by having an Android way to do things
mixed in with an iOS way to do things?

-- 
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


Re: [android-developers] physics engine with great demos

2010-10-24 Thread Richard Leggett
Rokon is a good engine with physics and some commercial apps/demos:

http://www.rokonandroid.com/


On 24 Oct 2010, at 11:05, noob_boy wrote:

 Hi,
 
 I am a newbie thinking of writing a physics game app.  I did see
 some engines, but most of them have no good demos or docs.
 
 So can you guys please point me to any physics engine with lot of
 demos/sample codes?
 
 Thanks
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
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


Re: [android-developers] ListView inside ScrollView (re-hash/best practices)

2010-10-20 Thread Richard Leggett
Hi Mark,

Thanks for your advice. I'd really like to do that as I know that will simplify 
things, unfortunately the scrolling nature of the background behind the 3 UI 
widgets is integral to the design (a port of an iPhone app, that had the same 
challenge as it turns out).

Looks like for now I'll have to go one of two routes...

1. Extend ListView to implement background scrolling and use 
addHeader/FooterView().
2. Extend LinearLayout to work with a ListAdapter (as this UI strategy is used 
in several Activities)

Many thanks again, 
Richard


On 19 Oct 2010, at 19:11, Mark Murphy wrote:

 On Tue, Oct 19, 2010 at 11:00 AM, Richard Leggett
 richard.legg...@gmail.com wrote:
 I'm keen to see if anyone has a better solution to this problem?
 
 Get rid of the background. You are taking on a fairly substantial
 maintenance headache for the sake of a background image.
 
 -- 
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy
 
 Android App Developer Books: http://commonsware.com/books
 
 -- 
 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

-- 
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


Re: [android-developers] Android Activity stack

2010-10-20 Thread Richard Leggett
Are you saying when you press back from Activity A you are somehow going back 
to Activity B?

If so it sounds like you have multiple instances of Activity B already on the 
stack, when starting Activity B you can add the intent flag 
Intent.FLAG_ACTIVITY_CLEAR_TOP to make sure you only ever have one instance:

Intent intent = new Intent(this, ActivityB.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);  
startActivity(intent);

I'm not sure I fully understand your situation so please feel free to provide 
more details if this is along the wrong lines.

Regards,
Richard

On 20 Oct 2010, at 12:07, Donald wrote:

 hi guys,
 
 Assume i have two activities Activity A and B
 
 Activity B will display a list
 
 which will display a 25 result list. this also contains a pagination
 logic. if user select next it will display the next 25 result list.
 
 so assume that user is in the third page. from the third page if user
 selects back i want display Activity A. which i have already done.
 
 but when i click back button from Activity A i want to exit the
 application so once i press the back button from Activity A i use
 finish()
 
 but Application will not exit.
 
 rather it displays the 1,2 list results then only application will
 exit.
 
 i want to achieve this with out setting the noHistory attribute in
 manifest.
 
 ragards,
 
 Mike
 
 -- 
 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

-- 
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


Re: [android-developers] ListView inside ScrollView (re-hash/best practices)

2010-10-20 Thread Richard Leggett
I've opened a feature request related to this:

http://code.google.com/p/android/issues/detail?id=12007

Again I completely appreciate ListView was designed for efficient scrolling 
through large amounts of data and not for what I need, but we do not yet have a 
good alternative for short (static) lists inside ScrollView that also lets us 
make use of Adapters, selectors, dividers and input device handling, without 
having to re-implement all of these things ourselves.

Example layout:

ScrollView
  Logo
  Top 5 items list
  Save button
  Edit Button
  Delete Button
  Footer

Assume the total height of these controls exceed the dimensions of the screen, 
and so require scrolling. If I use ListView for the list (as I want the user to 
be able to do ListView-like things). Using addHeaderView/addFooterView() is not 
an option here as the background must scroll for the design work.

Regards,
Richard



On 20 Oct 2010, at 10:40, Richard Leggett wrote:

 Hi Mark,
 
 Thanks for your advice. I'd really like to do that as I know that will 
 simplify things, unfortunately the scrolling nature of the background behind 
 the 3 UI widgets is integral to the design (a port of an iPhone app, that had 
 the same challenge as it turns out).
 
 Looks like for now I'll have to go one of two routes...
 
 1. Extend ListView to implement background scrolling and use 
 addHeader/FooterView().
 2. Extend LinearLayout to work with a ListAdapter (as this UI strategy is 
 used in several Activities)
 
 Many thanks again, 
 Richard
 
 
 On 19 Oct 2010, at 19:11, Mark Murphy wrote:
 
 On Tue, Oct 19, 2010 at 11:00 AM, Richard Leggett
 richard.legg...@gmail.com wrote:
 I'm keen to see if anyone has a better solution to this problem?
 
 Get rid of the background. You are taking on a fairly substantial
 maintenance headache for the sake of a background image.
 
 -- 
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy
 
 Android App Developer Books: http://commonsware.com/books
 
 -- 
 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
 

-- 
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


Re: [android-developers] ListView inside ScrollView (re-hash/best practices)

2010-10-20 Thread Richard Leggett
There's no reason for them to write anything but they are hopefully looking to 
create the best developer platform. 

I am working on this myself, but the whole purpose of the public bug/feature 
database (and this list) is to make suggestions that may help others in future. 

On 20 Oct 2010, at 13:32, Mark Murphy wrote:

 There is no particular reason why Google needs to write this. Anybody
 can write this and make it a reusable component. A knee-jerk reaction
 of if it's lime green, Google must write it is a sad statement.
 
 On Wed, Oct 20, 2010 at 8:26 AM, Richard Leggett
 richard.legg...@gmail.com wrote:
 I've opened a feature request related to this:
 
 http://code.google.com/p/android/issues/detail?id=12007
 
 Again I completely appreciate ListView was designed for efficient scrolling 
 through large amounts of data and not for what I need, but we do not yet 
 have a good alternative for short (static) lists inside ScrollView that also 
 lets us make use of Adapters, selectors, dividers and input device handling, 
 without having to re-implement all of these things ourselves.
 
 Example layout:
 
 ScrollView
  Logo
  Top 5 items list
  Save button
  Edit Button
  Delete Button
  Footer
 
 Assume the total height of these controls exceed the dimensions of the 
 screen, and so require scrolling. If I use ListView for the list (as I want 
 the user to be able to do ListView-like things). Using 
 addHeaderView/addFooterView() is not an option here as the background must 
 scroll for the design work.
 
 Regards,
 Richard
 
 
 
 On 20 Oct 2010, at 10:40, Richard Leggett wrote:
 
 Hi Mark,
 
 Thanks for your advice. I'd really like to do that as I know that will 
 simplify things, unfortunately the scrolling nature of the background 
 behind the 3 UI widgets is integral to the design (a port of an iPhone app, 
 that had the same challenge as it turns out).
 
 Looks like for now I'll have to go one of two routes...
 
 1. Extend ListView to implement background scrolling and use 
 addHeader/FooterView().
 2. Extend LinearLayout to work with a ListAdapter (as this UI strategy is 
 used in several Activities)
 
 Many thanks again,
 Richard
 
 
 On 19 Oct 2010, at 19:11, Mark Murphy wrote:
 
 On Tue, Oct 19, 2010 at 11:00 AM, Richard Leggett
 richard.legg...@gmail.com wrote:
 I'm keen to see if anyone has a better solution to this problem?
 
 Get rid of the background. You are taking on a fairly substantial
 maintenance headache for the sake of a background image.
 
 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy
 
 Android App Developer Books: http://commonsware.com/books
 
 --
 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
 
 
 --
 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
 
 
 
 
 -- 
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy
 
 _Android Programming Tutorials_ Version 3.0.1 Available!
 
 -- 
 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

-- 
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


Re: [android-developers] ListView inside ScrollView (re-hash/best practices)

2010-10-20 Thread Richard Leggett
Apologies to Stakka the original poster, looks like I hijacked a thread 
unintentionally (replying to an email and changing subject rather than creating 
a new email doesn't create a new Thread on this group).

On 20 Oct 2010, at 13:39, Richard Leggett wrote:

 There's no reason for them to write anything but they are hopefully looking 
 to create the best developer platform. 
 
 I am working on this myself, but the whole purpose of the public bug/feature 
 database (and this list) is to make suggestions that may help others in 
 future. 
 
 On 20 Oct 2010, at 13:32, Mark Murphy wrote:
 
 There is no particular reason why Google needs to write this. Anybody
 can write this and make it a reusable component. A knee-jerk reaction
 of if it's lime green, Google must write it is a sad statement.
 
 On Wed, Oct 20, 2010 at 8:26 AM, Richard Leggett
 richard.legg...@gmail.com wrote:
 I've opened a feature request related to this:
 
 http://code.google.com/p/android/issues/detail?id=12007
 
 Again I completely appreciate ListView was designed for efficient scrolling 
 through large amounts of data and not for what I need, but we do not yet 
 have a good alternative for short (static) lists inside ScrollView that 
 also lets us make use of Adapters, selectors, dividers and input device 
 handling, without having to re-implement all of these things ourselves.
 
 Example layout:
 
 ScrollView
 Logo
 Top 5 items list
 Save button
 Edit Button
 Delete Button
 Footer
 
 Assume the total height of these controls exceed the dimensions of the 
 screen, and so require scrolling. If I use ListView for the list (as I want 
 the user to be able to do ListView-like things). Using 
 addHeaderView/addFooterView() is not an option here as the background must 
 scroll for the design work.
 
 Regards,
 Richard
 
 
 
 On 20 Oct 2010, at 10:40, Richard Leggett wrote:
 
 Hi Mark,
 
 Thanks for your advice. I'd really like to do that as I know that will 
 simplify things, unfortunately the scrolling nature of the background 
 behind the 3 UI widgets is integral to the design (a port of an iPhone 
 app, that had the same challenge as it turns out).
 
 Looks like for now I'll have to go one of two routes...
 
 1. Extend ListView to implement background scrolling and use 
 addHeader/FooterView().
 2. Extend LinearLayout to work with a ListAdapter (as this UI strategy is 
 used in several Activities)
 
 Many thanks again,
 Richard
 
 
 On 19 Oct 2010, at 19:11, Mark Murphy wrote:
 
 On Tue, Oct 19, 2010 at 11:00 AM, Richard Leggett
 richard.legg...@gmail.com wrote:
 I'm keen to see if anyone has a better solution to this problem?
 
 Get rid of the background. You are taking on a fairly substantial
 maintenance headache for the sake of a background image.
 
 --
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy
 
 Android App Developer Books: http://commonsware.com/books
 
 --
 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
 
 
 --
 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
 
 
 
 
 -- 
 Mark Murphy (a Commons Guy)
 http://commonsware.com | http://github.com/commonsguy
 http://commonsware.com/blog | http://twitter.com/commonsguy
 
 _Android Programming Tutorials_ Version 3.0.1 Available!
 
 -- 
 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
 

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


[android-developers] ListView inside ScrollView (re-hash/best practices)

2010-10-19 Thread Richard Leggett
Hi All,

I know this has come up a few times in the past, and the best advice is to 
avoid having ListViews inside a ScrollView entirely (instead using 
addHeaderView()/addFooterView() or doing it manually with a LinearLayout, but I 
just wanted to see what best practices people might put forward for this...

The design I have to implement has a top-level ScrollView, inside of which is a 
logo ImageView, a dynamically populated ListView of clickable items and a 
Button beneath this.

The design excludes me from simply using addHeader/FooterView() for the logo 
and button because the background of the ScrollView needs to scroll (normally 
it remains fixed and the content scrolls).

My solution has been to create a custom class which extends LinearLayout and 
has similar methods to ListView, such as setAdapter().

The problem is you have to re-implement so much by going with LinearLayout, 
such as selectors, dividers, trackball/kb input, long-click and so on. I'm keen 
to see if anyone has a better solution to this problem?

Regards,
Richard


-- 
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 a TextView background included in wrap_content measurement?

2010-10-05 Thread Richard Leggett
I have a PNG being used for a TextView background. The TextView is set
to wrap_content for width/height. The problem is, I cannot get it to
be smaller than the original pixel dimensions of the background PNG,
this leaves my text floating in the middle, as if I've used padding.

TextView
android:layout_width=wrap_content
android:layout_height=wrap_content
android:maxWidth=250dip
android:minWidth=150dip
android:text=Sample text
android:background=@drawable/my_png
android:gravity=center_vertical
/

It turns out that if I make the PNG into a nine-patch, the TextView
behaves as I expect, and the width/height of the TextView is then
allowed to be smaller than the physical dimensions of the background
PNG being used. So this is a workaround for now.

Does anyone know whether I should report this as a bug (targetting
1.6)? Or is the background drawable supposed to be taken into account
as part of the content width/height unless using a nine-patch?

-- 
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] Bold and regular custom fonts within a TextView

2010-09-23 Thread Richard Leggett
I've done quite a lot of digging around the 1.6 SDK source code for
this one. My aim is simply to have 2 StyleSpans within a TextView, one
containing bold text, the other normal, both using a custom font.

I'm setting the typeface to a custom font which was created in this
fashion:

// utility class
public static Typeface getTypewriter(Context context) {
if(typewriter == null)
typewriter = Typeface.createFromAsset(context.getAssets(), 
fonts/
americantypewriter-medium.otf);
return typewriter;
}
... similar function for for getting bold face ...

// usage
textView.setTypeface(Typefaces.getTypewriter(mContext),
Typeface.NORMAL);
textView.setTypeface(Typefaces.getTypewriterBold(mContext),
Typeface.BOLD);
SpannableStringBuilder builder = new SpannableStringBuilder(Hello
World);
builder.setSpan(new StyleSpan(Typeface.BOLD), 0, 4,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
builder.setSpan(new StyleSpan(Typeface.NORMAL), 5, 9,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
textView.setText(builder);


Based on the source, I can see that calling setTypeface() twice just
overwrites the previous call, even when the style param is different.
So in my case the entire TextView appears in bold. I'm kind of hoping
there's a way to do it given you can use BOLD and NORMAL when using a
built-in font.

Does anyone have any workarounds?

-- 
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: Bold and regular custom fonts within a TextView

2010-09-23 Thread Richard Leggett
I should point out that the faux bold probably looks terrible because
of how thin this font is. I tried a different TTF file and it looked
OK. Either way, using two completely different fonts in the same
TextView would be another use-case.

On Sep 23, 3:42 pm, Richard Leggett richard.legg...@gmail.com wrote:
 I've done quite a lot of digging around the 1.6 SDK source code for
 this one. My aim is simply to have 2 StyleSpans within a TextView, one
 containing bold text, the other normal, both using a custom font.

 I'm setting the typeface to a custom font which was created in this
 fashion:

 // utility class
 public static Typeface getTypewriter(Context context) {
         if(typewriter == null)
                 typewriter = Typeface.createFromAsset(context.getAssets(), 
 fonts/
 americantypewriter-medium.otf);
         return typewriter;}

 ... similar function for for getting bold face ...

 // usage
 textView.setTypeface(Typefaces.getTypewriter(mContext),
 Typeface.NORMAL);
 textView.setTypeface(Typefaces.getTypewriterBold(mContext),
 Typeface.BOLD);
 SpannableStringBuilder builder = new SpannableStringBuilder(Hello
 World);
 builder.setSpan(new StyleSpan(Typeface.BOLD), 0, 4,
 Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
 builder.setSpan(new StyleSpan(Typeface.NORMAL), 5, 9,
 Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
 textView.setText(builder);

 Based on the source, I can see that calling setTypeface() twice just
 overwrites the previous call, even when the style param is different.
 So in my case the entire TextView appears in bold. I'm kind of hoping
 there's a way to do it given you can use BOLD and NORMAL when using a
 built-in font.

 Does anyone have any workarounds?

-- 
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: Froyo 2.2 disables requestWindowFeature(Window.FEATURE_NO_TITLE);

2010-05-27 Thread Richard Leggett
Thanks for confirming, I must have something missing from my manifest
then, strange.

On May 27, 11:22 am, String sterling.ud...@gmail.com wrote:
 On May 27, 9:39 am, gjs garyjamessi...@gmail.com wrote:

  No seems ok to me on Nexus1 with 2.2 and an app that uses
  requestWindowFeature(Window.FEATURE_NO_TITLE);

  Do you mean 2.2 on phone or emulator ?

 Works fine for me as well, on both an emulator instance and a Nexus
 One flashed to 2.2.

 String

-- 
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] Froyo 2.2 disables requestWindowFeature(Window.FEATURE_NO_TITLE);

2010-05-26 Thread Richard Leggett
Just trying to get a confirmation, has anyone else found that since
updating to 2.2 the following line has no effect:

requestWindowFeature(Window.FEATURE_NO_TITLE);

Is there a new permission required?

-- 
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: Reg: Android Game API

2010-02-16 Thread Richard Leggett
Take a look at Rokon (rokonandroid.com). Very active, version 2.0 is
underway with lots of big changes.

On Feb 15, 1:14 pm, TomM tomm.m...@gmail.com wrote:
 Hi All,

 I am new to android games development on mobiles.  can any one suggest
 me which API suitable to develop game. I am using Android 1.5 API for
 Android mobiles.

 I need help from you all.

 Thanks,
 TomM.

-- 
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: Preparing for Droid OpenGL issues

2010-01-14 Thread Richard Leggett
I've heard the Droid having problems with PNGs that are not 24bit
(alpha). It's worth checking out the Rokon mailing list and forum for
more info on this.

Also if you post in the forums there I'll be happy to test on a Nexus
One.

On Jan 14, 3:14 pm, markusn82 markus...@gmail.com wrote:
 Hi,

 I'm nearly ready to publish my OpenGL game. I've been browsing this
 newsgroup and I've seen quite a few posts regarding crashes, blank
 screens, etc when running an OpenGL application on the Droid. I have
 three questions:

 1) What are some common pitfalls that occur when trying to support the
 Droid/Nexus One? So far, I've tested my game on the Android 2.0
 emulator (both WVGA  FWVGA) and everything works fine but I'm still
 paranoid.

 2) I've placed my textures (png) in the assets folder. Will these
 images be pre-scaled automatically? I've read about specifying density
 independent images for resources but do the same rules apply for
 images stored in the assets folder? I'm afraid that pre-scaling will
 cause my textures to become non-power of 2.

 3) What additional strategies have developers been taking to ensure
 their application works on the newer devices when they only have
 access to G1/G2 hardware?
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: How To Install SDK Behind Authenticated Proxy

2010-01-12 Thread Richard Leggett
You may have some luck in using a third party tool like Charles
(xk72.com) to set up the proxy, it has some advanced options and has
served me well in all kinds of situations. This way you don't need to
do anything special in the AVD manager.

On Jan 12, 1:10 pm, bklik brenton.k...@gmail.com wrote:
 I'm unable to configure the Android SDK and AVD Manager to acquire
 packages from behind an authenticated proxy server.  I've filled out
 the proxy fields in the Settings area, but am never ask my username or
 password.  I tried the username:password@proxyurl method, which
 doesn't work either.

 How can I get this to work?
-- 
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