Discussion Forums  >  WebViews and HTML for Mobile

Replies: 9    Views: 273

feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
12/19/13 10:26 AM (10 years ago)

html android 3.0 help please!

Hello Hey I finally hit a wall ive been at this all week and now im reaching out. I integrated this calendar into ios and it works great! now im trying to do the same for android and i just cant get it to find the css or js files. I tried custome url, html doc, html pro, smugswebview, I tried referencing the css and js from a url. I dont know what im doing wrong. I need to get this done asap and will even pay for help. I referenced each file using file:///android_asset/BT_Docs/ Here is three different versions i tried https://buzztouchmods.com/hosted/feracom/files/applications/EA7F85E8A77DAC631AFEACB03/documents/selectable.html https://buzztouchmods.com/hosted/feracom/files/applications/EA7F85E8A77DAC631AFEACB03/documents/selectablee.html https://buzztouchmods.com/hosted/feracom/files/applications/EA7F85E8A77DAC631AFEACB03/documents/selectableee.html
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/19/13 01:23 PM (10 years ago)
I had a similar problem, which I managed to overcome https://www.buzztouch.com/forum/thread.php?tid=A8C7597D6C8B158B37DEA6D&sortColumn=FT.id&sortUpDown=DESC&currentPage=1 html pro was the best as i wanted the css and javascript in the build. The trick for android is to put everything into bt_docs, including the images. Do not reference as file://, just use the directory or file names. Works for me, always.
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
12/19/13 02:58 PM (10 years ago)
I have a different HTML pro doc the references the JavaScript using file:///android_asset/BT_Docs/ and it works fine. Should I just Refrence the document like this android_asset/BT_Docs/?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/19/13 03:59 PM (10 years ago)
I make all the references relative, not absolute. I'm nowhere near a mac right now, but tomorrow I can post an example if you like. Alan
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
12/19/13 04:04 PM (10 years ago)
Ok thanks
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/20/13 04:44 AM (10 years ago)
OK, so here ar a couple of lines taken form an html file linked using the HTML Pro screen in my android app. In my example I am using a bit of javascript and some css. All the files are in BT_DOCS. I also added my viewport line as it is always useful. In the head part of my html file, the lines read like this :- <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=1;"> <link rel="stylesheet" type="text/css" href="message_default_css.css"> <script type="text/javascript" src='message.js'></script> This is a good starting point and if you organise your code this way, it will work. If you start to move code into subfolders, android has some rules I have not completely fathomed, but it may work too, you'll need to experiment. Alan
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
12/20/13 06:45 AM (10 years ago)
Still no good I tried it with all links like this DOCTYPE html <html> <head> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=1;"> <link rel="stylesheet" type="text/css"href='https://sites.google.com/a/frederickferaco.com/docs/home/geometryfc/fullcalendar.css' /> <link rel="stylesheet" type="text/css" href='https://sites.google.com/a/frederickferaco.com/docs/home/geometryfc/fullcalendar.print.css' media='print' /> <script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script> <script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js'></script> <script src='https://sites.google.com/a/frederickferaco.com/docs/home/geometryfc/fullcalendar.min.js'></script> <script> Then i tried it your way like this DOCTYPE html <html> <head> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=1;"> <link rel="stylesheet" type="text/css" "href='fullcalendar.css' /> <link rel="stylesheet" type="text/css" href='fullcalendar.print.css' media='print' /> <script type="text/javascript" src='jquery.min.js'></script> <script type="text/javascript" src='jquery-ui.min.js'></script> <script type="text/javascript" src='fullcalendar.min.js'></script> <script> Still no luck on the device or emulator for android 3.0.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/20/13 07:15 AM (10 years ago)
I suggest you put the html file and the rest into a folder on your PC and run it from there. If it works there, it should work in the project.
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
12/20/13 07:20 AM (10 years ago)
it works on the pc but not in the project
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
12/20/13 12:21 PM (10 years ago)
I'm stumped.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.