How to import local library in sketchware
Hey Coders,
In this post I'll tell you how to import local library in sketchware. This is very useful when you try some new widget.
How to get dependency
For that you need to have library dependency. You can get dependency from GitHub or documentation page of the widget.
For example I am trying to download library for nobo button.
I go to GitHub and search for this code containing dependency. And now copy the code written after dependency. By copying this code I get this line
com.ornach.nobobutton:nobobutton:1.6
This code is separated by two ':'
Now come to sketchware open any project then click on 3 dots.
Then scroll and search for option of local library.
You will get it below custom blocks and above native library option.
Open this option and here you'll get all library list that you're having in sketchware. You can enable or disable any library.
Above all these libraries you'll find an icon representing download file. Click on this icon and then a dialog Box will appear.
You can select from DX or D8 option. DX is useful if your app includes target device below android 8. And D8 is useful if your app targets android 8 and above.
It means that if you use DX than you need to code with old version of java and your app will support all Android devices.
But if you use D8 than you can code your app in java8 ( latest version java ). But than your app will only supports android 8 and above and it will not work properly on android version below 8.
If you don't know what to do than simply click On DX.
After you click a new dialog will open like this.
In this Dialog box fill your dependency.
Now click on start and proccess will start.
This proccess is automatic and takes about 10-15 seconds. ( In some libraries it take upto 5 minutes).
When the proccess is complete then the library will be added in list.
How to search for Library
Sometimes you get error here. You downloaded library and now you can't find it.
So to do this you just need to look at your dependency. In this case my dependency was com.ornach.nobobutton:nobobutton:1.6
So I crop letters before first ':' and First ':' then I get
nobobutton:1.6
Then I'll replace second ':' with _V_ then I get this
nobobutton_V_1.6
This is final result. The library you downloaded will have name nobobutton_V_1.6
All done!
Hope you find answers go your query if you got any error then please comment below this post
Comments