Posts

Showing posts from April, 2019

How to zip files in Sketchware

Image
1) Create a new Sketchware project. 2) Add two Buttons with id button1 and button2 and a EditText with id edittext1 Then change the text of button1 and button2 to  Zip files and folders and Unzip files . Then add a file picker component and three string variables source , destination and path . Then Create a more block zip with two strings source and destination . And add another more block Unzip with one string path . 3) In button1 (To Zip folder)   on click event do as below:- 4) In button2 (To Unzip File) on click event do as below:- 5) In onfilepicked event do as below :- 6) In more more zip paste the below code:- try { java.util.zip.ZipOutputStream os = new java.util.zip.ZipOutputStream(new java.io.FileOutputStream(_destination)); zip(os, _source, null); os.close(); } catch(java.io.IOException e) {} } private void zip(java.util.zip.ZipOutputStream os, String filePath, String name) throws java.io.IOException { java.io.File file = new java.io.File(filePath); java.util.zip.ZipEntr

How to add an introduction in sketchware

Image
Watch the below video and follow instructions. Code used in this video is:- linear1.setOnTouchListener(new View.OnTouchListener() {@Override public boolean onTouch(View p1, MotionEvent p2){ switch(p2.getAction()) { case MotionEvent.ACTION_DOWN: f = p2.getX();break; case MotionEvent.ACTION_UP: t = p2.getX();if (((f - t) < -250)) {_SlideLeft();} if (((t - f) < -250)) {_SlideRight();}break;}return true;}});

How to Share an image from imageview to any app.

1) Create a new sketchware project or use an existing project. 2) For sharing images from imageview1 , set a button as button1 to initiate sharing. 3) In button1 onClick event add a ASD block and paste the below code:- Bitmap bm = ((android.graphics.drawable.BitmapDrawable) imageview1.getDrawable()).getBitmap(); try { java.io.File file = new java.io.File(getExternalCacheDir() + "/image.jpg"); java.io.OutputStream out = new java.io.FileOutputStream(file); bm.compress(Bitmap.CompressFormat.JPEG, 100, out); out.flush(); out.close(); } catch (Exception e) { showMessage(e.toString()); } Intent iten = new Intent(android.content.Intent.ACTION_SEND); iten.setType("*/*"); iten.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new java.io.File(getExternalCacheDir() + "/image.jpg"))); startActivity(Intent.createChooser(iten, "Send image")); If the above code crashes consider adding WRITE EXTERNAL STORAGE by adding a more block as nothing and a blank write string

How to enable Developer options in android

For Developers to test apps in android from android Studio and for some features, they need to enable Developer options in their android phone. 1) Go to settings in your android phone. 2) Scroll to the last. Click on About phone. 3) Find Build number and click it 5 times. 4) Developer options will be turn on.

Blog - How to cancel your Adsense account.

You may also like:- How to make a blog There are two methods to cancel your adsense account permanently. First method:- 1) Sign in to your adsense account. 2) Go to Settins > Account > Cancel account. 3) A confirmatory email will be sent to your email. 4) Click the link in the email. Ads:- Second method:- If the cancel account button is not shown you have to follow second method. 1) Visit this link:- Cancel my AdSense account - AdSense Help 2) Fill up your account details. 3) Your adsense account wiil be closed. The second method is the most common method. Because in some adsense accounts, there will be no cancel button. Thank you...