hanchang / friar

Friar Framework helps you make beautiful Android 2.2+ apps out of HTML5 content. Inspired by the Baker Framework for iOS.
http://www.friarframework.com
75 stars 19 forks source link

problems with eclipse #7

Closed moushik closed 12 years ago

moushik commented 12 years ago

Hi,

newbie question here: I loaded the project in eclipse, connected my samsung phone and hit the run button: I get three error messages:

1) the project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object 2)The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files 3) Unable to resolve target 'android-8'

...any advice will be really appreciated.

Thanks

hanchang commented 12 years ago

You'll want to learn a bit more about Eclipse - sounds like you haven't specified a Java Runtime for Eclipse which is why it can't compile.

StackOverflow will be your friend: http://www.stackoverflow.com. You can also Google your error messages to find fixes.

Unfortunately I don't have time to walk you through the fundamentals but luckily this stuff is documented all over the web. However, if you encounter a Friar specific problem I can definitely help.

Best of luck, don't be discouraged, it will take a little effort at first but once you get started it'll become easier and easier (and hopefully more fun as well)! Happy hacking!

On Fri, Jun 8, 2012 at 10:53 PM, Marco < reply@reply.github.com

wrote:

Hi,

newbie question here: I loaded the project in eclipse, connected my samsung phone and hit the run button: I get three error messages:

1) the project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object 2)The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files 3) Unable to resolve target 'android-8'

...any advice will be really appreciated.

Thanks


Reply to this email directly or view it on GitHub: https://github.com/hanchang/friar/issues/7

moushik commented 12 years ago

hanchang,

I've made it!

I'm not an eclipse guy, (it's not my business) but after some experiment, I can see the book on my cell phone. For this demo I used the Laker Compendium, only to test funcionality for the Android platform.

The swipe between pages works, but it seems all the javascript behavior is lost: no image galleries, no audio, and even double tapping for the menu doesn't work.

I used the same book folder (with all img, html, js, etc...) that worked with baker on my iPad...

Unfortunately, I don't own an android tablet, and I'm only able to test on my smartphone.

Off topic: from the home page "http://www.friarframework.com", when you click on "tutorials" you are redirected to baker site, instead of "http://www.friarframework.com/tutorials/" (which I've found after googling for help...)

bye!

hanchang commented 12 years ago

Glad to hear it Marco!

The reason the JavaScript behavior is missing is because Android's WebView disables JavaScript by default. You can Google how to enable JavaScript for Android WebViews; after making the change everything should just work. That's a good point though, I should probably document that somewhere... I made the poor assumption that anybody using Friar would be a seasoned Android developer.

Thanks for the heads up about the link - the reason the "Tutorial" link points to the Baker website is that the book creation process is identical and they've done a great job on explaining how to package up your book into the HPub format which is exactly what Friar uses. In fact, the Baker guys wanted to make sure that Friar used HPub as well which is awesome, this way any user who prepared a book for Baker can just drop it into Friar and vice versa.

Hope that makes sense and congrats on your technical persistence!

On Sat, Jun 9, 2012 at 2:37 PM, Marco < reply@reply.github.com

wrote:

hanchang,

I've made it!

I'm not an eclipse guy, (it's not my business) but after some experiment, I can see the book on my cell phone. For this demo I used the Laker Compendium, only to test funcionality for the Android platform.

The swipe between pages works, but it seems all the javascript behavior is lost: no image galleries, no audio, and even double tapping for the menu doesn't work.

I used the same book folder (with all img, html, js, etc...) that worked with baker on my iPad...

Unfortunately, I don't own an android tablet, and I'm only able to test on my smartphone.

Off topic: from the home page "http://www.friarframework.com", when you click on "tutorials" you are redirected to baker site, instead of " http://www.friarframework.com/tutorials/" (which I've found after googling for help...)

bye!


Reply to this email directly or view it on GitHub: https://github.com/hanchang/friar/issues/7#issuecomment-6217510

moushik commented 12 years ago

Hey Han!

just found the line of code for enabling js (if you're not familiar with eclipse/android, please open FriarBook.java inside the "src" folder. You should find "webView.getSettings().setJavaScriptEnabled(false);" - just set it to "true.").

Well, the app now loads js, but some strange things happen:

What should I do? Are there others "obscure" settings in eclipse?

I love Baker and I think your effort in "translating" the code for Android is a great work.

But if you're not an android dev, well, it's not that easy...

When I think about a digital publication the first thing for me is interactivity: audio, video, js libraries, and so on...nobody wants to see static layouts (there's print for that...). With Baker all of this is possible. The question is: can Friar do the same?

If yes, could you explain how?

Thanks again!

Marco

hanchang commented 12 years ago

Hi Marco, sorry it took awhile to respond, got a bit busy recently but now have some free time to look into this issue.

The issue with the Laker Compendium in Friar Framework is that it uses a custom client side include library: http://www.massimocorner.com/libraries/csi/

However, Android doesn't seem to support any client side includes: http://stackoverflow.com/questions/9003402/jquery-and-phonegap-include-a-html-file-clientside-with-html-or-js

This is not a standard way of making web pages so I am not surprised it does not work in Android's WebView due to its strict security settings. See point number three in the list below, this is the method that the CSI library in Laker Compendium tries to use, and which Android rejects. http://en.wikipedia.org/wiki/Server_Side_Includes#Client_Side_Includes

The standardized method to accomplish the same thing would be through something like an iframe, which is the first option listed in the link above. If you really need to get Laker working, I can recommend that you refactor the code from using the CSI library into using iframes.

Otherwise, you can just develop your own HTML5 book without using Laker as a starting point.

Hope that helps!

On Sat, Jun 9, 2012 at 10:01 PM, Marco < reply@reply.github.com

wrote:

Hey Han!

just found the line of code for enabling js (if you're not familiar with eclipse/android, please open FriarBook.java inside the "src" folder. You should find "webView.getSettings().setJavaScriptEnabled(false);" - just set it to "true.").

Well, the apps now loads js, but some strange things happen:

  • if you are on page 1 (I'm refferring to the sample "Laker Compendium") there's an image gallery. When you swipe between images, the event is overwritten by the standard page turn event. As a result, you're redirected to the next page.
  • on page 2 the button for playing music doesn't work.
  • double tapping for the index page just doesn't work.

What should I do? Are there others "obscure" settings in eclipse?

I love Baker and it think your effort in "translating" the code for Android is a great work.

But if you're not an android dev, well, it's not that easy...

When I think about a digital publication the first thing for me is interactivity: audio, video, js libraries, and so on...nobody wants to see static layouts (there's print for that...). With Baker all of this is possible. The question is: can Friar do the same?

If yes, could you explain how?

Thanks again!

Marco


Reply to this email directly or view it on GitHub: https://github.com/hanchang/friar/issues/7#issuecomment-6219998

moushik commented 12 years ago

Han,

thank you very much for your reply. I wasn't aware of the issue about clients include, so I really appreciate your help.

If there's a quick fix for the (lost) js functionality (besides the "FriarBook.java" setting mentioned above), please let me know.

bye!

bahmet commented 12 years ago

hi , i have the same problem on the slideshow script. in my case it works on the simulator (4..0.3) slideshow works fine and does not swipe to the next page. however when i create the apk package and load it to Samsung Galaxy (2.3) it does not work as expected. also it works on the simulator ver2.3 device

bahmet commented 12 years ago

@moushik did you solve slideshow script problem. can you pls advice how? thanks...

moushik commented 12 years ago

Hi bahmet, sorry, but I wasn't able to solve the issue. Maybe some eclipse/friar expert could help us?

bye