AS7: Auto Open Chrome Debugger

The Chrome Developer Tools are incredibly useful for debugging your app. If you’re working on an app, you almost always want to have them open to check for errors, examine variables, look at your controls and do many more things.

But if you want to use them on Windows, you have always had to hit F12 after the page loads to open the Developer Tools.

AppStudio 7 opens them for you automatically. There are two things that are needed for this to happen.

  1. You need to be on Windows.
  2. You can’t already have any windows open in your Chrome browser.

AS7: What’s new in Frameworks?

Frameworks are the collections of controls in AppStudio. Each is a major product in itself: AppStudio has definition files which make it easy to drag and drop the controls onto the Design Screen. Since each one is developed by a different group, they have important differences. This blog post should get you up to date on the status of each one.

AppStudio Controls

In the Toolbox, these 30 controls are mostly light purple in color. Headings include Common, Date and Time, MultiMedia and Finance & Social Media. They are developed and maintained by us.

There are no major changes in AppStudio 7. Where needed, they have been updated and modified for consistency with other controls.

These controls play well with the other Frameworks.

Bootstrap 3

Bootstrap 3 was introduced in AppStudio 6. Originally developed by Twitter, they have been spun off into their own development group. It’s one of the most popular frameworks on the web, used by millions of websites.

The 27 controls are clean, powerful and nice to work with. New development on Bootstrap 3 has stopped, but the controls are still being maintained by the group. There’s a strong community as well.

AppStudio 7 has a number of bug fixes and refinements to the controls, but no major changes. We will continue to maintain them.

Bootstrap 4

Bootstrap 4 was released just a few months ago by the same development group as Bootstrap 3. They cleaned up a lot of the Bootstrap 3 code and made many improvements. We expect it to be one of the most popular frameworks in the years to come.

Unfortunately, it’s not a simple upgrade. There are significant changes to all of the controls. AppStudio minimizes these differences: Bootstrap 4 works pretty much the same as Bootstrap 3, but there was a lot of work under the covers to make this happen.

You can’t use Bootstrap 3 and 4 in the same project: the CSS definitions conflict.

We recommend using Bootstrap 4 for new projects.

jQuery Mobile

Another year has gone by without a new version of jQuery Mobile. For those keeping count, the last update was in 2014. It’s developed by the jQuery Foundation.

It continues to work fine with modern browsers. We don’t see any reason to drop support for it or tell you to stop using it, but it’s probably not good to use for new projects. It does not support the current version of jQuery (!), which could cause problems.

We’ve only made minor changes to its 16 controls.

jQWidgets

The jQWidgets team continues to improve this massive set of powerful controls. They work well, look good and have any feature you can imagine.

In AppStudio 7, we’ve added some new ones to the list of 29 controls. The jQWidgets controls play well with others: you can use them in your projects along with controls from the other frameworks.

Reflecting the amount of work and scope of these controls, they are the only ones which cost extra – you’ll need a license from JQWidgets to use them in a commercial project.

AS7: Easily select nested controls

AppStudio makes it easy to nest controls inside of other controls. Want a group of Buttons to be inside a Container? Drag and drop them into the Container.

But if a control is buried deep inside several layers of Containers, it can be difficult to select in the Design Screen. AppStudio 7 makes it easy.

Right click at any point in the Design Screen, and AppStudio will display the hierarchy of controls at that point, so you can select the one you need.

In this example, the right click was done on top of the Button. The context menu shows that Label1, Container2 and Button1 are there. If you click on Button1 in the menu, it is selected.

AS7: New Multifile Project Format

In AppStudio 7, we introduced a new format for saving projects. The old format, using the .nsx file, tried to store as much as possible into one file: source code, forms, controls, properties and more. The resulting file was large, complex and had a number of limitations. Furthermore, it still didn’t hold everything. Images, code modules and other stuff were stored externally.

AppStudio 7 replaces the .nsx file with the much simpler .project file. It keeps only the high level information about the project. Code, forms, elements and properties are saved in separate folders. This has a few advantages.

  • Individual files can now be edited using your favorite editor. Your changes will appear next time you launch AppStudio.
  • Projects can be searched more effectively. Global searches can now easily locate strings in the project.
  • Version Control tools now work on AppStudio projects. Git, Mercurial, VSS and others can help you keep track of changes to projects. Many companies require the use of version control on all projects.
  • Multiple developers can work on the same project, since they are not all updating the same file at once.

One of the requirements of the new format is that each project have its own folder: only one project per folder. A folder holding an AppStudio project will end in .appstudio. For example, a project folder could be named Project1.appstudio. (AppStudio will automatically add the .appstudio when you save the project for the first time.)

Here’s an example. This is how a project directory looks for an AppStudio 6 project:

