Posts

Showing posts from June, 2019
Image
Drag widgets in Sketchware Code:- img.setOnTouchListener(new OnTouchListener() { PointF DownPT = new PointF(); PointF StartPT = new PointF(); @Override public boolean onTouch(View v, MotionEvent event) { int eid = event.getAction(); switch (eid) { case MotionEvent.ACTION_MOVE: PointF mv = new PointF(event.getX() - DownPT.x, event.getY() - DownPT.y); img.setX((int)(StartPT.x+mv.x)); img.setY((int)(StartPT.y+mv.y)); StartPT = new PointF(img.getX(), img.getY()); break; case MotionEvent.ACTION_DOWN: DownPT.x = event.getX(); DownPT.y = event.getY(); StartPT = new PointF(img.getX(), img.getY()); break; case MotionEvent.ACTION_UP: float distance = DownPT.x - event.getX(); if (distance == 0) { showMessage("Clicked"); } break; default : break; } return true; } });
Image
Color gradient in Sketchware Code:- int[] colors = {Color.rgb(138,41,81),Color.rgb(41,53,158)}; android.graphics.drawable.GradientDrawable gd = new android.graphics.drawable.GradientDrawable(android.graphics.drawable.GradientDrawable.Orientation.BR_TL, colors); gd.setCornerRadius(0f);  gd.setStroke(0,Color.WHITE); if(android.os.Build.VERSION.SDK_INT >= 16) {linear1.setBackground(gd); } else {linear1.setBackgroundDrawable(gd);}
Image
Motion detector in Sketchware Source code: linear1.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View p1, MotionEvent p2){ switch(p2.getAction()) { case MotionEvent.ACTION_DOWN:  y1 = p2.getY(); x1 = p2.getX(); break; case MotionEvent.ACTION_UP:  y2 = p2.getY(); x2 = p2.getX(); if (((y1 - y2) < -250)) { showMessage("Down"); }  if (((y2 - y1) < -250)) { showMessage("Up"); } if (((x1 - x2) < -250)) { showMessage("Right"); }  if (((x2 - x1) < -250)) { showMessage("Left"); } break; } return true; }}); //Create Number Variable y1, y2, x1, x2
Image
App launcher in Sketchware with Swift Rein Code: Intent startupIntent = new Intent(Intent.ACTION_MAIN); startupIntent.addCategory(Intent.CATEGORY_LAUNCHER); final android.content.pm.PackageManager pm = getPackageManager(); List<android.content.pm.ResolveInfo> activities = pm.queryIntentActivities(startupIntent,0); Collections.sort(activities, new Comparator<android.content.pm.ResolveInfo>() { 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<android.content.pm.ResolveInfo> adapter = new ArrayAdapter<android.content.pm.ResolveInfo>(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...
Image
Time picker in Sketchware with Swift Rein. Source code. TimePicker tp=new TimePicker (MainActivity.this); LinearLayout.LayoutParams lp=new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT); tp.setLayoutParams(lp); linear1.addView(tp); tp.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener(){ @Override public void onTimeChanged(TimePicker timePicker, int i, int i1) {Toast.makeText(getApplicationContext(),"Time is "+i+":"+i1,Toast.LENGTH_SHORT).show(); }});
Image
Encryption and Salting in Sketchware Description: In this video, I have explained what is data encryption, where we find the use of data encryption, how data encryption is useful and how to use it in Sketchware. This maintains the privacy of your data or information. It is used in chatting apps made in Sketchware. The data gets converted to unreadable code language within the device before getting stored in cloud storage of that app. After retrieving data, the encryption is reversed. I could not show or use salting in the program as it was a simple encryption. Salting works out in complex encryption where the data character are simultaneously interchanged. I hope you will like it. Subscribe to support me. Thanks for watching. Bye.👋 Code in onClick: int L = str.length(); int v = (int)s; for(int I =0;I<L;I++) {  char ch1 = str.charAt(I); int ch = ch1; if(Character.isUpperCase(ch1))     { ch = ch + v;        if(ch...
Image
Drawing app 2 in Sketchware Click  to download images Source code:- In on create:- First part dv = new DrawingView(this); linear1.addView(dv); mPaint = new Paint(); mPaint.setAntiAlias(true); mPaint.setDither(true); mPaint.setColor(Color.BLACK); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeJoin(Paint.Join.ROUND); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeWidth(12); } DrawingView dv; private Paint mPaint; private Canvas mCanvas; public class DrawingView extends View { public int width; public int height; private Bitmap mBitmap; private Path mPath; private Paint mBitmapPaint; Context context; private Paint circlePaint; private Path circlePath; public DrawingView(Context c) { super(c); context=c; mPath = new Path(); mBitmapPaint = new Paint(Paint.DITHER_FLAG); circlePaint = new Paint(); circlePath = new Path(); circlePaint.setAntiAlias(true); circlePaint.setColor(Color.BLUE); circlePaint.setStyle(Paint.Style.STROKE); circlePaint.setStrokeJ...

Drawing app in Sketchware

Image
<<click to go to the video Drawing app in Sketchware Description: In this video, I have shown how to make a drawing app in sketchware within your smartphone without any programming language. I hope you will like it, enjoy drawing. thank you. TO OUR YOUTUBE CHANNEL Video algorithm step 1: open sketchware  app. step 2: create an app. step 3: name the app (eg. drawing app). step 4: put a linear. step 5: change its height to match_parent and id to other than linear1 step 6: put another linear. step 7: change orientation of previous linear to vertical . step 8: again put another linear. step 9:change the id of lower linear to linear1 (compulsory) . step 10: change the background resource of first and second linear. step 11: change weight of linear1 to 1. step 12: put a button in the upper linear. step 13: change gravity of upper linear to right . step 14: change padding to 0. step 15: change button text to " clean ". step 16...