milosev.com
  • Home
    • List all categories
    • Sitemap
  • Downloads
    • WebSphere
    • Hitachi902
    • Hospital
    • Kryptonite
    • OCR
    • APK
  • About me
    • Gallery
      • Italy2022
      • Côte d'Azur 2024
    • Curriculum vitae
      • Resume
      • Lebenslauf
    • Social networks
      • Facebook
      • Twitter
      • LinkedIn
      • Xing
      • GitHub
      • Google Maps
      • Sports tracker
    • Adventures planning
  1. You are here:  
  2. Home

Load local file in the WebView

Details
Written by: Stanko Milosev
Category: Android
Published: 25 August 2015
Last Updated: 04 May 2022
Hits: 4179

Here you can see an example of creating WebView for Android. Problem which I had was to load a local file. Simple answer is like this:

mWebView.loadUrl("file:///android_asset/touchEnd/index.html");

Where android_asset is actually assets folder in Android project. To add assets to the Android project, choose view to Android, right click on the app -> New -> Folder -> Assets folder:


Now the whole code can look something like this:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mWebView = (WebView) findViewById(R.id.activity_main_webview);
        WebSettings webSettings = mWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        mWebView.loadUrl("file:///android_asset/touchEnd/index.html");
    }

Installing Android studio on Ubuntu

Details
Written by: Stanko Milosev
Category: Android
Published: 08 June 2015
Last Updated: 29 June 2015
Hits: 4663

1. You can install Java, just by writing: sudo apt-get install default-jdk in terminal window, or follow these steps: Download Java, in my case I downloaded this one.

2. To install Java, open terminal window, go to the location where you downloaded Java, and write:

tar zxvf jdk-8u45-linux-x64.tar.gz

3. After installing Java write something like:

export JAVA_HOME=/home/myUserName/myDownloadPlace/jdk1.8.0_45

Of course change myUserName/myDownloadPlace.

or write:

sudo gedit /etc/environment

then in environment write:

export JAVA_HOME=/home/myUserName/myDownloadPlace/jdk1.8.0_45

4. Then write:

sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6

5. Finally download Android Studio, extract it, go to bin folder, in my case that is something like:

/home/myUserName/Downloads/android-studio/bin

6. Execute:

./studio.sh

7. Go to File -> Project Structure -> JDK location box: enter and browse to your Java JDK.

8. Download from here and install Java JRE, and I copied downloaded version to folder /home/myUserName/Android/Sdk/tools/lib/monitor-x86_64/jre

Manually installing factory image on Nexus 5

Details
Written by: Stanko Milosev
Category: Android
Published: 24 May 2015
Last Updated: 24 May 2015
Hits: 5242

You can use Nexus Root Toolkit, but I would rather do it manually.

I am using steps from this web site.

First download appropriate image from here. Extract it. Then download latest Android SDK, in my case it was this one. If you don't have it installed already then download Java, and install it of course.

After you finished installing Android SDK leave check box Start SDK manager checked like on picture I am not sure if we need this part, since in folder:

%APPDATA%\Local\Android\android-sdk\platform-tools

AppData is hidden folder...

in my case I couldn't find adb. Anyhow, I've left the check box checked, and was waiting for couple of hours (washed dishes, eating,...):

That will open new window Android SDK manager, just click install packages:

Add %APPDATA%\Local\Android\android-sdk\platform-tools to path in Environment Variables.

Open command prompt in a folder where you previously extracted the image, (in my case that was something like: E:\hammerhead-lmy48b) and execute:

flash-all.bat

and wait until files are not written to the device.

After signing in, to avoid automatic installation of applications in Get your apps & data, from restore from this backup choose setup as new device:

uncheck check box to Backup your phone's app:

My list of best applications

Details
Written by: Stanko Milosev
Category: Android
Published: 15 May 2012
Last Updated: 15 May 2012
Hits: 5485

WebKey
Google Drive
My tracks
Link2SD
Viber
Meebo

  1. Stucked at HBOOT
  2. One more example of responsive design
  3. pointer-events: none
  4. Understanding vertical-align

Subcategories

C#

Azure

ASP.NET

JavaScript

Software Development Philosophy

MS SQL

IBM WebSphere MQ

MySQL

Joomla

Delphi

PHP

Windows

Life

Lazarus

Downloads

Android

CSS

Chrome

HTML

Linux

Eclipse

Page 150 of 165

  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154