Make Your Own Charts Menu Background Primer Tutorial
โœ‚๐Ÿƒ๐Ÿพโ€โ™€๏ธ๐Ÿƒ๐Ÿผโ€โ™‚๏ธ
๐Ÿ“–

Make Your Own Charts Menu Background Primer Tutorial

Make Your Own Charts Menu Background Primer Tutorial

Whatโ€™s the most approachable way to brighten up a web application? What about โ€ฆ

  • background โ€ฆ
    • image
    • colour
    • linear gradient colour
  • fonts
  • borders
  • colours โ€ฆ
    • background
    • text colour
    • border colour

โ€ฆ as some of a list approachable for non-graphic artist types? Add โ€œmediaโ€ if you have some confidence in the graphic art and/or content editor arena.

Today, we brighten something up using the first of those in the list above โ€ฆ background image โ€ฆ and we do it for a mobile application. What the โ€ฆ yes, mobile application can be equivalent to web application via the use in mobile application IDEs of what they use as a WebView โ€ฆ and all the IDEs, pretty much, support some form of a WebView. So what is a WebView? Basically a mobile application mini web browser, but please read here regarding Android (using Eclipse or Android Studio IDEs) and iOS (using Xcode IDE).

A [ui]WebView can mean your mobile application accessing a web application via that [ui]WebView โ€œportalโ€ can stay compiled as it is, but can change aesthetically, or logically, by changing that underlying web application. So, today, weโ€™re aesthetically changing a mobile application by changing a web applicationโ€™s CSS background image styling, all being presented on the mobile application via a [ui]WebView. Cute, huh?!

Door opens to sand encrusted salesmanperson with smudged lipstick. Oh! Graphically challenged one? How art though going to get around the elephant in the room.

Thought you were supposed to be selling Avon?!

Yes, thatโ€™s true, but my sideline is mobile and web application gratuitous advice.

Very well then, you can try to squeeze in and Iโ€™ll explain, but with the elephant in the room, maybe you can โ€ฆ squeeeeeze โ€ฆ thatโ€™s right โ€ฆ sorry about the window streaks โ€ฆ if you could just โ€ฆ

Babar! Please wait outside.

Ugh! Ouch โ€ฆ my foooooottt!*?@! Trumpet sounds in background. Okay, thanks for your contributions, Babar. The other Iโ€™ll clean up later. But, back to the point โ€ฆ we intend to ask Uncle Google for help.

Uncle Google?! Who, pray tell, is Uncle Google? Wiping off crusted on sand.

By any chance, have you had your head in the sand way past its use by date? Am sure itโ€™s a long story โ€ฆ cup of tea, perhaps?!

Okay, over time weโ€™ve found several picture grouping techniques, when you think of a โ€œkaleidoscopicโ€ feeling thing you want to achieve, each of the ones below, for Mac OS X then being fed into the talents of the screen capture Applications -> Utilities Grab desktop application โ€ฆ

  • Search Engine image search โ€ฆ and we tend to call on โ€œUncle Googleโ€ here
  • Email, for us via Gmail (in its web browser web page incarnation) attachments
  • Mac OS X Finder (and Windows Explorer can do too) image views
  • Mac OS X Preview โ€œslidesโ€ ready for PDF perhaps, and often assembled via Mac OS X Finder (multiple selections)
  • Mac OS X PhotoBooth โ€œslidesโ€

โ€ฆ gathered into a screen shot, with the appropriate amount of desktop application zoom level applied, and then, in Mac OS X we use Grab (and in Windows, we just use PrntScrn button) to capture an image of that โ€œgrouped togetherโ€ โ€œkaleidoscopicโ€ feeling snapshot.

Our web application=mobile application (via [UI]WebView) background image for todayโ€™s work comes from the first of those thoughts, via this link, actually โ€ฆ good old โ€œUncle Googleโ€ โ€ฆ thanks.

Once the image โ€ฆ

Background image original

โ€ฆ passed through Gimp for a Filter -> Artistic -> Apply Canvasโ€ฆDepth=7 and 62% opacity โ€ฆ to become โ€ฆ

Background image

โ€ฆ is up at the web server, applying it involved Javascript DOM logic like โ€ฆ



parent.document.body.style.backgroundImage="url('//www.rjmprogramming.com.au/PHP/justmenuWebView.jpg')";

โ€ฆ to establish that image as the webpageโ€™s background image โ€ฆ and, in the case of the โ€œMake Your Own Chartsโ€ (via Google Charts) iOS mobile application (suitable for iPad) menu purposes, we didnโ€™t want the menu to be too overpowered by the kaleidoscopic feeling background image, and so, for that menuโ€™s background, we introduced โ€ฆ



