Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 17    Views: 80

KRima
Apple Fan
Profile
Posts: 154
Reg: Jan 27, 2013
Sydney
1,940
03/17/13 04:02 AM (12 years ago)

Using HTML plugin

I'll start by saying i have no idea how to code but i have recently started tutorials online for free with http://www.w3schools.com/ and im learning how to code using HTML but im not sure where to write the code. This is going to sound so dumb but i opened notepad or textedit on the Mac and wrote out my code. I saved the fil as a HTML file and used the HTML plugin and loaded the file i created in there. When i run it on my simulator it says something like "Data for this screen has not been download. Please check your internet connection." I know i have done something very wrong and it seems like i need a compiler to compile the code and then maybe load the file in? I found something on the internet called Komodo am i supposed to be using this? Thanks in advanced.
 
jvalley
Aspiring developer
Profile
Posts: 456
Reg: Feb 16, 2013
Green Bay,Wi
9,360
like
03/17/13 04:53 AM (12 years ago)
The pages on the HTML plug in through the simulator take time to download.. I get the message all the time .. When pushed to a actual device it works fine
 
KRima
Apple Fan
Profile
Posts: 154
Reg: Jan 27, 2013
Sydney
1,940
like
03/17/13 04:58 AM (12 years ago)
I put my code in Komodo and loaded the file into HTML plugin and it worked. Its very small though. All i did is add some text to see if it worked and it did but it loads before opening. Will this also happen on a device? Is there a better way?
 
jvalley
Aspiring developer
Profile
Posts: 456
Reg: Feb 16, 2013
Green Bay,Wi
9,360
like
03/17/13 05:48 AM (12 years ago)
I believe the device downloads everything upon the use download .. The simulator works different.. Maybe wrong though
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
03/17/13 06:17 AM (12 years ago)
Hi @KRima, You using the html or the custom html plugin? In the custom html plugin, you can just put your code in the editor. LA
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
03/17/13 09:03 AM (12 years ago)
@KRima, You're on the right path anyway, w3schools is an excellent resource, I refer to it regularly for the latest best practices. You'll be building html web pages in no time.
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
03/17/13 09:12 AM (12 years ago)
Hey @raveyd, Check our mail on here please. LA
 
KRima
Apple Fan
Profile
Posts: 154
Reg: Jan 27, 2013
Sydney
1,940
like
03/17/13 03:32 PM (12 years ago)
So do you think i should be using the custom html/text. I tried that one but it didnt quite work out like i hoped. Maybe i should give it another go. I have a question about code in html. The W3schools start the code with <!DOCTYPE html> but the program i downloaded called Komodo starts with <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" > I have no idea what they means. If i ask Komodo to start a new file using a html template it starts with this. When i use the one from w3schools it doesnt work and sometimes the komodo one doesnt work. Im not sure what i am doing is even correct. Ill explain what i want to do. On my App, i want to have a screen that shows text. I do not want to add that text in via a word or pdf document. I just want to write up what i want on the screen. I assumed html does this for me. It reads in the code and i write in the body what i need to write and it spits the answer on the app page. Am i overlooking something or is there another plugin that i should be using?
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
03/17/13 05:48 PM (12 years ago)
That starting line is a declaration of the document type - The w3schools one you posted above is for html5 which is basically what apps use. You could use something like this for your app: <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>title</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> </head> <body> <p>stick your text in paragraph tags, between the body tags to make paragraph breaks</p> Use the break tag to start a new line <br> Or use 2 break tags to replicate a paragraph break<br><br> Although br tags aren't a nice approach, they're quick and easy. </body> </html> I've no idea what komodo is, it's not needed to make a basic webpage for an app - notepad will do the job. When you've saved your notepad file as 'whatever.html' just double click it and it'll open in your web browser. Make changes to your file, save them, refresh your browser and you'll see the changes.
 
KRima
Apple Fan
Profile
Posts: 154
Reg: Jan 27, 2013
Sydney
1,940
like
03/17/13 06:23 PM (12 years ago)
You information is appreciated and valuable. Just a few questions about it if thats OK (sorry my coding is 1 day old). In the <head> section, what do i need to change? Im assuming the <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> will remain the same with no change? The <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> section i think needs me to insert the device width? Or do i leave it as is and just change the <body> section?
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
03/18/13 05:51 AM (12 years ago)
Hi @KRima, no problem :) No changes need to be made. The stuff in the meta tags in the <head> is just some instructions to show the webpage and its contents correctly in a mobile web view. That's a very basic example that's adequate for an app. If you were building a mobile website, or a regular website, there would be more information there. Just add the content you want to show on the page between the <body></body> tags.
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
03/18/13 05:56 AM (12 years ago)
Awesome advice @raveyd! I believe when I tried to put the width in mine, the html page wouldn't scale to mobile. LA
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
03/18/13 06:26 AM (12 years ago)
@LA, I've just seen your second pm! Charge more!
 
LA
Aspiring developer
Profile
Posts: 3280
Reg: Aug 16, 2012
Jerseyville, IL
42,900
like
03/18/13 06:27 AM (12 years ago)
Thank you @raveyd! LA
 
KRima
Apple Fan
Profile
Posts: 154
Reg: Jan 27, 2013
Sydney
1,940
like
03/18/13 09:41 PM (12 years ago)
@raveyd. I will try this and let you know how i go. Thanks heaps.
 
Paul Rogers
Android Fan
Profile
Posts: 2524
Reg: May 30, 2011
UK
35,740
like
03/19/13 04:51 AM (12 years ago)
No problem @KRima, let us know how you get on.
 
KRima
Apple Fan
Profile
Posts: 154
Reg: Jan 27, 2013
Sydney
1,940
like
03/21/13 06:43 PM (12 years ago)
@raveyd. I tried the code you sent and it worked perfectly. Thanks really appreciate it.
 
jvalley
Aspiring developer
Profile
Posts: 456
Reg: Feb 16, 2013
Green Bay,Wi
9,360
like
03/21/13 06:54 PM (12 years ago)
I started another post on this but used this..-it has a table in it- and it seemed to work great with android ..I got it from another post on bt... <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes"> <meta name="apple-mobile-web-app-capable" content="yes"> <title></title> </head> <body> <img style="width: 92px; height: 101px;" alt="SPF" src="spf13.png"><br> <br> Test Test <table style="text-align: left; width: 100%;" border="0" cellpadding="2" cellspacing="2"> <tbody> <tr> <td>Test </td> <td>tset</td> </tr> </tbody> </table> <br> </body> </html>
 

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.