Posts Tagged ‘Android Manifest’

Android: Creating a WebView dialog

Click here to read Android: Creating a WebView dialog

This Android post shows how to display a WebView inside a Dialog, that renders a website to the user. Since the WebView can load just about any web page, it’s possible to provide any information to users without launching the web browser, so they never have to leave the application.

For this tutorial, all code had been developed and tested in Android 2.1, both on an emulator and on a real device. As usual, an example application with the code featured in this tutorial is available for download at the end of the post.

The first thing required to place a WebView inside a dialog is to create a custom Dialog. After that, a WebView can be added to it. The easiest way to do that is to create a new Android layout file (in Eclipse, just right click the Project folder and select New -> Android XML file). Then, add the following code: (more…)

Android: Fixing the API 12 Demos project errors

Click here to read Android: Fixing the API 12 Demos project errors

This post shows how to fix some of the most common errors when creating a project with the API 12 (Android 3.1) demos in the Eclipse IDE. The API samples comes bundled with the Android SDK and are a set of Activities that exemplifies how to do almost anything in Android. Following the instructions described at the official documentation to create a new Eclipse project with the API demos 12 code will cause a lot of errors.

(more…)

Android: Transparent or Translucent View Background

Click here to read Android: Transparent or Translucent View Background

This Android post is going to explain how to change the background color of a View, to make it completely or partially transparent. It may seen a little strange at first, but sometimes it makes sense to create a translucent or transparent background, like when coding an application with multiple viewports, such as a graphic editing tool, for example. Luckily, Android has already some built-in features that aids the programmer in achieving total or partial transparency at any required level.

So, to create a fully transparent background, all that’s needed is to add the following line to the Manifest file: (more…)

Android: changing the screen brightness

Click here to read Android: changing the screen brightness

This post will explain how to change the current system brightness with a seek bar GUI on Android devices. The code here featured only works on real devices, because it is not possible to see brightness changes on the emulator. Also, all the code explained here is available for download at the end of this post.

The first thing one must know is that Android system brightness value is applied to the screen’s backlight only when the screen turns on. This means that only after a boot up or awaking the phone from a sleeping state will make the screen as bright as the value defined by the System.SCREEN_BRIGHTNESS variable. Consequently, changing only that variable won’t be enough to preview the brightness level.

(more…)

Android: Loading and playing videos from different sources

Click here to read Android: Loading and playing videos from different sources

This is the 41st post on the website! It explains how to load images from a variety of locations, such as the ‘Resources’ folder, the SD card and from a remote server. As usual, the source code is available for download at the end of the post.

Let’s start with the basics: video formats. At the time this is being written, Android supports .3gp and .mp4 video files encoded as H.263,H.264 and MPEG-4 SP file formats. For an updated list, visit this link.

(more…)

Page 1 of 212