[HTMLmenuElementOfInterest].style.backgroundColor='cyan';

โ€ฆ to let it stand out more. The advantage here, is that changing a web application is a lot less involved than changing a mobile application, in our experience.

To get this into context, and/or to read more about the history of the making of โ€œMake Your Own Chartsโ€ iOS mobile application, for iPad, please see Xcode Swift iOS Application End Game Follow Up Tutorial as shown below.



Previous relevant Xcode Swift iOS Application End Game Follow Up Tutorial is shown below.

Xcode Swift iOS Application End Game Primer Tutorial

Xcode Swift iOS Application End Game Follow Up Tutorial

Lots of us hope to learn something new each day?! Overnight, was expecting the โ€œMake Your Own Chartsโ€ iOS mobile application to go through to the Apple App Store for sale, and it didnโ€™t, so, having read an email saying that it can take up to 24 hours sometimes, it occurs to me that itโ€™s just like with exams really when people say โ€œread the questionโ€, sometimes you should โ€œreread the emailโ€. Where the email says โ€ฆ โ€œIf your contracts are not in effect at this time, your app status will be Pending Contract.โ€ โ€ฆ looking back at โ€œMyAppsโ€ in iTunes Connect, that scenario of the email was indeed the case, and could have saved myself some time by thinking clearer the day before when, later in the email, I figured what was in play was the statement โ€ฆ โ€œIt can take up to 24 hours before your app is available on the App Store.โ€

Even though with this app, that is not free, Iโ€™d defined banking information earlier, there is another step, which Iโ€™d been wondering about in the back of my mind about how that is linked directly to any single app, and this is done by establishing a โ€œContractโ€ with Apple to allow them to negotiate the payment at the App Store, as you see with the โ€œAgreements, Tax, and Bankingโ€ link in the email. This is our first app to reach this stage (available for iPad users on the Apple App Store โ€ฆ search for โ€œMake Your Own Chartsโ€) and think maybe this same โ€œContractโ€ applies to sales of apps at the App Store from then on โ€ฆ looks a bit like it. Anyway, as I say, you (hopefully) learn something, every day โ€ฆ yayyyyyyyyyyy!!!!!!!

And so โ€ฆ cue the lyrics โ€ฆ optionally queue the background music โ€ฆ queue the karaoke machine โ€ฆ our iOS app โ€œquestโ€ reaches a new phase โ€ฆ the maintenance of the app โ€ฆ the โ€œend gameโ€ swings round to possibilities of the โ€œstart gameโ€ (perhaps) and โ€œmiddle gameโ€ (definitely) cycle again โ€ฆ hopefully โ€ฆ with feedback. This is all part of what used to be (more often than now) called SDLC โ€ฆ feels a bit like natureโ€™s water cycle that you may or may not have learnt about at school.

Pardon me while I think back to Wish me luck โ€ฆ 1 of ?) iOS Hello World on iPhone 5 simulator โ€ฆ from all that time ago. The โ€œquestโ€ has given many days of learning โ€ฆ and learning is great (as is the encouragement of the readers or supporters of this blog (thanks), all the advice from all those users of blogs and forums out there of the I.T. community (thanks), the search engines (thanks), the big I.T. companies running the โ€œmobile showsโ€ (iOS and Android) (thanks) โ€ฆ ?!) โ€ฆ doesnโ€™t matter what that learning consists of, it nourishes the soul.

So to see that iOS mobile app โ€œend gameโ€ follow up tutorial watch this โ€ฆ and hope to see you next time.


Previous relevant is shown below.

Xcode Swift iOS Application End Game Primer Tutorial

Xcode Swift iOS Application End Game Primer Tutorial

The iOS app โ€œquestโ€ continuing on from yesterdayโ€™s โ€œmiddle gameโ€ Xcode Swift Resizable UIWebview Primer Tutorial as shown below enters the โ€œend gameโ€ today, on a MacBook Pro laptop, using the Xcode IDE (plus the ubiquitous white USB lead and that cute thing at its end, an iPad) โ€ฆ yay!!!!!!!

There is a lot to the โ€œend gameโ€ of an iOS mobile app, and there is a lot to consider after todayโ€™s โ€œfirst shotโ€ at our โ€œMake Your Own Chartsโ€ mobile application weโ€™ve been overviewing lately at this blog, but today we get you into the loop, in that you ask the question about whether your app can go public at the Apple Store.