Here is the same project in AppStudio 7:

Some of the differences:

  • MyProject.nsx has been replaced by MyProject.project
  • The name of the folder has been changed from MyProject to MyProject.appstudio
  • The forms are now in the ‘forms’ folder.
  • The controls for Form1 are in the Element subfolder.
  • The code for Form1 is in Form1.bas. (It would be Form1.js for JavaScript).
  • Form1.json contains the properties of Form1.
  • The files in properties used to be in .nsx.

Have questions? Post them to our web board!

Receiving SMS messages into your app (Android)

You can now receive incoming SMS messages (text messages) on Android devices, using the sms-receive plugin.

It does not intercept them – the messages still go to the Messages app. It only works if your app is compiled under PhoneGap.

Your app doesn’t have to be in the foreground – it will received the messages so long as it has been started. The received message is available as variable in your app – so you can use it to update databases, inform the user or all kinds of things.

Full details are in this Tech Note:
https://wiki.nsbasic.com/Using_the_PhoneGap_API:_SMS-Receive

Using the Safari View Controller with PhoneGap

To be approved in the iTunes Store, Apple may require that your app open web pages inside your app, instead of opening Safari externally in another app window. It provides a better experience to the user.

When you open Safari in a new app window, it’s difficult to get back to your app. By using the Safari View Controller inside your app, switching to Safari is seamless – there is even a Done button to return to your app. Your users will thank you.

Title bar of a Safari View Controller. Note the Done button and the customized color.

There’s a handy PhoneGap plugin which makes this easy. Here’s how to use it:
Continue reading “Using the Safari View Controller with PhoneGap”

iOS 11: The top of the screen

iOS 11 brought a change to the way your app gets positioned on the screen. A reason for this is the new iPhone X, with its ‘notch’ at the top. However, this change affects all iOS devices, not just the iPhone X.

Apple introduced a new parameter for web pages called viewport-fit. iOS devices have a ‘Safe Area’, which is screen space the app can safely use. viewport-fit defines how your app uses the Safe Area. If set to contain (the default) your app will be confined to the Safe Area. If set to cover, it will use the entire screen.

In AppStudio 6.3.0.3 (released today), we have added a new viewportFit project property you can use for your app. It works together with the StatusBar property to define what is on top of the screen.

Let’s look at the various combinations:

StatusBar: black-transluscent viewportFit: contain

This is how many apps will look running iOS 11 with AppStudio before 6.3.0.3. Notice the empty space above the Header? It actually takes the color of your app’s background. The status bar info is there, but invisible since it is white on white.

StatusBar: black-transluscent viewportFit: cover

By changing viewportFit to cover, the app now fills the whole screen. But now the status bar info is showing IN our Header. If you want to use this combination, add 20 pixels on top of the Header for the status bar.

StatusBar: black viewportFit: contain

Making the status bar black means that your app gets positioned below it. No problems here!

StatusBar: black viewportFit: contain

If the status bar is black, it doesn’t seem to matter if you use cover or contain.

Accessing Volt from a PhoneGap app

A couple of days ago, one of our users asked a good question on our discussion board: Can Volt’s services be used from a PhoneGap app?

It sounds like a reasonable request. PhoneGap apps are compiled web apps which run as native apps. AppStudio is very good at making these. Volt is a collection of services, including features such as serverStorage, which lets users of your apps easily save or share data on a server.

It turns out it is easy to do and works nicely. You need to do two things:
1. In Project Properties, set the Volt Domain to the location of your app on Volt. For example,
storage-introduces-owlishly.volt.live.
2. In Project Properties, add the path of the Volt library to extraheaders. For example:
<script src='https://storage-introduces-owlishly.volt.live/api/client/volt.js'>

(Replace storage-introduces-owlishly with whatever your app’s domain name is. Custom domains will work fine too.)

Use your own Domain Name with your Volt App

You can now specify your own custom Domain Name for your Volt app. Your app can have a friendly URL such as

https://myapp.mycompany.com

instead of the name Volt assigns it. You’ll need a Volt membership to do this.

Notice the “https”? It even takes care of making sure there is a certificate in place, so your site is secure. The app is still served from the Volt server, so all the files and MIME types are in the right place.

Here’s how to set this up.
Continue reading “Use your own Domain Name with your Volt App”

Making your app fit: ScreenMode

We’ve had a few blog posts discussing how to use Responsive Web Design to make apps which look great on any screen size. But what if that is too much trouble or your app is already done? Are there any options?

AppStudio 6.2.3 brings a new feature to help with that. ScreenMode is a form property which sets how a form will display on the screen at runtime. It has four settings:

  • Full Screen
  • Actual Size
  • Center
  • Zoom

Continue reading “Making your app fit: ScreenMode”