Use Dropbox to quickly install .apk files

Want a quick way to get an App Studio app compiled with PhoneGap onto your Android device? Use Dropbox!

  1. Build your app using PhoneGap as always.
  2. Put the resulting .apk file into your DropBox. (Get an account if you don’t already have one – it’s free!)
  3. Install the Dropbox app on your Android device if you have not done so already.
  4. Open Dropbox on the device and click on your .apk file. It will install!

(If you have not used Dropbox yet, it’s a great tool. It puts what looks like an ordinary folder on your PC or Mac desktop. You can share it with other users and computers: add a file to your Dropbox and your other computers can use it right away. There’s lots more, but this already is the simplest network share you have ever experienced. Installation is also very simple.)

A change to PhoneGap Splash Screens

PhoneGap have just made a breaking change to their Build process. The result is that splash screens no longer appear on Android devices. Luckily, the fix is easy.

In your Project Properties, open the configxml property. You’ll need to change this line:

<gap:splash src="{splashscreen}" gap:role="default" width="320" height="460"/>

to this

<gap:splash src="{splashscreen}"/>

The next build will make this the default for all new projects. However, you will need to modify on existing projects.

More info here:
https://build.phonegap.com/blog/enhanced-icon-and-splash-support

Ajax Made Simple Part 8: Zip Code Lookup

Ever realize, when getting a user’s address, that knowing the zip code makes asking for the city and state unnecessary?

Here’s some simple code to look up the city and state from a zip code:

zip="90210"

req=Ajax("http://zip.elevenbasetwo.com?zip=" & zip)
If req.status=200 Then 'success
    MsgBox req.responseText
  Else 'failure
    MsgBox "Error: " & req.err.message
End If

The result is

{"country": "US", "state": "CA", "city": "BEVERLY HILLS"}

NS Basic/App Studio 2.1.0.2 released!

We have just uploaded 2.1.0.2 to the servers. It has a number of minor enhancements as well as bug fixes.

Download URL is the same as for 2.1.

  1. Code Window: Add Math object.
  2. Code Window: Improve AutoComplete parsing.
  3. Controls: ComboBox Classic: removeItem function added. (Thanks, Norman Peelman!)
  4. Controls: jQM List can now have variable width.
  5. Controls: jQM RadioButton fixed with update to jQuery Mobile.
  6. Controls: jQM Select has new multiple selection property.
  7. Controls: jQM Select: selected* functions return arrays for multiple selections.
  8. Controls: PictureBox background now fills entire control.
  9. Deploy: Fix problem with browser warning and iPad splashscreen.
  10. Deploy: Script and Link entries generated from _requiredFiles
  11. Design Screen: Clicking on a blank area of the form now selects the form instead of nothing.
  12. Framework: jQueryMobile updated to 1.1.0 RC2
  13. IDE: .keyCode is now a keyword.
  14. IDE: Clicking from Design Screen to Project Explorer selected wrong item.
  15. IDE: Fix crash on resize.
  16. IDE: Fix problem saving minimized dimensions on exit.
  17. IDE: Changing framework does not leave Design Screen blank.
  18. Installer: Fix shortcut to Readme.htm.
  19. Translator: Fix $(“#T_A”).A({selectedItem:2})

Using JavaScript in your App

AppStudio lets you code using VB style BASIC or JavaScript. You can even mix the languages in one project: they share the same name spaces, so variables and functions can be freely interchanged.

Why use JavaScript? BASIC is easy and in nearly all cases, all you need to do anything in AppStudio. However, if you already know JavaScript, it works just as well. Plus, there is a huge base of JavaScript code available on the internet. Even if you would rather program in BASIC, you can incorporate this code into your app.

Let’s discuss some of the ways to include JavaScript code into a project.

Continue reading “Using JavaScript in your App”

Sending SMS messages from App Studio

Guest post from Scott Page

Here are screenshots of an app that I made using NSBasic to send out SMS Text alerts to our staff. Most of our employees do not like to carry both pagers and cell phones and prefer to receive messages via SMS on their phones. Our CAD (Computer Aided Dispatch) system does not provide for this functionality. My first attempt was to create email groups with the cell phone number and the carrier (5415551212@vtext.com). This worked but had its own set of problems. Some people would get messages before others and there could be a great delay in between the message being sent and when it was received. I believe this has a great deal to do with how the cell providers handle email submissions. Using this method I had to know each person’s cell provider and if they changed they had to tell me so I could make the changes.

I decided to use SMSified as a SMS provider and used their REST Api to interface with my app. This greatly speeds up the rate at which the text messages are received and provides a consistent phone number that is tied to the alerts we send out (before the messages would be from whoever sent the message).

Continue reading “Sending SMS messages from App Studio”

Ajax made Simple Part 7: Use JSONP to get a stock quote

Working with Ajax, we have run into the Same Origin Policy over and over again. In this post, we’ll show you another way to get around it.

The Same Origin Policy restricts you from loading files from a server not your own. There is an exception: JavaScript (.js) files are allowed.

There are sites on the web where you can request information and have it passed back in JSONP format. The “P” stands for padding: JSONP is JSON with padding. The results are returned as a function call, with the results as parameters. That function can then be called in your program.

Continue reading “Ajax made Simple Part 7: Use JSONP to get a stock quote”

Programming Contest Announced!

Our second NS Basic/App Studio Programming Contest starts today. We’re looking forward to cool entries which take advantage of the capabilities of devices and App Studio.

We have two categories: Web App and App Store. Web Apps are installed from a browser, while App Store apps are distributed through the Apple, Google, BlackBerry or other store. All registered NS Basic users are welcome to participate in the contest. Prizes are $100 USD in each category.
contest

You may enter more than one program. Judging will be by NS Basic’s experts. All judging is arbitrary and final. We will be looking for quality, performance, ease of use, sophistication and overall coolness. Apps can be whatever you like: enterprise, business, commercial, education, games or even something whimsical.

All programs must be written using NS Basic/App Studio. Entries may be commercial, shareware or freeware, and for iPhone, iPad, Android, BlackBerry or multiple platforms. Please indicate with your entry whether we can share your program or screenshots with the public.

Send your questions and entries to support@nsbasic.com.

The deadline for entries is Monday, April 23, 2012 at 12:00 midnite EST.

NS Basic/App Studio 2.1 Released!

We happy to announce that Version 2.1 is ready!

The list of enhancements and fixes is extensive. Major new features include:

  • Support for Libraries: These are easy to add libraries for your app. Libraries include AddToHomeScreen, Encryption and Sencha Touch.
  • AutoComplete: Now, when you type the period after an object, a list of members of that object will display.
  • The Open and Samples dialogs are now resizable.
  • Lots of smaller improvements and fixes. Check out the complete history.

The URL is the same as before. If you don’t have it anymore, be patient: we are sending an email to all registered users with the information.

The team here has been working hard on this new release. Great job, guys!

Ajax Made Simple Part 6: Where to put your PHP file

For development, put the PHP files for your project right in your project folder. You can then use any text editor that you have installed on your system to edit them.

Next, add the file names to the manifest in Project Properties. When you do a Full Deploy, they will be copied to the server with the rest of your project.

The result is that your PHP files will be placed on the server, in the same folder as your app. Your app can call a PHP script by just giving the file name – no path name will be needed.