How to add .gif image or animation in Sketchware project

GIF images can be used in Sketchware projects by loading in webview. To load a GIF image or animation in webview follow the steps below.

1. Add a webview in VIEW area of the project, at a location where the GIF image is supposed to appear. Set the layout_width and layout_height of webview to wrap_content.

2. Save and exit the project.

3. Open ES File Explorer, and add the GIF image (suppose it's name is spin.GIF) to folder:
sdcard/.sketchware/resources/sounds/639(specific to project)/
4. Open the resource file of the same project, located at sdcard/.sketchware/data/629(specific to project)/resource, using ES Note Editor.
5. In resource file, under @sounds add name of the GIF image as following code:
{"resFullName":"spin.GIF","resName":"spin","resType":1}
6. Save the file, and open the project in Sketchware.

7. In LOGIC area under onCreate event, add the block WebView loadUrl, and write:
file:///android_res/raw/spin.GIF
8. Save and run the project. 

Komentar

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

How to enable download in webview in Sketchware apps?

TextInputLayout in Sketchware

Create Stopwatch App in Android using Sketchware

How to integrate Admob Ads in Sketchware project using AIDE?

How to find and​ highlight a word in a text field in Sketchware?

Code for implementing Notifications in Sketchware

A Flash Light App in Sketchware

Create a Stopwatch App using Chronometer in Sketchware

Create app to save all passwords, protected using voice key