require 'rss' # no need for open-uri$subjects = []rss = RSS::Parser.parse(url, false)rss.items.each do |item|subject = item.title.to_s$subjects << subjectend$subjects.each{ |s| puts s }
Flamenco in ChinatownHow to do flamenco tango llamada or callPractice for flamenco tango footworkFlamenco/Middle Eatern FusionStorytelling: Stage FreightSlow Flamenco Tango - Guitar OnlyPracticing hand clapping for flamenco tangoStorytelling: How I learned to appreciate artHow to do flamenco tango llamada or call -Part 1
require 'ruboto/widget'require 'ruboto/util/toast'require 'rss'ruboto_import_widgets :Button, :LinearLayout, :TextView, :ListView$subjects = []## Collect list of items from RSS xml# ----------------------------------rss = RSS::Parser.parse(url)rss.items.each do |item|subject = item.title.to_s$subjects << subjectend## Display list of items# ---------------------class Rss0Activitydef onCreate(bundle)superset_title 'Download rss topics'self.content_view =linear_layout :orientation => :vertical do@list_view = list_view :list => []endenddef onResumesuper@list_view.adapter.add_all $subjectsendend
I have a simulator running. I do 'rake install start', and the app sometimes works, but most of the time fails, and I can't figure out what is happening. I have a rake log available for anyone interested, but I certainly don't have enough knowledge to make sense out of it.
I spent a lot of time on this, and the most frustrating is that I have seen this script work, and the list of topics displayed on the simulator, and just when I thought everything was fine, it stops working.
I will be grateful for any help.
Jen
I have a rake log available for anyone interested
W/dalvikvm( 1830): VFY: unable to resolve exception class 1129 (Ljavax/management/InstanceAlreadyExistsException;)W/dalvikvm( 1830): VFY: unable to find exception handler at addr 0xdW/dalvikvm( 1830): VFY: rejected Lorg/jruby/management/BeanManagerImpl;.register (Ljava/lang/String;Ljava/lang/Object;)VW/dalvikvm( 1830): VFY: rejecting opcode 0x0d at 0x000dW/dalvikvm( 1830): VFY: rejected Lorg/jruby/management/BeanManagerImpl;.register (Ljava/lang/String;Ljava/lang/Object;)VW/dalvikvm( 1830): Verifier rejected class Lorg/jruby/management/BeanManagerImpl;
require 'ruboto/util/stack'with_large_stack{require 'rss'}
I think need to feed the parse call the RSS XML instead of a URI to avoid this.
I wont be able to test this for awhile...headed into a busy time.
ENV['TMPDIR'] = <<context>>.files_dir.to_sSolved the problem.We should consider handling this in ruboto/base.rb (if we have access to the context) since Android isn't going to give the app access to /tmp.
--
You received this message because you are subscribed to the Google Groups "Ruboto (JRuby on Android)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruboto+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks Uwe, I'd love to try master, where do I get it?
Hi jen,
Your email landed in the spam folder, maybe that's why you don't get answers.
The 10 KB size limit seems weird. It is way too small to get low memory errors, so the problem must be something else.
Did you try to wrap your code into a begin-rescue block to catch exceptions? Do you find anything in the logs if you search for "error" or "exception"?
Cheers,
Andras
20140616 143443.372223 W/dalvikvm( 4356): VFY: unable to resolve exception class 1080 (Ljavax/management/InstanceAlreadyExistsException;)20140616 143443.372223 W/dalvikvm( 4356): VFY: unable to find exception handler at addr 0xd
20140616 143455.975944 E/dalvikvm( 4356): Could not find class 'sun.misc.Signal', referenced from method jnr.posix.JavaPOSIX.signal
20140616 143455.987945 W/dalvikvm( 4356): threadid=10: thread exiting with uncaught exception (group=0xb3de5908)20140616 143455.987945 E/AndroidRuntime( 4356): FATAL EXCEPTION: ScriptLoader for Java::OrgRubotoExampleRss_0::Rss0Activity20140616 143455.987945 E/AndroidRuntime( 4356): org.jruby.embed.EvalFailedException: (ENOENT) No such file or directory - No such file or directory - /tmp
20140616 143455.989945 E/AndroidRuntime( 4356): Caused by: org.jruby.exceptions.RaiseException: (ENOENT) No such file or directory - No such file or directory - /tmp
20140616 143258.054200 W/dalvikvm( 4282): VFY: unable to resolve exception class 1080 (Ljavax/management/InstanceAlreadyExistsException;)20140616 143258.054200 W/dalvikvm( 4282): VFY: unable to find exception handler at addr 0xd
Hi jen,
I think the root of the problem is described in this line:
>> 20140616 143455.989945 E/AndroidRuntime( 4356): Caused by: org.jruby.exceptions.RaiseException: (ENOENT) No such file or directory - No such file or directory - /tmp
Maybe it tries to download the RSS into a temporary file but there is no /tmp folder. Try to configure the TEMP folder in Ruboto. As far as I remember there was a recent discussion about how to do it on this mailing list.
Regards,
Andras
Hi Andras, indeed, it looks like there is still a /tmp folder issue. This had been spotted by Scott at the beginning, and a fix had been proposed by donV in:I believe I am using the last version of Ruboto that incorporates that fix (I cloned it from GitHub yesterday), but apparently the issue is still there. In addition, I am not clear why there is a /tmp issue with files > 10KB, and not with smaller files !@donV, did you have a chance to take another look at this?
Exception: value <Mon, 20 August 2011 22:32:57 +0100> of tag <lastBuildDate> is not available.
/data/app/org.ruboto.test_app-2.apk!/jruby.home/lib/ruby/1.9/rss/0.9.rb:107:in `lastBuildDate='
/data/app/org.ruboto.test_app-2.apk!/jruby.home/lib/ruby/1.9/rss/parser.rb:456:in `start_get_text_element'
org/jruby/RubyProc.java:271:in `call'
/data/app/org.ruboto.test_app-2.apk!/jruby.home/lib/ruby/1.9/rss/parser.rb:358:in `tag_end'
/data/app/org.ruboto.test_app-2.apk!/jruby.home/lib/ruby/1.9/rexml/parsers/streamparser.rb:26:in `parse'
/data/app/org.ruboto.test_app-2.apk!/jruby.home/lib/ruby/1.9/rexml/document.rb:205:in `parse_stream'
/data/app/org.ruboto.test_app-2.apk!/jruby.home/lib/ruby/1.9/rss/rexmlparser.rb:22:in `_parse'
/data/app/org.ruboto.test_app-2.apk!/jruby.home/lib/ruby/1.9/rss/parser.rb:164:in `parse'
/data/app/org.ruboto.test_app-2.apk!/jruby.home/lib/ruby/1.9/rss/parser.rb:79:in `parse'
Luckily, I get the same error running the same code in Ruby 2.1.2 IRB :) so I think it is correct to get the error :)
@jen, could you give me an example of code that works for you in IRB?