Monday – 3rd July 2017. First things first.I need to get the environment built. I have a Cordova installation on my Mac from TM352 so I will be using that. I have used Cordova to build a 470Router project. I have also signed up for a “Projects in Phonegap” course which is a video course that shows how to build apps using lots of available add-ons. (PhoneGap is now Cordova).
My first task is to lay out my thoughts of the pages on paper before getting tied up in the code. Getting some good progress on the log in page. I have now arranged a backup of the code on Dropbox.
Tuesday – 4th July 2017. Spent today playing around with text entry boxes. I just wanted to have, say, “User Name” aligned alongside the entry box on the same line. Nope, I couldn’t do it without an understanding of jQuery that is way beyond me. I went back to mu Udemy course and found out how to use a nice text box that has the prompt built in. Next step is to use the button to access the user info via REST. That is for Thursday (I have Wednesdays off when working to a normal timetable).
Saturday – 8th July 2017. Another struggle. This time with:
“No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘null’ is therefore not allowed access.”
It seems that Google Chrome won’t allow access out of the localhost if the page has come from a local file. I spent about an hour trying to sort this out – trying different browsers -executing code in the terminal that was supposed to launch Chrome without this restriction. Finally, I found an extension to Chrome which has sorted the problem. Yet again, web sites like Stackoverflow.com were worse than useless because, although they were (supposedly) explaining and giving solutions, these answers were opaque at the best of times and generally so full of jargon as to be unusable, certainly for the likes of me.
Anyway, I got it sorted and now I can extract the menu page from the web server within the Android app. I only need this to a) confirm the user name and b) to extract the user’s railroad name and the railroad logo url. Doing this is the task for tomorrow. Once that is done, I can construct a menu that will give access to all of the data (minimal views) and to process trains.