Letโ€™s break it down into some of its major steps, several of which are only possible if you join up with Apple officially as an iOS Developer on the Apple iOS Developer Program (which weโ€™d see as part of the โ€œstart gameโ€) โ€ฆ

  • be in the Xcode project
  • check Swift code is as you want it to be for a Release version
  • in the Project settings General tab make sure you have a โ€œTeamโ€ that is an Apple iOS Development team (you may already have this set)
  • in the Project settings General tab in the โ€œDeployment infoโ€ section weโ€™ve decided this mobile app is best to be only available for an iPad, so specify this now (if not already set that way) โ€ฆ obviously, this stringency is local to this iOS mobile app
  • in Product->Scheme->Edit Schemeโ€ฆ select Archive
  • connect your iPad real device to MacBook Pro via the white USB lead โ€ฆ where you see the iPad (connected) in iTunes (and this is where, later, you can eject the iPad, as well)
  • in Product->Destination-> โ€ฆ select that real iPad
  • go Product->Run (to check icons work and app works, on the iPad โ€ฆ again)
  • if all okay go Product->Stop as necessary then Product->Archive
  • in Window->Organizer โ€œArchivesโ€ tab there should now be an entry for โ€œMake Your Own Chartsโ€
  • Validate it, Submit it (to Apple) to create an iTunes Connect record for this new proposed iOS (iPad) mobile app, to be sellable through the Apple Store
  • while you are there also Export it for safe keeping somewhere on the MacBook Pro hard disk
  • log in to iTunes Connect at https://itunesconnect.apple.com iTunes Connect and sign in with your Developer Apple ID
  • click the โ€œMy Appsโ€ button
  • click the new โ€œMake Your Own Chartsโ€ button โ€ฆ woah! โ€ฆ
  • check, in the Build section at the โ€œ+โ€ link, that your bundled build is recognized โ€ฆ though it is hard to believe youโ€™d be here, if not
  • the rest is about the filling in of the form from here down โ€ฆ there are some quite difficult bits and below we discuss, in particular, the App Video Preview required (if you had more than โ€œiPadโ€ it would be โ€œPreviewsโ€ โ€ฆ for that very same reason, we only have to worry about the iPad tab in this section, and not with all those other such and such (inches) tabs for other mobile device types โ€ฆ again, this simplicity is local (thinking) to our particular app, today โ€ฆ the research for the tutorial today went down a lot of โ€œgarden pathsโ€ regarding this (thanks for writing everyone), and looked up a lot of worthy websites which were helpful in trying to help here, but the most brilliant link of all, that worked for me, was this brilliant link โ€ฆ whose ideas will be talked about below (and tomorrow with AirServer on Mac Primer Tutorial) โ€ฆ
    1. install (the brilliantissimo) AirServer โ€ฆ thanks
    2. capture video via AirServer called IGCag55.mov AirServer on Mac Primer Tutorial โ€ฆ video needs to be 15 to 30 seconds long
    3. at Mac Terminal application with Linux Bash session (because we did a portrait iPad ((AirServer) video) run) โ€ฆ
      ffmpeg -i IGCag55.mov -strict -2 -vf scale=900:1200 igc5ag.mp4
    4. be in Safari (web browser) as you follow the advice of 3 โ€“ How to upload on Safari? section 3
    5. then drop igc5ag.mp4 into the App Video Preview drop zone (OMG! โ€ฆ how many hours was that?!)
  • in this same area make sure there is at least one properly sized screenshot โ€ฆ as with video, tend to โ€œsuck and seeโ€ to get dimension ideas โ€ฆ or you can consult this Apple link (for a more scientific approach) โ€ฆ thanks
  • also get a 1024ร—1024 pixel general application image together for one of the fields
  • as you go, probably in a piecemeal fashion, it is wise to hit the โ€œSaveโ€ button a lot, but when the form is all filled out to satisfaction, click โ€œSubmit for Reviewโ€ button
  • now you wait to see how the Apple review of your app proceeds โ€ฆ

โ€ฆ so there you go โ€ฆ quite a lot to take in โ€ฆ and hope it gives you some good information that you are looking for, today.


Previous relevant Xcode Swift Resizable UIWebview Primer Tutorial is shown below.

Xcode Swift Resizable UIWebview Primer Tutorial

Xcode Swift Resizable UIWebview Primer Tutorial

Today we continue on our iOS app โ€œquestโ€ (from Xcode Swift Image Assets Primer Tutorial as shown below) โ€ฆ and address a โ€œmiddle gameโ€ topic when we consider a usability issue with the UIWebView we use โ€ฆ or to be exact, the PHP/HTML/Javascript innards of this UIWebView (though in practice it looks like the UIWebView itself). The usability matter at hand is the ability many users like to be able to resize their applications using the two finger zoom and pinch gestures โ€ฆ to not be able to resize feels kind of claustrophobic and restrictive.

So how is the resizing of an iOS mobile app using a UIWebView achieved? You can probably do things in the Xcode Swift application code, but we choose to make the change in the PHP/HTML/Javascript by the configuration of a <head></head> viewport meta tag, which we first talked about here at this blog with jQuery Mobile Primer Tutorial, and if you zoom down to Google Charts Emailing Primer Tutorial as shown way below, the code difference links will show some of these. We visited every bit of code to make sure that โ€ฆ



<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=0.5, maximum-scale=4, user-scalable=yes" />

โ€ฆ became the go, after a bit of experimentation and personal preference coming into play. You may want to read more about meta viewport tags regarding mobile platforms here.

Hopefully you can imagine that such usability is very advantageous for your mobile platform users.


Previous relevant Xcode Swift Image Assets Primer Tutorial is shown below.

Xcode Swift Image Assets Primer Tutorial

Xcode Swift Image Assets Primer Tutorial

Today we continue on our โ€œquestโ€ โ€ฆ and have to admit to you here โ€ฆ it really is a โ€œquestโ€ to get a mobile app accepted by the Apple Store โ€ฆ today we are in an area you might consider part of what, we, here, refer to as the mobile app development โ€œmiddle gameโ€ or perhaps you put the consideration of all your launch application icons and marketing images as part of your โ€œend gameโ€. Your decision probably hinges on the nature of the app and also how you like to work. For me, it feels like part of the โ€œend gameโ€ but โ€ฆ and thereโ€™s always a โ€œbutโ€ isnโ€™t there โ€ฆ as much as youโ€™d like to get on with it, and give that โ€œquestโ€ another shot โ€ฆ you always forget how long this part takes โ€ฆ because, even if you have a previous Xcode project you can use to arrange all the image sizes and such, it is an eye opener to see, if you havenโ€™t built an app for a while, the number of new device formats youโ€™ve missed out on in the meantime, that you then have to cater for.

My thinking on our โ€œMake Your Own Chartsโ€ app is that, for Apple Store, weโ€™ll only say that it is suitable for iPad usage, but canโ€™t see that this lessens the size of this job โ€ฆ but please donโ€™t get the idea that that means you canโ€™t find a way to lessen the task.

So, if you are a graphic artist, am sure all this is a doddle โ€ฆ sadly, we are lacking that graphic artist expertise โ€ฆ but even so, you can use tools you have and add a dose of patience โ€ฆ my advice, for what its worth is to, roughly โ€ฆ

  • make one image about 1024ร—768 that you find apt
  • make one image about 200ร—200 that you find apt
  • in Xcode double click Images.xcassets folder and you see all the formats of images needing attention for various ihone and iPad sizes and configurations
  • you can import images from another Xcode project (Objective-C or Swift) you have from the past and use the click subfolder->Import from Projectโ€ฆ as a way to get over some images with sizes you can work with
  • think drag and drop into place for the rest โ€ฆ and how do you get the โ€œdragโ€ bit โ€ฆ either
    1. get it via image editor like Paintbrush (or Gimp) with one of those first two image ideas, respectively regarding big and small requirements โ€ฆ resizing there as necessary
    2. click an image as with a right click->Open in External Editor (which is preview here) and have a buffer ready to Paste in from some other means (like step 1.) and move it around to be in a correct position
  • youโ€™ll probably reach points when you wonder โ€ฆ โ€œam I there yet?โ€ โ€ฆ try a Run to see and pick up on the error messages (which youโ€™ll probably get initially) as a way to keep moving forward on your โ€œquestโ€

So, today, have a look at work here for the โ€œMake Your Own Chartsโ€ app in our โ€œmiddle gameโ€ / โ€œend gameโ€ discussion ahead of pure โ€œend gameโ€ ideas when we try to get the app onto the Apple Store, for another day. The previous โ€œmiddle gameโ€ flow towards where we are here came from Xcode Swift UIWebView Back and Forward Button Tutorial as shown below. Hope this helps in some way, and good luck yourselves, if you are doing this yourself.


Previous relevant Xcode Swift UIWebView Back and Forward Button Tutorial is shown below.

Xcode Swift UIWebView Back and Forward Button Tutorial

Xcode Swift UIWebView Back and Forward Button Tutorial

Meanwhile โ€ฆ after sporadic days of testing โ€ฆ back in mobile development โ€œlandโ€ โ€ฆ and any maritime mobile development โ€œseaโ€ members (perhaps in the bath) โ€ฆ weโ€™ve got to admit defeat on our Google Charts mobile app as far as minimal designing goes trying to do away with (UI)WebView โ€œBackโ€ and โ€œForwardโ€ buttons. We do need them, and the main reason is that opening the app to the Pandoraโ€™s Box of many Google Chart functionalities in the one app is not very good without the possibility of getting technical advice from Google themselves โ€ฆ so, today, we bite the bullet โ€ฆ boysenberry, today โ€ฆ and put them in โ€ฆ so this is an opportunity to show you in Swift how to dynamically add in โ€œBackโ€ and โ€œForwardโ€ buttons that interact with your UIWebView (we are doing an iOS mobile app in Xcode today).

Now supposing youโ€™re here and you havenโ€™t already been in the loop from a few days ago with Google Charts Mobile WebView Menu Tutorial as shown below โ€ฆ well, welcome โ€ฆ dew do drop inn in โ€ฆ chortle, chortle โ€ฆ whatโ€™s the deal with a (UI)WebView on its lonesome โ€ฆ

Well, it is to do with navigating outside the โ€œrealmsโ€ of your mobile applicationโ€™s WebView innards page in both a backward and forward sense. In other words you can not worry at all if all of the pages possible to navigate to, can eventually have navigation that would lead you back to that original webpage of the WebView, but if you go outside that, the WebView (without its โ€œback buttonโ€ and โ€œforward buttonโ€) will lose touch with the original webpage without some complete resetting of the mobile application. If this explanation baffles, you may prefer to think of the concept of a mobile WebView as being like a web browser which is not capable of having multiple tabs nor new multiple windows. So to make the system work write โ€œsmallโ€ for the matter at hand. This shouldnโ€™t be too hard to do if your mobile application has a small defined task, or aim.

So what of the changes โ€ฆ what do they involve? This change, that is, to allow these Google Chart web applications to access help from Google โ€ฆ and be able to find their way home to WebView โ€œlandโ€ โ€ฆ

At the mobile IDE (eg. Xcode) for iOS code end of integration, the two main Swift programming source code files of interest are โ€ฆ

Lesson 7896293: You have to have patients patience to be in mobile development โ€œlandโ€ โ€ฆ and/or โ€œseaโ€ โ€ฆ or, for a proportional response โ€ฆ โ€œseaโ€ vs โ€œlandโ€

Lesson 7896295: (just went down to the kitchen and learnt something about red chillies) You sometimes have to compromise (indeed perhaps bite boysenberry or raspberry bullets) to be in mobile development areas of interest

Trap for young players 789629500: A UIButton in version iOS 8.1 is white โ€ฆ hopefully for you, it will be โ€œall white on the nightโ€ โ€ฆ chortle, chortle.


Previous relevant Google Charts Mobile WebView Menu Tutorial is shown below.

Google Charts Mobile WebView Menu Tutorial

Google Charts Mobile WebView Menu Tutorial

We left you yesterday โ€œpopping offโ€ to create a mobile app, but having an initial โ€œpopโ€ (after we โ€œsnarpโ€ and โ€œcackleโ€ โ€ฆ darn those ornery consonants), we realized there was another bit of suitable functionality โ€ฆ that is, to make a menu of other Google Chart applications, and allow you to swap from one to another.

So yesterdayโ€™s Google Charts Emailing Mobile WebView Tutorial as shown below gets built upon today, for this.

So what of the changes โ€ฆ what do they involve? This change, that is, to allow these Google Chart web application codes to be used as the innards to a mobile application using a WebView (both no โ€œback buttonโ€ nor โ€œforward buttonโ€), only involves changes to that last tutorialโ€™s Javascript and to add one new PHP generic piece of code and change yesterdayโ€™s PHP code as per โ€ฆ

  • gchartgenโšซjs is the changed Javascript programming source code as per changes
  • butselโšซphp is the new PHP programming source code that builds a menu of Google Chart relevant applications, as buttons for mobile devices and as a select dropdown for other platforms
  • webviewemailโšซphp is the changed PHP programming source code as per changes

Bits of the logic used PHP to try to detect a WebView scenario and would recommend a Google search here.

At the mobile IDE (eg. Xcode) for iOS code end of integration, the two main Swift programming source code files of interest are โ€ฆ

Thanks for dropping by at todayโ€™s tutorial. The menu effect can be shown with a web application live run for a Pie Chart link today, if you want to peruse. Will be popping off again now to test lots more. Bye for now.


Previous relevant Google Charts Emailing Mobile WebView Tutorial is shown below.

Google Charts Emailing Mobile WebView Tutorial

Google Charts Emailing Mobile WebView Tutorial

Hope if you are a regular reader of this blog that you are getting the hang of the idea of โ€ฆ

  1. surfing the net with a web browser on a mobile device
  2. using the net on a mobile device via a mobile application that is using a WebView (Android or iOS)

โ€ฆ can have quite differing considerations regarding any HTML or PHP (or ASP.Net) code you write if your mobile application does away with โ€œback buttonsโ€ or โ€œforward buttonsโ€. Of course, the IDE you may use to set up your mobile application WebView may make it so easy it is like โ€œfalling off a logโ€ to implement the โ€œback buttonโ€ and โ€œforward buttonโ€ functionalities into your mobile application. Or, if you think this way (and there are many who donโ€™t), you can write HTML and PHP to accomodate for a mobile application world using WebViews, but not relying on the use of โ€œback buttonsโ€ nor โ€œforward buttonsโ€.

So what is the nature of the issue differences?

Well, it is to do with navigating outside the โ€œrealmsโ€ of your mobile applicationโ€™s WebView innards page in both a backward and forward sense. In other words you can not worry at all if all of the pages possible to navigate to, can eventually have navigation that would lead you back to that original webpage of the WebView, but if you go outside that, the WebView (without its โ€œback buttonโ€ and โ€œforward buttonโ€) will lose touch with the original webpage without some complete resetting of the mobile application. If this explanation baffles, you may prefer to think of the concept of a mobile WebView as being like a web browser which is not capable of having multiple tabs nor new multiple windows. So to make the system work write โ€œsmallโ€ for the matter at hand. This shouldnโ€™t be too hard to do if your mobile application has a small defined task, or aim.

So, do you remember when we made quite a few changes to all our Google Charts web applications to allow for some email functionality, when we showed the Google Charts Emailing Primer Tutorial as shown below? Well, those changes work fine for desktop and laptop web surfing of the net, and work for the mobile usage case 1 as above as well. It is just with case 2 (with no โ€œback buttonsโ€ nor โ€œforward buttonsโ€, and using a WebView method to access the net) that the new (snapshot Google Chart (link)) email functionality that was designed for an HTML a tag mailto: href value (client-side method, that relies on an email client program), would be a case of spilling outside the โ€œrealmโ€ of the innards of any WebView that mobile application might use to do this job.

So what of the changes โ€ฆ what do they involve? This change, that is, to allow these Google Chart web application codes to be used as the innards to a mobile application using a WebView (both no โ€œback buttonโ€ nor โ€œforward buttonโ€), only involves changes to that last tutorialโ€™s Javascript and to add one new PHP generic piece of code as per โ€ฆ

  • gchartgenโšซjs is the changed Javascript programming source code as per changes
  • webviewemailโšซphp is the new PHP programming source code that uses a PHP mail method of emailing when using a mobile applicationโ€™s WebView

At the mobile IDE (eg. Xcode) for iOS code end of integration, the two main Swift programming source code files of interest are โ€ฆ

Ideally it would be good in Javascript to be able to differentiate in a generic way the difference in usage of case 1 versus case 2 as shown above, but this is not straightforward, as you can see here, for instance. So, without that neat solution, probably the next best approach is to, within your mobile application code where you define the URL for the WebView you set up a GET parameter to indicate that extra information that the accessor of the HTML and/or PHP (or ASP.Net), is a WebView in a mobile application. In ViewController.swift above, where this happens, the URL used has โ€œ?WebView=WebViewโ€ added to the normal URL to flag to the the (UI)WebView innards that a WebView supervises it โ€ฆ by the way, as weโ€™ve seen before, the innards, in Javascript, or PHP, would be very capable of working out that they are working for a mobile (device) platform. For instance, in Javascript, use a test like โ€ฆ


if (navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)) {

// it is a mobile device

}

