Native Activity: Menus, Std. Android UI (ie. NOT opengl)

339 views
Skip to first unread message

Dougx

unread,
Feb 8, 2011, 9:45:41 AM2/8/11
to android-ndk
Hi,

My phone is still running 2.2, but I've been playing around with the
Native activity stuff from 2.3.

One thing I can't figure out though is how, if it's possible at all,
to interact with the standard android UI libraries using a C-only app.

To be completely clear, I'm absolutely not interested in using a pixel
buffer or opengl at this stage. I want to write a standard android
application using standard UI components like the TextView, etc. in an
xml layout file, and bind the event callbacks from those ui objects to
c or c++ implementation, using no java.

Is this possible?

If so, how?

thanks~

PS. please, I would appreciate no 'why don't you just use java'
replies. The reason is simple; you cannot have a single code base for
both an ios and android application if you use java. You can if it is
entirely done in c or c++ with a bunch of #ifdefs and some nice api
abstraction. :)

Mike Edenfield

unread,
Feb 8, 2011, 2:04:39 PM2/8/11
to andro...@googlegroups.com
On 2/8/2011 9:45 AM, Dougx wrote:
> Hi,
>
> My phone is still running 2.2, but I've been playing around with the
> Native activity stuff from 2.3.
>
> One thing I can't figure out though is how, if it's possible at all,
> to interact with the standard android UI libraries using a C-only app.

No, it's not possible (at least not with the current SDK/NDK). To get
access to the android Java UI libraries, you need Java. The only way to
have a completely native application UI is to use OpenGL.

Doug Schaefer

unread,
Feb 8, 2011, 3:39:10 PM2/8/11
to andro...@googlegroups.com

You could probably use the bitmap stuff too. What I'm waiting to see
is someone do or port a native widget set, something like Qt. Should
be possible.

The biggest problem though is that the adoption rate of 2.3 has been
painfully slow. Until you see more phones with it, native apps isn't
all that compelling. And we'll have to wait and see if Honeycomb has
it (did they branch before or after Gingerbread?). We'll all have to
get tablets, I guess :).

Tim Mensch

unread,
Feb 8, 2011, 6:20:18 PM2/8/11
to andro...@googlegroups.com
On 2/8/2011 1:39 PM, Doug Schaefer wrote:
> We'll all have to get tablets, I guess :).

Darn. That's just one of the occupational hazards of being a developer
on mobile operating systems. ;)

Tim

Dianne Hackborn

unread,
Feb 8, 2011, 8:10:00 PM2/8/11
to andro...@googlegroups.com
On Tue, Feb 8, 2011 at 12:39 PM, Doug Schaefer <cdt...@gmail.com> wrote:
The biggest problem though is that the adoption rate of 2.3 has been
painfully slow. Until you see more phones with it, native apps isn't
all that compelling. And we'll have to wait and see if Honeycomb has
it (did they branch before or after Gingerbread?). We'll all have to
get tablets, I guess :).

Every later version of the platform by definition is a superset of the previous one.  It would be super broken to drop something fundamental like this from the following platform version.

--
Dianne Hackborn
Android framework engineer
hac...@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.

Dougx

unread,
Feb 10, 2011, 8:04:34 PM2/10/11
to android-ndk
To be fair, there's considerable confusion at the moment about the
possibility of continued 3,XX and 2.XX branches that might never
merge...

I really hope what _exactly_ is happening on this front is made
explicitly clear at I/O, if not before.

~
Doug.

On Feb 9, 9:10 am, Dianne Hackborn <hack...@android.com> wrote:
> On Tue, Feb 8, 2011 at 12:39 PM, Doug Schaefer <cdtd...@gmail.com> wrote:
> > The biggest problem though is that the adoption rate of 2.3 has been
> > painfully slow. Until you
e more phones with it, native apps isn't
> > all that compelling. And we'll have to wait and see if Honeycomb has
> > it (did they branch before or after Gingerbread?). We'll all have to
> > get tablets, I guess :).
>
> Every later version of the platform by definition is a superset of the
> previous one.  It would be super broken to drop something fundamental like
> this from the following platform version.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com

Dianne Hackborn

unread,
Feb 11, 2011, 12:56:39 AM2/11/11
to andro...@googlegroups.com
There is a discussion on android-developers where I have been addressing this.

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




--
Dianne Hackborn
Android framework engineer
hac...@android.com
Reply all
Reply to author
Forward
0 new messages