Tag Archives: url

67,308 views

Linkify text link url in TextView text Android example

Example from SDK C:\Program Files\Android\android-sdk-windows\samples\android-10\ApiDemos\src\com\example\android\apis\text\Link.java Source: http://developer.android.com/resources/browser.html?tag=sample License: http://www.apache.org/licenses/LICENSE-2.0 1.) Automatically linkifies using android:autoLink=”all” // res/values/strings.xml <string name="link_text_auto"><b>text1:</b> This is some text. In this text are some things that are actionable. For instance, you can click on http://www.google.com and it … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on Linkify text link url in TextView text Android example
7,822 views

Open url with browser if button clicked Android example.

Button, setOnClickListener, Intent.ACTION_VIEW, startActivity Android example.   Button mIdButtonHome = (Button)findViewById(R.id.idButtonHome); mIdButtonHome.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent browserIntent = new Intent( Intent.ACTION_VIEW, Uri.parse("http://android.okhelp.cz/category/software/")); startActivity(browserIntent); } });

Posted in Android Examples Code | Tagged , , , , | Comments Off on Open url with browser if button clicked Android example.
4,691 views

Read file from URL

Read file from URL to array of byte and convert to UTF-8 String Android examle source code. URL urlLoc = new URL("http://myweb.com/myfile.html"); URLConnection conexion = urlLoc.openConnection(); conexion.setConnectTimeout(4000); conexion.setReadTimeout(1000); conexion.connect();   // downlod the file InputStream input = new BufferedInputStream(urlLoc .openStream()); … Continue reading

Posted in Android Examples Code | Tagged , , , , , | Comments Off on Read file from URL
3,485 views

Download file from URL

Download image file from URL to ImageView Java Android source example code. Context context = thisClass.this; Drawable image = ImageOperations(context, "http://android.okhelp.cz/images/adictionary/ad_4.png" ,"image.jpg"); ImageView imgView; imgView = (ImageView)findViewById(R.id.idImageView); imgView.setImageDrawable(image);   private Drawable ImageOperations(Context ctx, String url, String saveFilename) { try { … Continue reading

Posted in Android Examples Code, Bitmap, drawing | Tagged , , , , , , , , | Comments Off on Download file from URL