Posts

Showing posts from May, 2020

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> {  ...

Gradient View in Sketchware

Image
In this topic I will show you how to use gradient class easily in sketchware In your project import this  android.graphics.drawable.GradientDrawable Then add this code : int[] colors = {Color.parseColor("#008000"),Color.parseColor("#ADFF2F")}; //create a new gradient color GradientDrawable gd = new GradientDrawable( GradientDrawable.Orientation.TOP_BOTTOM, colors); gd.setCornerRadius(0f); //apply the button background to newly created drawable gradient view.setBackground(gd); If you want to change the direction of gradient the choose one of this :         *//** draw the gradient from the top to the bottom *//*         TOP_BOTTOM,         *//** draw the gradient from the top-right to the bottom-left *//*         TR_BL,         *//** draw the gradient from the right to the left *//*         RIGHT_LEFT,         *//** draw the gradient fr...

Web Scraping With Jsoup in Sketchware

Image
In this article I'm going to introduce you to this library to be familiar with it so we will walk through a simple steps so we won't get struck in the future  jsoup is an open-source Java library designed to parse, extract, and manipulate data stored in HTML documents. What does it mean 🤔🤔 It means that you can pick almost any website and extract data from it and use it as much as you want with no issues Keep in mind that jsoup has problems with pages that use javascript to load data cause it is dynamically generated and jsoup can only handle the static data that provided in the html page Sorry for long talk but I wanted to make sure that you understand what we are going to do So before start you need : 👉 Sketchware Mod called Revolution in case you don't have it here is the  Link 🔗  http://www.mediafire.com/file/5l7y056i3ijzd7y/Sketchware_Revolution_5.0.6.apk/file 👉 Second you need library importer   Link  https://bit.ly/swrevo119 If you have both tha...

Gradient TextView In Sketchware

Image
Code used : android.text.TextPaint paint = textview1.getPaint(); float width = paint.measureText("Subscribe for more videos"); Shader textShader = new LinearGradient(0, 0, width, textview1.getTextSize(), new int[]{ Color.parseColor("#F97C3C"), Color.parseColor("#FDB54E"), Color.parseColor("#64B678"), Color.parseColor("#478AEA"), Color.parseColor("#8446CC"), }, null, Shader.TileMode.CLAMP); textview1.getPaint().setShader(textShader);

Fit Background to Status Bar in Sketchware

Image
Code Used : if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); }

Create Rating Bar Sketchware

Image
hello everyone in this tutorial we will talk  about how to create rating bar in your app  of course using sketchware  here we go  instructions : add linear layout and name it to anything you want  add this code to logic area in onCreate  Code Used :  RatingBar tp = new RatingBar(this); linear1.addView(tp); note : change linear1 to name that you choose it it's easy, right? for more details you can watch my tutorial

Get all Audio files [Sketchware/Easiest way]

Image
Code used //please subscribe to my channel //in case you want to make a video using my snippet please make a refer to me 😊️ android.database.Cursor c=getContentResolver().query(android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String[]{android.provider.MediaStore.Audio.Media.DISPLAY_NAME}, null, null, null); while(c.moveToNext()) { String name=c.getString(c.getColumnIndex(android.provider.MediaStore.Audio.Media.DISPLAY_NAME)); audio.add(name); } Video Tutorial

Webview Progress Bar Sketchware

Image
hello everyone this tutorial will be about how to add ProgressBar to your webview app,  well its very easy only you need to Add linear and name it to pl copy this code and paste it in onCreate logic code :  final android.widget.ProgressBar prog = new android.widget.ProgressBar(this,null, android.R.attr.progressBarStyleHorizontal); prog.setPadding(0,0,0,0); prog.setIndeterminate(false); prog.setFitsSystemWindows(true); prog.setProgress(0); prog.setScrollBarStyle(android.widget.ProgressBar.SCROLLBARS_OUTSIDE_INSET); prog.setMax(100); ViewGroup.LayoutParams vlp = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); prog.setLayoutParams(vlp); pl.addView(prog); webview1.setWebChromeClient(new WebChromeClient() { @Override public void onProgressChanged(WebView view, int newProgress) { prog.setProgress(newProgress); } });

Add Share Functionality to your App with Sketchware

