RSS

Monthly Archives: January 2014

Android App – Adding Custom Menu

In this blog posting, I’ll show you how to EASILY use Ai2LiveComplete to create an Android app with custom menu options that can be created dynamically.

Ai2LiveComplete (details HERE) now includes the following blocks that can be customized for each screen (Activity).

  • InitializeMenu – Use this block to initialize your menu (e.g. include MenuClearAll, MenuItemAdd – see below)
  • MenuClearAll – clears all menu options
  • MenuItemAdd – add a menu option to an optional image
  • MenuShow – shows or hides the menu options
  • MenuItemSelected – use this to capture events when a menu item is selected; e.g. to switch to another screen

Image below shows how to put together the app in the designer:

image

And below is the blocks that show the blocks that are put together:

image

And below is how it looks like on the device:

image

Interested in Ai2LiveComplete? please see HERE for details and more information.

 
7 Comments

Posted by on January 31, 2014 in Uncategorized

 

TextToSpeech – Setting Speech Rate and Pitch

In AiLiveComplete, you can quickly develop an Android app with Text-To-Speech functionality and allowing user to quickly change the speech Rate (speaking rate / speed) and Pitch (highness or lowness of a tone). See image below to see how to design the app in the Design Editor and how to code the logic in the Blocks Editor.

image

image

Interested in Ai2LiveComplete? please see HERE for details and more information.

 
Leave a comment

Posted by on January 30, 2014 in Uncategorized

 

Using SQLite component with ListPicker

Developing Android app with database functionality has been simplified in Ai2LiveComplete. SQLite component is an alternative to TinyDb with much powerful functionality.

This post shows you how to use SQLite component in Ai2LiveComplete and how to perform CRUD (Create, Read, Update, Delete) operations on database tables.

The SQLite is an alternative to TinyDB with full database functionality.

This example shows you how you can quickly create a  table, insert data, read (query) and then populate the result into a ListPicker.

  • On application start, the procedure initDb procedure is invoked, which creates a simple table with 2 columns.
  • Next, we insert 3 rows into the database table using SQL command

Create table and insert into table

Next, we use a ListPicker to display result data. In the ListPicker.BeforePicking, the table is queried. The query returns a list which can directly be populated into our ListPicker. Our table has a key and value columns. Let’s say that we use key for specifying a product (e.g. Lemonade) and value is the quantity of product on hand (e.g. 3). To keep data generic, both columns are defined as Varchar (String).

The query we want to perform is to determine how many of an item has been sold for each day.  Also, we want to multiply the quantity by 2 (assuming each item cost $2) and name the resulting column as ‘sold’. Also, we only want to select rows where quantity (value) is < 30.    This logic can be converted into sql statement like below:

select cast(value as decimal) * 2 sold, value from eav_table where value  between 0 and 30 

Above query means, select column value, convert (cast) to decimal and multiple by 2, name the result as ‘sold’.

image

When the ListPicker opens, it will display data as requested:

image

You can see the column headings and result data in the ListPicker.

Interested in Ai2LiveComplete? please see HERE for details and more information.

 
6 Comments

Posted by on January 29, 2014 in Uncategorized

 

Ai2LiveComplete

On January 10th, 2014, the basic version of Ai2LiveComplete was updated to be aligned with the latest version of MIT AI2. It is completely browser based and still includes SQLite and custom fonts for buttons and labels.

You can download the this basic offline version from sourceforge site HERE.  It also includes its own companion app for connecting your device via WiFi. After unzipping the download file, the companion app can be found in the root folder.

The online version of Ai2LiveCompete includes additional new components and enhancements. Please see below for these features. Interested? please see HERE for more information.

New components:

  • * AdMob – under 30 second integration with Google AdMob
  • * AdAmazon – under 30 second integration with Amazon Ads
  • SQL Lite
  • Near Field Communication (NFC)
  • File Manager
  • * Gallery View
  • * Spinner Picker (drop-down)
  • Toggle Button
  • Light Sensor
  • Pressure Sensor
  • Temperature Sensor
  • * Proximity Sensor
  • Pedometer
  • Date Picker
  • Time Picker
  • Chronometer
  • *SoundSensor
  • PhoneStatus
  • * Kitchen Sink – adhoc utility blocks
    • KeepScreenOn,
    • Hide/Show notification bar,
    • Can check to see if device has network signal or is a GPS enabled device
    • Can pop-up the GPS setting window
  • Pedometer
  • * @ XY Chart – Live XY chart. You can bind such data as accelerometer data to the chart
  • * Dynamic Custom Menus

* = See it in action here: http://YouTube.com/kkashi01
@ = Work-in-progress – feature will be added in future

Enhancements:

  • ListPicker – Includes ability to sort in ascending or descending
  • Custom Fonts – You can now import custom .ttf font with a button or TextBox. Free fonts can be used from HERE
  • Progress Bar – Ability to show or dismiss a progress bar — useful for long running processes; e.g. Show progress bar when downloading large files and dismiss (close) when download completed
  • TextToSpeech — Ability to change speech pitch and rate (works very nicely with slider)

@ = Work-in-progress – feature will be added in future

 Interested? please see HERE for details and more information.

 
39 Comments

Posted by on January 13, 2014 in Uncategorized

 
 
%d bloggers like this: