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 a Linear vertical  linear7  and inside this add three EditText fields  edit_email, edit_username, and edit_password . For the three EditText fields set hint as Email, Username and Password respectively. 2. Switch On AppCompat and design . 3. In onCreate event, i. Use codes to remove all Views from linear7 . linear7.removeAllViews(); ii. Define a TextInputLayout textinput1 , and add edit_email to it. com.google.android.material.textfield.TextInputLayout textinput1 = new com.google.android.material.textfield.TextInputLayout(this); textinput1.addView(edit_email); iii. Define a TextInputLayout textinput2 , and add edit_username

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 = a