Posts

Read Json file from asset in Sketchware Pro

Image
Hello guys 👋 In this article I will explain how to read file from json and parse it in custom listview First of all you need sketchware Pro If you don't have you find it in my app SBD tool version 2.0 After that you can follow the tutorial : Add listview Create customview  Link your listview with custom view you make Then add your file in asset folder  Then in logic arrea click onCreate Add two variables json and data Add listmap map Then add this code try {   java.io.InputStream is = this.getAssets().open("data.json");            int size = is.available();            byte[] buffer = new byte[size];            is.read(buffer);            is.close();            json = new String(buffer, "UTF-8");  //here add your listview data bind } catch(Exception e) {   } Then in onBindCustomView  This is almost everything you need  If you didn't understand then watch video tutorial

Receiving Simple Data from Other Apps Using Sketchware

Image
Add this code in onCreate : // Get intent, action and MIME type     Intent intent = getIntent();     String action = intent.getAction();     String type = intent.getType(); if (Intent.ACTION_SEND.equals(action) && type != null) {  if ("text/plain".equals(type)) {   shared = intent.getStringExtra(Intent.EXTRA_TEXT);   YourWidget.setText(shared);  } } Inject this code in manifest.xml : <intent-filter>  <action android:name="android.intent.action.MAIN" />  <category android:name="android.intent.category.LAUNCHER" />   </intent-filter>    <intent-filter>     <action android:name="android.intent.action.SEND" />  <category android:name="android.intent.category.DEFAULT" />  <data android:mimeType="text/plain" />   </intent-filter> Video tutorial  

Add CustomView to ToolBar [make search bar]

Image
Hi guys in this article I will show you how to add CustomView to your ToolBar in Sketchware  What you need is: Enabling appcompat library  Create a new CustomView  Design your CustomView for me I added edittext1 & button1 Add this code getSupportActionBar().setDisplayShowTitleEnabled( false ); getSupportActionBar().setDisplayHomeAsUpEnabled( false ); View logo = getLayoutInflater().inflate( R .layout.dvv, null ); logo.setLayoutParams( new LinearLayout .LayoutParams(android.widget. LinearLayout .LayoutParams.MATCH_PARENT, android.widget. LinearLayout .LayoutParams.MATCH_PARENT)); _toolbar.addView(logo); final Button button1 = ( Button )logo.findViewById( R .id.button1); final EditText edittext1 = ( EditText )logo.findViewById( R .id.edittext1); button1.setOnClickListener( new View .OnClickListener() { public void onClick ( View v) { SketchwareUtil.showMessage(getApplicationContext(), edittext1.getText().toStri...

Full Screen Custom Dialog on Sketchware

Image
Code Used : final Dialog dialog1 = new Dialog(this,LinearLayout.LayoutParams.MATCH_PARENT); dialog1.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog1.setContentView(R.layout.custom_dialog); final Button button1 = (Button)dialog1.findViewById(R.id.button1); button1.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { dialog1.dismiss(); } }); dialog1.show();

Design Cool List UI in Sketchware

Image
Welcome Guys I hope you are doing well 😊  In this topic I will show you how to design a better list UI  FOLLOW ME  Add linear layout  Add listview Create custom view  Link your listview with custom view create string "s" Create list map "map" Add items to your list map Codes used : On create add this code : listview1.setDivider(null); listview1.setDividerHeight(15); listview1.setVerticalScrollBarEnabled(false);  In listview1 : onBindCustomView add this code : textview1.setText(s.substring(0,1));    Random rnd = new Random();    int color = Color.argb(255, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));            android.graphics.drawable.GradientDrawable gd = new android.graphics.drawable.GradientDrawable();            gd.setColor(color);            gd.setCornerRadius(600);    gd.setStroke(2, Color.WHITE);    textview1.setBackground(gd);    android.graphics.drawable.RippleDrawable ripdr = new android.graphics.drawable.RippleDrawable(new android.content.res...

TargetView Library With Sketchware

Image
Hello guys hope you are doing well In this article I'm going to show you how to implement TargetView Add TargetView Library  Link 🔗 :  Library link Add appcompat library  Code used : TapTargetView.showFor(this, TapTarget.forView(findViewById(R.id.target), "This is a target", "We have the best targets, believe me") .outerCircleAlpha(0.96f) .drawShadow(true) .cancelable(false) .tintTarget(true) .titleTextSize(20) .descriptionTextSize(10) .transparentTarget(false) .targetRadius(60) , new TapTargetView.Listener() { @Override public void onTargetClick(TapTargetView view) { super.onTargetClick(view); //Your code here   }  }); Run your project 😊

Jsoup : Extract Data and parse it in custom list

Image
Welcome Guys I hope you are doing well 😊 In this video I'm going to show you how to extract any data from almost any website and parse it in custom list Attention Scraping data is likely illegal and I'm not responsible for anything happens This video is just for educational purposes For this video I'm going to scrape a website that supports that hhh Just follow and see what we are going to extract Open your project and add this  Design your app by adding listview  Add custom view  Then link it to listview  Number n String url List string  List map  Add networkrequest component  OnBindCustomView : For this tutorial in using this url https://webscraper.io/test-sites/e-commerce/allinone This url is for testing purposes you use it for that without any problems  See this pic to know how to use the codes  I will provide only the code the other blocks add it by your self  class AsyncTaskEx extends AsyncTask<Void, Void, Void> {  ...