hello guys how to make web extension so can someone help me
Have you seen the source code of an embedded web component? It is in the AppInventor Sources. While you can't use it directly as an extension, you can learn a lot there.
Hey @Aarush_Kumar your should say more clearly that what you want, btw here is the source of Web Component.
// -*- mode: java; c-basic-offset: 2; -*-
// Copyright 2009-2011 Google, All Rights reserved
// Copyright 2011-2022 MIT, All rights reserved
// Released under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
package com.google.appinventor.components.runtime;
import static android.Manifest.permission.INTERNET;
import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
import android.app.Activity;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.VisibleForTesting;
This file has been truncated. show original
If you wanted to do GET/POST requests, take a look on following threads.
Actually, it's easy. Still, I recommend you to look at what @Taifun said.
Here is the code which I use. With simple explanation:
@SimpleFunction(
description = "Website source-code")
public void WebsiteContent(final String website) {
AsynchUtil.runAsynchronously(new Runnable() { // Always do get request Asynchronously
@Override
public void run() {
try {
BufferedReader readStream = new BufferedReader(
…
Although @Kumaraswamy 's approach is good but it will only work for GET requests.
But if you are looking for other options then you should do this instead:
URL obj = new URL("https://www.google.com");
HttpURLConnection httpConnection = (HttpURLConnection)obj.openConnection();
httpConnection.setDoOutput(true); //if you want output
httpConnection.setRequestMethod("POST"); //request method
BufferedReader bufferedReader = null;
if (httpConnection.getResponseCode…
1 Like
hey @Techno_Vedang i know about appinventor sources but their code does not work for extension as @Patryk_F and idk how to make it work for extension