โ€ฆ great thanks to this link for this advice and idea, and donโ€™t forget that it can be done with PHP too (and no doubt ASP.Net).

Guess this falls under a cross-platform issue, but that term does not encompass the idea, for me, that you can have a cross-platform issue for the same mobile device using the same underlying code โ€ฆ maybe we need the term cross-environment, or cross-caller.

Pardon us while we pop off and start on being able to produce the equivalent of a โ€œlive runโ€ link for you โ€ฆ ie. a mobile application โ€ฆ chortle, chortle. Hope you enjoy todayโ€™s tutorial.


Previous relevant Google Charts Emailing Primer Tutorial is shown below.

Google Charts Emailing Primer Tutorial

Google Charts Emailing Primer Tutorial

The Google Charts (derived) webpages here at this rjmprogramming.com.au WordPress blog have all changed to add functionality for emailing snapshots of the Google Charts โ€œmidstreamโ€. You can see a table of tutorials, and corresponding PHP code (with the last row being our one new bit of Javascript code) affected below โ€ฆ

File Relative Path Blog Search Link Email Functionality Code Difference Link
wordtree_chartโšซphpโ€“GETME PHP/Wordtree/ wordtree_chartโšซphpโ€“GETME wordtree_chartphpโ€“GETME
treemap_chartโšซphp-GETME PHP/TreemapChart/ treemap_chartโšซphp-GETME treemap_chartphp-GETME
timeline_chartโšซphp-GETME PHP/TimelineChart/ timeline_chartโšซphp-GETME timeline_chartphp-GETME
sparklineโšซphp-GETME PHP/Sparkline/ sparklineโšซphp-GETME sparklinephp-GETME
scatter_chart_diffphpโ€“GETME PHP/ScatterChart/ scatter_chart_diffโšซphpโ€“GETME scatter_chart_diffphpโ€“GETME
scatter_chartโšซphp-GETME PHP/ScatterChart/ scatter_chartโšซphp-GETME scatter_chartphp-GETME
sankey_diagramโšซphp-GETME PHP/SankeyDiagram/ sankey_diagramโšซphp-GETME sankey_diagramphp-GETME
column_chartโšซphp-GETME PHP/ColumnChart/ column_chartโšซphp-GETME column_chartphp-GETME
pie_chartโšซphpโ€“GETME PHP/PieChart/ pie_chartโšซphpโ€“GETME pie_chartphpโ€“GETME
pie_chart_diffphp-GETME PHP/PieChart/ pie_chart_diffphp-GETME pie_chart_diffphp-GETME
parabola_lgraphโšซphp-GETME PHP/ParabolaLineGraph/ parabola_lgraphโšซphp-GETME parabola_lgraphphp-GETME
Google_OrgChartโšซphp-GETME PHP/OrgChart/ Google_OrgChartโšซphp-GETME Google_OrgChartphp-GETME
motion_chartโšซphp-GETME PHP/MotionChart/ motion_chartโšซphp-GETME motion_chartphp-GETME
line_chartโšซphp-GETME PHP/LineChart/ line_chartโšซphp-GETME line_chartphp-GETME
linear_trendlineโšซphp-GETME PHP/LinearTrendline/ linear_trendlineโšซphp-GETME linear_trendlinephp-GETME
intervalsโšซphp-GETME PHP/IntervalsChart/ intervalsโšซphp-GETME intervalsphp-GETME
annotatedtimeline_chartโšซphp-GETME PHP/AnnotatedTimelineChart/ annotatedtimeline_chartโšซphp-GETME annotatedtimeline_chartphp-GETME
intensity_chartโšซphp-GETME PHP/IntensityChart/ intensity_chartโšซphp-GETME intensity_chartphp-GETME
histogram_chartโšซphp-GETME PHP/HistogramChart/ histogram_chartโšซphp-GETME histogram_chartphp-GETME
geo_chartโšซphp-GETME PHP/GeoChart/ geo_chartโšซphp-GETME geo_chartphp-GETME
gauge_chartโšซphp-GETME PHP/GaugeChart/ gauge_chartโšซphp-GETME gauge_chartphp-GETME
column_chartโšซphpโ€“GETME PHP/ColumnChart/ column_chartโšซphpโ€“GETME column_chartphpโ€“GETME
column_chart_diffphp-GETME PHP/ColumnChart/ column_chart_diffphp-GETME column_chart_diffphp-GETME
chart_wrapperโšซphp-GETME PHP/ChartWrapper/ chart_wrapperโšซphp-GETME chart_wrapperphp-GETME
candlestick_chartโšซphp-GETME PHP/CandlestickChart/ candlestick_chartโšซphp-GETME candlestick_chartphp-GETME
calendar_chartโšซphp-GETME PHP/CalendarChart/ calendar_chartโšซphp-GETME calendar_chartphp-GETME
bubble_chartโšซphp-GETME PHP/BubbleChart/ bubble_chartโšซphp-GETME bubble_chartphp-GETME
bar_chartโšซphpโ€“GETME PHP/BarChart/ bar_chartโšซphpโ€“GETME bar_chartphpโ€“GETME
bar_chart_diffphp-GETME PHP/BarChart/ bar_chart_diffphp-GETME bar_chart_diffphp-GETME
area_chartโšซphp-GETME PHP/AreaChart/ area_chartโšซphp-GETME area_chartphp-GETME
mapโšซphp-GETME PHP/Map/ mapโšซphp-GETME mapphp-GETME
gchartgenโšซjs_GETME gchartgen.js_GETME

Letโ€™s now discuss some tactics that can work to be a bit objective about the task of making these changes in a methodical and systematic way.

  • If possible, have the change amount to the adjustment of one line of code โ€ฆ so we looked at one bit of Javascript called gchartgenโšซjs called by each Google Chart application via โ€ฆ <script type="text/javascript" src="//www.rjmprogramming.com.au/gchartgen.js"></script> โ€ฆ the one (extra) line of code ( that is placed between <head> and </head> )
  • So where can gchartgen.js intervene to do its thing (which is to add an Email link down the bottom and allow HTML h1โ€™s be clickable to Email, as well (quite often))? โ€ฆ onload functionality proved to be too crowded, and as this functionality is not mission-critical it is decided that it can be created with setTimeout(gcinit, 2000); โ€ฆ ie. roughly 2 seconds after onload event
  • Unit test this on one Google Chart scenario on local (MAMP) web server
  • When happy bring all Google Charts code over to local (MAMP) web server
  • Make a file of *GETME files via Linux command something like find . -name โ€˜*GETMEโ€™ 2> /dev/null > gclist.xxx
  • Manually filter out the entries that are not โ€œrelevant latestโ€ from this list using vi (for instance) adjusting each relevant latest to go up one (eg. _GETME goes to -GETME or -GETME goes to โ€“GETME)
  • Write a Korn shell script whose main lines of functionality look like
    #!/bin/ksh

    for f in `cat gclist.xxx`; do

    pf=`echo $f | sed '/-GETME/s///g' | sed '/_GETME/s///g'`

    nf=`echo $f | sed '/-GETME/s//--GETME/g' | sed '/_GETME/s//-GETME/g'`

    cat $f | sed '/<head>/s//<head> <script type="text/javascript" src="//www.rjmprogramming.com.au/gchartgen.js"></script>/g' > $nf

    cat $pf | sed '/<head>/s//<head> <script type="text/javascript" src="//www.rjmprogramming.com.au/gchartgen.js"></script>/g' > ${pf}_new

    cat ${pf}_new > $pf

    rm ${pf}_new

    done

    exit
  • Run this Korn Shell on the local (MAMP) web server (Linux) environment (on Mac, is Terminal applicationโ€™s Bash environment)
  • Now for each Google Chart application โ€ฆ
    1. test it works on local (MAMP) web server
    2. upload it to live rjmprogramming.com.au place
    3. retest on live rjmprogramming.com.au place
  • To get the table above constructed we, roughly โ€ฆ
    1. updated this blogโ€™s All Posts table โ€ฆ why? pourquoi? โ€ฆ the All Posts functionality has a lot in common to what we want, in a table, here โ€ฆ good to find linkages and commonalities with software
    2. went to the All Posts โ€œcode download tableโ€ and sorted for latest changed source code up the top
    3. start up Firefox web browserโ€™s Firebug add on โ€ฆ why? pourquoi? โ€ฆ we want to get in under any Javascript client side (in this case, sorting) rearrangements (which View->Page Source is not good enough to show) .. so we can use a dynamic Javascript DOM tool like Firebug effectively (and strategically) here
    4. point at the table and use the Copy HTML option to paste the buffer over to a TextWrangler (text editor) session and create a standalone piece of HTML (with only the top โ€œtodayโ€ parts of the buffer) on the local (MAMP) web server, where it is unit tested on a local web browser ( eg. //localhost:8888/sometest.html ) over and over again until it works, in preparation for copying this into the live rjmprogramming.com.au WordPress blog post (ie. what you are reading here)
    5. check that it still looks okay, or not, in the scenario of being in the blog post

Here is a link to Google Chart Tools โ€œspiritual homeโ€ โ€ฆ via Google.

Hope you try out some of the newly tweaked Google Charts functionality.

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, GIMP, iOS, Tutorials and tagged , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *