RSS

Using Multiple Database – TinyDB

logo

TinyDB is a Storage component that can be used to store data for an app; i.e it is a persistent data store for the app. The data stored in a TinyDB will be available each time the app is run. An example might be a game that saves the high score and retrieves it each time the game is played.

Data for TinyDB is stored using key (tag), value pairs. To store data, you specify the tag it should be stored under. Subsequently, you can retrieve the data that was stored under a given tag. The value for a tag can be a simple text or complex data structure like List of Lists.

Each app has its own data store. By default, there is only one data store per app. Even if you have multiple TinyDB components, they will use the same data store. Image below shows using 2 TinyDB but the underlying code is using the same data-store.

If your app has complex requirement and you require Multiple Independent data-stores, then AppyBuilder includes such feature / capability and will allow you break your data into multiple separate independent storage – see image below.

Image below shows how this can be accomplished. In this example, we have used 2 TinyDB, but notice that using block TinyDB.DatabaseName, we are assigning a unique name to our database. This name can be anything as long as it is unique and does not contain special characters or embedded spaces. For purpose of this tutorial, we are using same tag (platform) to store different values in each of the databases. When we retrieve data, you’ll notice that each database returns the correct value that it stored.

Website: http://AppyBuilder.com

Use AppyBuilder GOLD for FREE: http://FreeGold.AppyBuilder.com

Share, Like us below 🙂

 
Leave a comment

Posted by on April 26, 2017 in Uncategorized

 

Webviewer File & Camera Upload Support

On desktops, HTML / php can be used to upload files from local device to a remote server. For mobile device, AppyBuilder includes Webviewer component for viewing web pages. For example, you can drag-n-drop this component into designer editor and set its HomeURL to webpage that you like to open:

The GOLD version, now includes support for uploading files from local mobile storage. It also includes support for taking pictures and directly uploading the file onto server! This feature can be very handy for such sites as Facebook  or for example allowing user to upload a local file or to take a picture and directly passing it remote server.

To use Webviewer, drag-N-drop this component onto design-editor and you’ll see a property named AllowCamera.

If you like to allow user to take pictures, checking AllowCamera property (set to true), will pop-up a Chooser window allowing user to take picture for upload. Let’s assume that you have a html like blow (source HERE):

From image above, you’ll see that the html page includes “Choose File” button for uploading file. Once clicked, this will pop-up the “File Chooser” window shown below:

At this time, user will be able to take picture and send to server OR can click on “Documents” to select a file from device local storage – see below:

After taking picture (or selecting a file) and submitting, our html can now perform actions on such as storing the image in server. In our case, the sample html (php) page only shows file-size information:

Image below shows the complete page flow:

Website: http://AppyBuilder.com

Try AppyBuilder GOLD for FREE: http://FreeGold.AppyBuilder.com

Share, Like us below 🙂

 
3 Comments

Posted by on April 9, 2017 in Uncategorized

 

Build Mobile Apps using Drag-N-Drop!

logo

AppyBuilder GOLD allows anyone to easily design and build Android mobile apps which such features as Android Material Design. it also includes ability to import MIT App Inventor projects and also has support for extensions!

You can use it for FREE by following link here: http://FreeGold.AppyBuilder.com. Later if you decide to use the premium features, just see plans HERE.

 

This slideshow requires JavaScript.

image
image

 
Leave a comment

Posted by on March 27, 2017 in Uncategorized

 

DateUtils Extension

TextUtils extension will allow you to quickly perform such date functions as:

  • Formatting date / time, based on user requested formats
  • Obtaining date / time difference between 2 different dates. This will result in CSV text data that contains 4 elements. For example, receiving data 301,5,11,30 means the 2 dates have difference of 301 days, 5 hours, 11 minutes and 30 seconds.

For format, you can use the following patterns:

Format Pattern                         Result
 --------------                         -------
 "yyyy.MM.dd G 'at' hh:mm:ss z"    ->>  1996.07.10 AD at 15:08:56 PDT
 "EEE, MMM d, ''yy"                ->>  Wed, July 10, '96
 "h:mm a"                          ->>  12:08 PM
 "hh 'o''''clock' a, zzzz"         ->>  12 o'clock PM, Pacific Daylight Time
 "K:mm a, z"                       ->>  0:00 PM, PST
 "yyyyy.MMMMM.dd GGG hh:mm aaa"    ->>  1996.July.10 AD 12:08 PM

Interested? Get the extension from AppyBuilder community here:  http://Community.AppyBuilder.com/t/about-the-extensions-category/2

Website: http://AppyBuilder.com

Try AppyBuilder GOLD for FREE: http://Gold.AppyBuilder.com

Share, Like us below 🙂

 
Leave a comment

Posted by on March 11, 2017 in Uncategorized

 

TextUtils extension

