Positioning Controls

Web design is constantly evolving. Each year, new features are introduced to HTML, CSS and JavaScript. New page design trends emerge along with new style guides. AppStudio 6 has a number of changes to bring AppStudio development up to date with current best practices.

Responsive Web Design allows your apps to change how they display depending on screen size. Most new web development is based on RWD. AppStudio 6 has enhancements to better use RWD.

The position property, in Form Properties, is key to this. Its setting determines how controls are positioned on a form.

There are three useful settings: absolute, static and relative. (fixed is included for completeness, but not currently used by AppStudio).

Let’s discuss the differences and advantages of each.

Continue reading “Positioning Controls”

AppStudio 6: Accessing Google Drive

searchGoogle Drive is a convenient way to store documents in the cloud and access them on any of your devices. It’s also an easy way to share documents. Millions of people use Google Drive – recent statistics show Google Docs to be as much as 5 times more popular than Microsoft Word.

The great news is that you can access the data in Google Drive from your AppStudio app. For example, you can read the data in a Google Sheet, modify it, and write it out again. This effectively turns the spreadsheet into a database for your app.

Volt makes this possible for everyone to use. To use Google Drive, your app needs to be deployed to a server. For security purposes, you have to give Google Drive the name of the server before it will authorize it to access your files. You can set up your own server for this or simply use Volt. After you deploy your app to Volt, enter the path which Volt gives you (something like “https://googlespreadsheet-signs-smoothly.volt.live”) and update the credentials.
Continue reading “AppStudio 6: Accessing Google Drive”

AppStudio 6: New Header control

AppStudio 6 brings a new Header control. It’s a Common control, which means it will work with all frameworks.

Header puts a simple header bar at the top of your app:

screen-shot-2016-10-26-at-11-40-29-am

You can customize the colors, font and size. It’s a simple useful control if used for just this.

What makes it special is that it can be used as a container for other controls. Add a couple of Buttons named Left and Right to a project with a Header. Now, drag them onto the Header:

screen-shot-2016-10-26-at-11-46-46-am

Now it looks like this:

screen-shot-2016-10-26-at-11-53-59-am

Change margin-all for both buttons to 3, and change the style of the Right button from float:left; to float:right;

Here is our final Header with buttons:

screen-shot-2016-10-26-at-11-56-24-am

Of course, controls other than buttons can be used to create interesting headers.

AppStudio 6: Updated Error Messages

In Version 6, we’ve changed a couple of error messages. One you saw too often, and the other you never saw at all. Both these changes will make you more productive.

New Version Warning

How many times have you seen this message when testing an AppStudio 5 app?

screen-shot-2016-10-24-at-3-50-46-pm

It warns you that you are about to overwrite the current version of your app. There isn’t any need to get this message every time your change your app when you’re developing. In AppStudio 6, there is a new setting in Project Properties called ‘newVersionWarning’. If set to false (the default!), this message will not show.

When your app goes into production, you might want your user to be warned if a new version is available, and give them the choice not to update. In that case, change ‘newVersionWarning’ to true and it will work just as it did in AppStudio 5.

Stop on Error

In AppStudio 5, the only way to find out if your app had a runtime error was to open the Chrome Debugger and look at the console. In AppStudio 6, errors are reported in a message box which appears over your app:

screen-shot-2016-10-24-at-3-57-28-pm

It will tell you the filename of the error (code.js), the line number and even the position in the line.

This catches most runtime errors. It doesn’t catch syntax errors, where the code is not properly formed. You’ll still need to use the Chrome Debugger for that. With this feature, I’ve found errors in code which I thought was working properly – it’s very handy.

You can turn off this feature in Project Properties by setting ‘stopOnError’ to False.

AppStudio 6: code.js and other code files

AppStudio 6 features an improved way of writing out your files when they are deployed.

Earlier versions of AppStudio tried to minimize the number of output files. The idea was that it would be quicker to load one large file than a number of smaller files which added up to the same size. This made debugging harder, since all the parts of your app were merged together.

Modern browsers do a great job of caching. Any file you have loaded recently (and maybe not so recently) is saved in the browser’s internal memory, so apps can load more quickly. A great example is jquery.js: since almost every web page uses it, it hardly ever needs to loaded. If your app uses caching (it’s on by default), all your files are automatically cached. That takes away the speed advantage of one large file.

An AppStudio app has two parts: the code which AppStudio generates, with all the forms and other boilerplate; and your own code (whether it is written in JavaScript, or BASIC converted to JavaScript.)

In AppStudio 6, the generated HTML, CSS and boilerplate code all go into index.html. All your code goes into code.js. External code files are put into .js files of their own.

screen-shot-2016-10-19-at-1-48-51-pm

It makes your app much easier to debug. When an error comes up, you’ll see just your actual code. You won’t have to dig through screenfuls of HTML, CSS and other stuff you didn’t write.

Chances are, your app will reload faster too.

PhoneGap: Don’t overwrite the iOS Status Bar

If you’ve created a PhoneGap version of your project, the top of your screen might look like this on iOS:
Screen Shot 2016-04-26 at 11.36.57 AM

See how the title of the screen (“Volt”) is crowded into the status bar?

It’s easy to fix this. Add the following lines into configxml in Project Properties (PhoneGap section):

<plugin name="cordova-plugin-statusbar" source="npm" />
  <preference name="StatusBarOverlaysWebView" value="false" />
  <preference name="StatusBarBackgroundColor" value="#000000" />
  <preference name="StatusBarStyle" value="lightcontent" />

Your app will now look like this:
Screen Shot 2016-04-26 at 11.36.37 AM

With the StatusBar plugin installed, you have a bunch of additional options for managing the status bar. See the full documentation here.

Android Web Apps: SplashScreens and Icons

Due to changes in Android OS, this post is deprecated starting with AppStudio 6.

Splash screen support for Android Home screen apps was added in Chrome 47, released in December 2015. It gives your web apps a look much more like a native app at startup.

There are a few new items in Project Properties for this. They are grouped together under the ‘WebApp Chrome’ heading.
Continue reading “Android Web Apps: SplashScreens and Icons”

PhoneGap Build News: Google, Icons and Splashscreens

Breaking news – PhoneGap has just announced that PhoneGap 6.0.0 is now being used by PhoneGap Build. Here’s the announcement:

http://phonegap.com/blog/2016/02/09/phonegap_6_now_on_build/

it’s still too new for us to say what difference it will make.

To use it with AppStudio, put ‘cli-6.0.0’ into PhoneGap Version in Project Properties.

Today, a roundup of news having to do with PhoneGap Build and AppStudio. As usual, let us know if you figure out solutions (or find more problems).

Google Play Store

Users with apps compiled with PhoneGap Build are getting this message from Google:
Continue reading “PhoneGap Build News: Google, Icons and Splashscreens”