how do I extract an AttributeSet from an xml file

by Andy Droid » Fri, 04 Sep 2009 09:33:31 GMT

Sponsored Links
 I would like to extend ViewFlipper, so that I can override some of the
functions.  I borrowed some code from the Flipper Demo in Murphy's
Busy Coders book.

I made my own class that extends it, but I have to pass in an
AttributeSet, when I instantiate it.  How do I get that from my xml?

Here is the original code:


Here is my new code:

AttributeSet myAttributeSet  = ??;
myExtendedViewFlipper flipper = new myExtendedViewFlipper ( this,


Other Threads

1. App adds a button to another app

How can I cause my app to add a button to another app, the text
messaging app for instance?  I want to add a button and then listen
for when it is pressed, at which point code from my app would
execute.  In the notepad exercise 1 tutorial from the dev guide,
there's a link that says "add a button to an existing application!"
but this just links to the common development tasks.  I've searched
this but haven't found anything helpful.

Any help would be greatly appreciated!




My experience has been that even if there is an open source version of a piece 
of software out there companies usually prefer to get the paid version. Hence 
why I always say that people should always charge for their software..

My advice to you is to continue with your project. Individual users like me may 
not buy it but companies usually have no problem paying for software.

Regarding xmlvm, does anybody have any succes stories? I might use it for my 
projects so I'm interested in knowing how much success others have had with 
this tool.

On Mar 19, 2009, at 5:48 PM, "Felipe (Noa Technologies)" <> 

I was not aware of this. I have to admit I'm jealous, it looks like
cool stuff.

Our application works like this:

It takes java source code and translates it into Objective-C source
code. It automatically adds the memory management calls,
that is, retain, release and autorelease.

Well, we'll release our stuff anyway. Our focus is commercial so it
may end up not being used by anybody. We'll see.

How does it compare to XMLVM?


We will announce the Beta version here it when it comes out.

I'd like to see it when it comes out....

On Thu, Mar 19, 2009 at 6:28 PM, Felipemnoa <>  

Just one more thing off topic. My company is about to announce a  
new tool:
A java to objective-c translator. There is nothing there in our  
about this product yet but you should expect to see something  
there in a
couple of weeks at: http:\\

On Mar 19, 2009, at 6:52 AM, Stoyan Damov <>  

Thanks Chris (and Incognito)!

Yes, I know it's really *quite* off-topic on the android-discuss  
and off-topic even for this thread, but couldn't help it! :)


On Thu, Mar 19, 2009 at 12:42 PM, Chris Greening

There was a big discussion about this on the iPhone forums.

The conclusion was that Objective-C is find for most things. If  
doing some number crunching on some complex data structures (e.g.
vectors/matrices etc) then you'll probably want to re-use your C++

The interface to open GL is a C-API already. So there's no  
overhead with calls to that.

Mixing C++ and Objective-C works well - I've done it in my projects
and use the stl library to get good collection classes for native
types (the collection classes in Objective-C are great for Obj-C
objects but you have to box everything else).

For doing the UI objective-C is the way to go - you can't really  
it as the entire UI kit is all objective-C.

I'd recommend checking out Cocos2d
- that seems to be the library of choice for 2D games on the iPhone.
One of my non-developer background friends has started using it and
says that it's great.

Anyway, this is a bit off topic for an Android discussion group!

Right. If I'm to write an arcade/action game for iPhone would you
suggest that I implement it in C++ (which is one of my day job's
languages, and in which I'm proficient) or I should go with
Objective-C since it's the language of choice for MacOS (which I
should re-learn)? Is Objective-C fast enough for action games?


On Thu, Mar 19, 2009 at 12:15 PM, Incognito  

Sorry never used any. They wanted me to pay money for the one I  
don't remember name right now, will look them up. My apps were  
written in C so all I did was to move that code to iPhone since it  

On Mar 19, 2009, at 5:48 AM, Stoyan Damov <>  

Would you care to mention at least one of them? Especially if you've
ever used it.

On Thu, Mar 19, 2009 at 11:21 AM, Incognito  

There are tools available to port your java code to Objective-C.  
should save you a huge amount of time.

On Mar 19, 2009, at 5:04 AM, Al Sutton <>  

So many ideas, so little time......


Why not just develop for both instead of choosing sides?

I must admit VOIP on (stock) android would be a killer app for  
me.  I
could sell that 10,000 times over to our clients.  My take on  
Apple vs
Android goes a bit like this:

Commodore 64 - Sinclair spectrum
Commodore Amiga - Atari ST
PC - Mac
Android - iPhone

I made a wise choice  :-)

Some are saying Google won't make it in the mobile space.  TBH I  
think they will have to with the new tech coming out with  
Android.  The
G? is just a small feather in a big headdress :-)  Android will be
everywhere and boy am I looking forward to the day  :-)


I think the comparison table at
gives a pretty good picture of how the iPhone OS update compares  

Apple may be something of an anomaly in the mobile market, but  
it's a
popular anomaly that consumers seem to like.


You just dont understand the problem IMHO. Dont get me wrong, I am a
huge advocate of Android.

With this new iPhone OS 3.0, Apple is giving more meat to both the
final users (consumers) and the developers.

I think this is a great deal and Apple thru this wise move is just
trying to kill the competition right the way. We can say goodbye to
crappy basic phones, Blackberry OS, WinMo and others in a couple of
years as they are now just "followers". iPhone is right now way more
attractive to users and developers and this will increase a lot more
with iPhone OS 3.0.

I am more concerned about Android right now and I would LOVE to  
see a
roadmap that can show how Android will be able to compete with the
iPhone OS.

Saying that Apple is a "freak" in the mobile market shows that you
dont understand this market and stay in your mind with the old  
mobile world which is now scheduled to die.

Common Google, we really need to have a great response to this huge
threat and some roadmap elements.


I was reading live the Keynote, and It was like a joke. I will  
to all the audience my point of view.
First of all, Apple is out of the Mobile world. Why? There wasnt in
MWC09 at Barcelona, so Apple think that dont sell mobile. Apple sell
innovation and they know it.
Finally, I was reading and when It appear (cOPY & Paste) I was
seriously afraid. Why? Maybe Apple try to rename it like iCopy and
patent it, WOW danger ;P And what about Spotlight, WTH! Spotlight is
nothing more than a find engine... are you serious?
Apple is not a matter for the Mobile Market, Apple is the freak in  
Mobile Market.
But App Store and new SDK is the perfect machine to make MMORPG Like
second life, its the perfect business. Apple is doing great with the
App Store and SDK ;)

El 17/03/2009, a las 23:03, Pd escribi:

Just had the shock of my life!  For a minute there I thought I was
in an
Android forum! ... Silly me!  ;-)

So if you can all trot over to the iPhone forums and mention the G1
complete with the amazing Android OS that should make us just about
even  :-)

I remember when I worked with brew, from the beginning they had
subscription and use based model, uses was based on an api, so the
application decided what a use mean, for example for a ringtone app
meant a ringtone was downloaded, for a game each time you entered  
game, or each time you played and so on.. even
I remember my company could offer the same game either for $x each
month or something like 4$x to own it, customer choice

at the time they didn't have free apps though, don't know how the
market today

On Tue, Mar 17, 2009 at 10:57 PM, Stoyan Damov

 more here:

 I'm going to be one of the 1st to own it. Incredible smartphone.

 On Tue, Mar 17, 2009 at 9:20 PM, Al Sutton <


- In-application purchasing and subscription purchases
- Devs can embed Google Maps in their apps (Yes, this is on the


- Turn by Turn directions can be accessed by any app, but they

 can't use

the Google Map tiles for it.
- Data Push notification system as an alternative to background


- Peer to Peer connectivity using bluetooth without the need for


- Apps that can talk to custom hardware (e.g. A tuner for a FM

 Radio add-in)

- In-game voice
- Cut & Paste (they've played catchup on that one :)).
- Voice Memos
- Search that goes through contacts, emails, calendar appointments,
- Tethering support is supported but carriers control if it's




* Written an Android App? - List it at*

Funky Android Limited is registered in England & Wales with the
company number  6741909. The registered head office is Kemp House,
152-160 City Road, London,  EC1V 2NX, UK.

The views expressed in this email are those of the author and not
necessarily those of Funky Android Limited, it's associates, or it's


* Written an Android App? - List it at*

Funky Android Limited is registered in England & Wales with the
company number  6741909. The registered head office is Kemp House,
152-160 City Road, London,  EC1V 2NX, UK.

The views expressed- Hide quoted text -

- Show quoted text -...

read more 



3. Eclipse plugin vs. conversion to Dalvik

4. How To Keep ListView Header From Scrolling With ListView Content

5. Can't use/set Ringtone?

6. Using an SqliteDatabase from multiple threads

7. Full libstdc++ implementation