TextUtils extension will allow you to quickly perform such functions as:

  • Reverse a text to read from end to start
  • Title Case sentence
  • Format number for thousand separator and to include decimal points. This will also use proper country-based formatting!
  • Compare 2 strings to find if they are equal – can also ignore case
  • Perform search using Regular Expression Search on Steroid :o)

Wanna split / chop / perform Regular Expressions on TEXT (String)? Then use ReplaceRegex block like shown below:


Looking for .aix? Get it from AppyBuilder community HERE

Website: http://AppyBuilder.com

Use AppyBuilder GOLD for FREE: http://FreeGold.AppyBuilder.com

Share, Like us below 🙂

 
1 Comment

Posted by on March 9, 2017 in Uncategorized

 

Shuffling / Ordering Lists

Join AppyBuilder community at http://Community.AppyBuilder.com

Lists are data structures that are used to create and/or manipulate different sets of values/elements.

In AppyBuilder / AI, Lists can be created by converting a CSV data into a List such as below:

Some apps, such as game apps (e.g. cards) require shuffling or randomizing a list. The shuffling would require coding (sometimes complicated) to make the shuffling happen. AppyBuilder has now developed an extension that can be used both in AppyBuilder OR MIT AI to perform shuffling using only one Shuffle block as shown below!

The extension also includes Sorting block for sorting a list in ASCeding (1) or DESCending (-1) order:

Wanna reverse a list? Then use Reverse block as shown below:

Need to get rid of duplicate items? Then use RemoveDuplicates block like shown below:

undefined


Looking for .aix? Get it from AppyBuilder community HERE

Website: http://AppyBuilder.com

Use AppyBuilder GOLD for FREE: http://FreeGold.AppyBuilder.com

Share, Like us below 🙂

 
6 Comments

Posted by on March 5, 2017 in Uncategorized

 

Text Encoding & Decoding using Lists

A list (also called an array in other programming languages) is a tool that can be used to store multiple pieces of information at once.

In this tutorial, we will learn how to create, navigate and find items in a List. For this, we will create an Android app that will parse text (e.g. user entry text) and will then encode or decode it using Lists. We will also use DRY (Don’t Repeat Yourself) concept by using Procedures.

Assumptions

This tutorial assumes that user is already familiar with App Inventor Or AppyBuilder. This app is being developed using AppyBuilder, but same concept can be used in App Inventor. Source code can be downloaded using link at bottom of this post and it can be imported into FREE AppyBuilder here: http://FREE.AppyBuilder.com.

User Interface

This tutorial focuses on behaviour / logic rather than user interface and for this, it does not contain any user interface. You can tailor this code to your needs and design the user interface as needed.

Blocks

We will use Procedure to include the processing logic. However, before diving into blocks logic, take a look at image below that shows results of calling the procedure. The procedure-calls below encodes “apple peach” and then decodes it back to original text.

We now start coding the logic and start by creating three global variables:

  • varTemp – used to get result of encoding or decoding of text
  • listFrom and listTo – These synchronized lists will contain a mapping of letters. Details on usage will be covered below.

Next, we create a Procedure. This procedure will return result. It will also take 2 parameters as shown below:

  • shouldEncode – this boolean parameter is used to indicate if we want the procedure to encode or decode text
  • someText – this parameter will be used to receive the text that procedure should encode or decode

Next, from Control drawer, we drag & drop a “do with result” block. We use this block so that we include additional blocks and also return a result when procedure completes. Plug the “do with results” into procedure return socket as shown below:

Image below shows entire code that is used for this encodeOrDecode procedure and below explains logic for each section.

  • A – In this section, we first change the passed in text as lower case. We also replace all spaces with pipe (|). The reason for this is that some list-blocks ignore blank space. So we temporarily change space to pipe and when returning final result, change pipe back to space.
  • B – In this section, we initialize our listFrom and listTo to some default values in format of CSV and then use “list from csv row” to convert CSV to list. NOTE: Complete the list to include all alphabet letters
  • C – Our procedure is used to encode OR decode. If the parameter shouldEncode is false, we switch our listFrom and listTo lists
  • D – We initialize varTemp to empty string. This variable will contain the final result
  • E – We include a “for each” loop that will be repeated for the length of passed-in text. Inside this block, we will inspect each letter of the text by using the index of the loop.
  • F – Reading blocks from right-to-left, we retrieve the letter at position idx (segment), find its position (index) in listFrom (index in list), then retrieve letter at position idx of listTo (select list item). Then we append this to varTemp
  • G – In this section, we take our final varTemp, replace all the pipe (|) back to spaces and then return that as final result.

Blocks below show how to invoke above procedure and encoding or decoding text.

Source and .apk

Find this post useful or using it? Appreciate your support:  PayPal - The safer, easier way to pay online!

Like this post?  Share using button below and give us your thumbs-up

 
Leave a comment

Posted by on January 19, 2017 in Uncategorized

 
 
%d bloggers like this: