HipByte / RubyMotionSamples

A collection of RubyMotion applications for code samples.
http://www.rubymotion.com
1.21k stars 341 forks source link

Add states example for android #47

Closed markrickert closed 10 years ago

markrickert commented 10 years ago

First contribution to android samples??? :P

GantMan commented 10 years ago

LUCKY!

lrz commented 10 years ago

Thanks for the contribution Mark! I think that we can improve the sample a little bit, it's a bit too simple right now. Maybe recognizing taps on items and showing a fragment? (maybe a webview with the wikipedia page for the selected US state loaded in it?)

markrickert commented 10 years ago

Thanks for all the comments! This is the second android ANYTHING I've ever done so it makes sense that it's simple :)

I'll beef it up a bit and push up the changes over the next few days.

markrickert commented 10 years ago

I've added your suggestion, @lrz. Clicking a state now opens a new intent and opens the wikipedia article for that state... well it WOULD, but I'm having an issue getting the stringExtra from the intent once it is launched. I'm getting the error:

#W/dalvikvm(29208): No implementation found for native Lcom/rubymotion/Module;.finalize:()V
markrickert commented 10 years ago

Oh, I also added permissions support to the android build system, but I don't think that's open source yet so let me know where I should put that code for you to integrate.

lrz commented 10 years ago

Great work Mark!

I can't reproduce the assert (the app seems to work fine here), but it's definitely not related to the new activity code. It looks like the runtime crashes when trying to finalize a module. I will try to isolate it.

In the meantime, I think the code is merge-able at this point! (And the class States does not need to inherit from Java::Lang::Object anymore as of beta 0.5).

lrz commented 10 years ago

@markrickert what version of Android did you use to reproduce the finalize-assert crash?

lrz commented 10 years ago

While trying the app with Internet access I found that the app wasn't working: the intent extra data wasn't properly set. This is due to a bug in the dispatcher (which I documented here: http://hipbyte.myjetbrains.com/youtrack/issue/RM-570). I just fixed it.

lrz commented 10 years ago

I merged the sample as of d2ab5baa45d002b543ade9612b1dc4e52fadd663

Sorry for not using the pull request thing, it's too difficult for me.

GantMan commented 10 years ago

@lrz just tell me next time :)

I'll merge for ya!

markrickert commented 10 years ago

It was targeting API level 18 and built to a Nexus 7 tablet.