How to Check Latest Version in sketchware with Firebase Database

1) Create a new project in Sketchware.

2) Add Firebase library in the library.
Make sure the rules in your Firebase database are read and write true.

3) Add Firebase Database component as

4) Add String variables as package_name, your_version, latest_version and Add map variable as map

5) Then OnCreate event set string package_name to your app package. In this tutorial I am using sketchware.check.version

6) Then below set string block add two add source directly block. First code is

try { pinfo = getPackageManager().getPackageInfo( package_name,;
your_version = pinfo.versionName; }
catch (Exception e){ showMessage(e.toString()); }

Second code is

DatabaseReference rootRef = _firebase.getReference(); rootRef.child("version").addListenerForSingleValueEvent(new ValueEventListener() {
public void onDataChange(DataSnapshot snapshot) {
if (snapshot.exists()) { } else {

7) Then add following block.

8) Then add an add source directly block with code

} }
public void onCancelled(DatabaseError _error) { } });

After doing the above instructions your OnCreate event will look like

9) Then add a list map as map1

10) Then OnChildAdded event of Firebase Database component version:version
Do as below

Code used is


That’s all
Save and run the project.
You can watch below the video.

Leave a Comment