Image
Code Used : String apk = ""; String uri = (getPackageName());   try { android.content.pm.PackageInfo pi = getPackageManager().getPackageInfo(uri, android.content.pm.PackageManager.GET_ACTIVITIES);   apk = pi.applicationInfo.publicSourceDir; } catch (Exception e) { showMessage(e.toString()); } Intent iten = new Intent(Intent.ACTION_SEND); iten.setType("*/*"); iten.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new java.io.File(apk)));   startActivity(Intent.createChooser(iten, "Send APK")); Video tutorial 

Gridview with Custom View in Sketchware

Image
Code used : Add this code in onCreate : GridView grid = new GridView(this); grid.setLayoutParams(new GridView.LayoutParams(GridLayout.LayoutParams.MATCH_PARENT, GridLayout.LayoutParams.WRAP_CONTENT)); grid.setBackgroundColor(Color.WHITE); grid.setNumColumns(3); grid.setColumnWidth(GridView.AUTO_FIT); grid.setVerticalSpacing(5); grid.setHorizontalSpacing(5); grid.setStretchMode(GridView.STRETCH_COLUMN_WIDTH); grid.setAdapter(new Listview1Adapter(listmap)); linear1.addView(grid); grid.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { showMessage(Integer.toString(position)); }}); This code for designing : Add this code in onBindCustomView : android.graphics.drawable.GradientDrawable gd = new android.graphics.drawable.GradientDrawable(); gd.setColor(Color.parseColor("#37474F")); gd.setCornerRadius(30); gd.setStroke(2, Color.WHITE); linear2.setBackground(gd);

App List Launcher With Sketchware

Image
Code Used : Intent startupIntent = new Intent(Intent.ACTION_MAIN); startupIntent.addCategory(Intent.CATEGORY_LAUNCHER); final android.content.pm.PackageManager pm = getPackageManager(); List activities = pm.queryIntentActivities(startupIntent,0); Collections.sort(activities, new Comparator() { public int compare(android.content.pm.ResolveInfo a, android.content.pm.ResolveInfo b) { android.content.pm.PackageManager pm = getPackageManager(); return String.CASE_INSENSITIVE_ORDER.compare( a.loadLabel(pm).toString(), b.loadLabel(pm).toString()); } }); ArrayAdapter adapter = new ArrayAdapter( this, android.R.layout.simple_list_item_1, activities) { public View getView(int pos, View convertView, ViewGroup parent) { TextView tv = new TextView(MainActivity.this); android.content.pm.ResolveInfo ri = getItem(pos); tv.setText(ri.loadLabel(pm)); LinearLayout lin = new LinearLayout(MainActivity.this);ImageView iv = new ImageView(MainActivity.this);iv.setImageDrawable(ri.loadIcon(pm));lin.addView(iv)...

Change wallpaper Programmatically Sketchware

Image
Code used : WallpaperManager myWallpaperManager = WallpaperManager.getInstance(getApplicationContext()); try { Bitmap bitmap = ((android.graphics.drawable.BitmapDrawable) imageview1.getDrawable()).getBitmap(); myWallpaperManager.setBitmap(bitmap); } catch (Exception g) { g.printStackTrace(); } Add this to your manifest.xml <uses-permission android:name="android.permission.SET_WALLPAPER"/> Video tutorial :

Build basic browser with Sketchware [part #1]

Image
All codes used in my tutorial Enable Enable Download : webview1.setDownloadListener(new DownloadListener() { public void onDownloadStart(String url, String userAgent, String contentDisposition, String mimetype, long contentLength) { Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i); } }); Progress Bar : final android.widget.ProgressBar prog = new android.widget.ProgressBar(this,null, android.R.attr.progressBarStyleHorizontal); prog.setPadding(0,0,0,0); prog.setIndeterminate(false); prog.setFitsSystemWindows(true); prog.setProgress(0); prog.setScrollBarStyle(android.widget.ProgressBar.SCROLLBARS_OUTSIDE_INSET); prog.setMax(100); ViewGroup.LayoutParams vlp = new ViewGroup.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); prog.setLayoutParams(vlp); pl.addView(prog); webview1.setWebChromeClient(new WebChromeClient() { @Override public void onProg...