Posts

Showing posts from November, 2018

TextInputLayout in Sketchware

Image
To create an EditText with animation features, we can use the EditText in a TextInputLayout which is a Layout interface in android.support.design.widget library. In Sketchware we cannot add it in xml file but we can create it programmatically. Follow the instructions given below for a simple example.

1. In VIEW area of your project add two Linear horizontal linear2 and linear3, and a Button button1.

2. Switch On AppCompat and design.

3. Create a more block extra and define the block using an add source directly block. Put following code in it.
}
EditText edittext1, edittext2;
{

Here we declare two EditText fields, edittext1 and edittext2.

4. In onCreate event,
i. Use add source directly block and use codes to define edittext1, set it's LayoutParams, set it's hint, and set it's text color.
edittext1 = new EditText(this);
edittext1.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
edittext1.setHint(&quo…

Retrieve Device Build Information in Sketchware

Image
To retrieve Build information about the device we can use the android.os.Build class.

1. Create a new project in Sketchware.

2. In VIEW area add a TextView for each parameter to be retrieved. We can retrieve Device, Model, Product, Manufacturer, Brand, API level, Board, Bootloader, Display, Fingerprint, Hardware, Host, and Id.

3. Add following String variables: device, model, product, manufacturer, brand, api_level, board, boot, display, fingerprint, hardware, host, and id.


4. In onCreate event use add source directly block and put following code.
device = android.os.Build.DEVICE;
model = android.os.Build.MODEL;
product = android.os.Build.PRODUCT;
manufacturer = android.os.Build.MANUFACTURER;
brand = android.os.Build.BRAND;
api_level = android.os.Build.VERSION.SDK;
board = android.os.Build.BOARD;
boot = android.os.Build.BOOTLOADER;
display = android.os.Build.DISPLAY;
fingerprint = android.os.Build.FINGERPRINT;
hardware = android.os.Build.HARDWARE;
host = android.os.Build.HOST;
id = android.os.Bui…

Create Music Player app in Sketchware

Image
To create a Music Player app in sketchware, follow the steps given below.

1. Create a new project in Sketchware.

2. In VIEW area on main.xml, add a ListView listview1 with height wrap_content, and weight 1. Add a SeekBar seekbar1, an ImageView imageview1, and three TextViews textview1, textview2, and textview3, as shown in the image below.

3. Create a CustomView mycustom.xml and add a TextView textview1, and an ImageView imageview1 in it. For listview1 select mycustom.xml as it's customView.

4. Add a MediaPlayer component mp, a Shared Preferences component sp:sp and a Timer component timer.


5. Create six More Blocks MPcreate(pos), MPstart, and MPpause for the MediaPlayer and searchFolders, getFileList in [filePath] and extra.


6. Add three number variables n, r and songPosition, and five String variables currentfile, songMinutes, songSeconds, folder, folderName.

Also add a List String folderList, List String fileList and a List Map allmusic.

7. In onCreate event, use blocks as sho…