How to make Web Source code viewer app in Sketchware

Image
Web source code viewer app in sketchware. First you have to make a app with edittext , button , linear , scollview and a textview for showing results. Then create a more block extra which create a AsyncTask with name BackTask. Then add the following code:- } private class BackTask extends AsyncTask<String, Integer, String> { @Override protected void onPreExecute() {} protected String doInBackground(String... address) { String output = ""; try { java.net.URL url = new java.net.URL(address[0]); java.io.BufferedReader in = new java.io.BufferedReader(new java.io.InputStreamReader(url.openStream())); String line; while ((line = in.readLine()) != null) { output += line; } in.close(); } catch (java.net.MalformedURLException e) { output = e.getMessage(); } catch (java.io.IOException e) { output = e.getMessage(); } catch (Exception e) { output = e.toString(); } return output; } protected void onProgressUpdate(Integer... values) {} protected void onPostExecute(String s){ t...

How to create push notification block in skechware.

How to create push notification block in sketchware.

1) Create a more block with a variable title and content and a number number.
2) In define more block add add source directly block and put the following code.

Notification.Builder mBuilder = new Notification.Builder(MainActivity.this);
mBuilder.setSmallIcon(R.drawable.app_icon);
mBuilder.setContentTitle(_title);
mBuilder.setContentText(_content);
mBuilder.setDefaults(
Notification.DEFAULT_SOUND
| Notification.DEFAULT_VIBRATE);
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify((int)_number, mBuilder.build());

3) At main.xml add a button1.

4) In button1 on click add the more block like this.
5) add an title, content, and message no in more block.

6) Then save and run the project.

For more details watch this video

Comments

  1. That's amazing informative post, I want to add one more thing, If you want to make your web visitor to your subscriber then you should definitely check gravitec lifetime deal Best push notification for website ever.

    ReplyDelete

Post a Comment

Popular posts from this blog

How to make Web Source code viewer app in Sketchware

How to make Sketchware project downloading app in Sketchware.