Tutorial: Using WebView to load the html page from Assets

Wow, it’s been a long time since my last post!

Today I would like to talk about the WebViewAndroid‘s view for displaying web pages. The first thing to know is that it has a few methods to load data and sometimes it may not be so obvious which one to use. So, we will go step by step on how to load the html page, which is located in project’s assets directory. It won’t be just a simple text: custom font, an image and some style will be applied to this page as well.

OK, so let’s begin!

First, I have created an empty Android project (I used Intellij Idea 11 as my IDE, but it really doesn’t matter which IDE to use in this tutorial). The package name for this tutorial is –com.lomza.tut.webview. Then add two new folders to the assets folder: fonts and images. The first one will contain our custom font and the second one will be used as a resource directory for images. I have used an English Essay font – it’s a beautiful calligraphy font, free for non-commercial use. You can download it from here. Copy the .ttf file into the fonts directory. Then save the butterfly_image.jpg picture, and place it into the images directory.

butterfly

OK, now it’s time for the .html page! Continue reading Tutorial: Using WebView to load the html page from Assets

JavaScript Tutorials for Beginners

Recently I have found a link to the Channel 9 Javascript Fundamentals: Development for Absolute Beginners Tutorials!

They really are for absolute beginners, so for somebody who works with JavaScript almost every day they would seem quite boring 😉
However for somebody who just started to learn or wants to learn JavaScript in the nearest future, these videos by Bob Tabor would be very and very useful!

Happy coding 🙂

Android IDE: Eclipse or IntelliJIDEA?

This post I would like to dedicate to Android IDEs. Why? First of all, it’s really important to have a convenient programming environment in order to make apps effectively. Secondly, you would be more happy to work in IDE that just looks nice and works without delays.

I’d start from the hardware. My computer at work has 4GB of RAM, Intel Core i5 with 3.3GHz processor and Windows 7 installed on it. At home I have almost the same configuration except that I have Windows 8 Release Preview as my OS.

One might think those configurations are OK for software development. Oh, I wish this was true… After using Eclipse for about 1.5 year I know what a nightmare it can be to write apps on those computers.
Continue reading Android IDE: Eclipse or IntelliJIDEA?