My App Show run time error

hi i m new to create extension so please help me.
today i create a extension to read content from url .my extension create successfully. my function is

@SimpleFunction(description = "Simple url content  reader")
  	public static String getText(String url) throws Exception 
	{
        URL website = new URL(url);
        URLConnection connection = website.openConnection();
        BufferedReader in = new BufferedReader(
                                new InputStreamReader(
                                    connection.getInputStream()));

        StringBuilder response = new StringBuilder();
        String inputLine;

        while ((inputLine = in.readLine()) != null) 
            response.append(inputLine);

        in.close();

        return response.toString();
    }

my block screen short is


my screen is

my project MySqLTest.aia (6.8 KB)

and apk file is MySqLTest.apk (5.2 MB)

my page which content i want to read is http://seva.daakpc.com/test.php

please help and thanks is advance

First You should learn the java then make extension.
The runtime error is showing because you code is wrong. You have to use a thread for fetching data from the URL. If you don’t know about thread then you can google it and there are many open source extension that fetches the data from URL. You must take a look to them.

Let have a look to this extension 's sources

It has used thread for getting the data from URL.
I hope it will help you.

thanks i will try

thanks
i request to u please write a code for this i am highly thankful to u please

Really??
You still requesting for the code even I have shared the source of my extension with you.
I do not know why everyone wants the complete code nowadays. Why don’t you guys want to work hard if you always ask for the readymade code then you will never learn anything.
What’s the problem in the extension’s sources code. It is also a extension. Try that if you are facing any issue then post here… We are ready to help you but you must try yourself first before asking for a readymade code.

1 Like

please follow the naming conventions

Taifun

sorry sumit ji
i agree with u.
i try hard and again and again till i do not get correct result.

1 Like

hi sumit
i try currency converter first my block is


when i run it it show error

my apk is
CurrencyConverter.apk (5.3 MB)
aia is
CurrencyConverter.aia (11.6 KB)
please help

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.