Posts

WhateverA privacy and policy

All content provided by WhateverA is subject to terms and conditions that apply to all users including associated. Distribution of the content without consent is totally prohibited by WhateverA administration and its whose purpose is to provide the best service to our customers.

Views to jpg

 Bitmap returnedBitmap = Bitmap.createBitmap(_view.getWidth(), _view.getHeight(),Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(returnedBitmap); android.graphics.drawable.Drawable bgDrawable =_view.getBackground(); if (bgDrawable!=null) { bgDrawable.draw(canvas); } else { canvas.drawColor(Color.WHITE); } _view.draw(canvas); java.io.File file = new java.io.File(Environment.getExternalStorageDirectory() + "/Download/" + _name + ".jpg"); if (file == null) { showMessage("Error creating media file, check storage permissions: "); return; } try { java.io.FileOutputStream fos = new java.io.FileOutputStream(file); returnedBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fos); fos.close(); showMessage("Image Saved in /Download"); } catch (java.io.FileNotFoundException e) { showMessage("File not found: " + e.getMessage()); } catch (java.io.IOException e) { showMessage("Error accessing file: " + e.getMessage()); } Create a moreblock...

Ascii translator

 //Ascii to text: String ascii = edittext1.getText().toString(); StringBuilder stringBuilder = new StringBuilder(); String[] arrstring = ascii.split("[^0-9]+"); int n = 0; while (n < arrstring.length) { stringBuilder.append((char)Integer.parseInt((String)arrstring[n])); ++n; textview1.setText(stringBuilder); } //Text to ascii: String text = edittext1.getText().toString(); byte[] bytes = text.getBytes(); StringBuilder sb = new StringBuilder(); for (int i = 0; i < text.length(); i++) { sb.append((int)text.charAt(i)); sb.append(" "); } textview1.setText(sb); //Set your edittext id in "edittext1" and set your textview id in textview1. Textview1 is to show the result.

Typer Effect

s = "";  n = 0; t = new TimerTask() {  @Override  public void run() {   runOnUiThread(new Runnable() {    @Override    public void run() {     if (!(n == _Text.length())) {      String jg = ""+_Text;      char ug = jg.charAt((int) n);      s = s+""+ug;      _textview.setText(s);      n++;     }     else {      t.cancel();     }    }   });  } }; _timer.scheduleAtFixedRate(t, (int)(_delay), (int)(_delay)); //Create a moreblock, when you're creating it, add it a string variable called "Text", a textview called "textview" and a number variable called "delay" and put the code in the more block. Also create a number variable named "n" and a string variable named "s". Add timer component named "t". Now put the moreblock onCreate or onClick, and set the text you want and the time you want to see the effect.

Random password generator

StringBuilder stringBuilder = new StringBuilder(); Random random = new Random(); while (stringBuilder.length() < ((int)_length)) { stringBuilder.append("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890{}[]".charAt((int)(random.nextFloat() * (float)"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890{}[]".length()))); }  _text.setText(stringBuilder); //Create a more block, when you're creating it, add a number variable named "length" and a textview called "text", click create and paste the code.

Binary converter on Sketchware

 Binary to text: String biner = edittext1.getText().toString(); String hasil = ""; char nextChar; for(int i = 0; i <= biner.length()-8; i += 9) { nextChar = (char)Integer.parseInt(biner.substring(i, i+8), 2); hasil += nextChar; } textview1.setText(String.valueOf(hasil));