Skip to content

ThirteeNov

My personal blog about coding and internet

Menu
  • About me
  • About Zofia Kreasi
  • Cart
  • Checkout
  • Making an airplane game from scratch in Unity
  • My account
  • Privacy Policy
  • Privacy Policy – zkLeaderboard
  • Sample Page
  • Shop
  • Tutorials on Learning JavaScript
  • ZKAccounts – Privacy Policy
Menu

Category: Android

why coding a mobile app directly in Android Studio seems complicated?

Posted on March 15, 2025March 15, 2025 by Habibie

Coding a mobile app directly in Android Studio can seem complicated for several reasons: 1. Steep Learning Curve 2. Complex Project Structure 3. UI Development Challenges 4. Device & OS Fragmentation 5. Emulator & Debugging Issues 6. Permissions & Security 7. Updating SDKs & Dependencies Easier Alternatives? If native Android development feels overwhelming, you can…

Read more

Save Android Webview Content as PDF File

Posted on February 3, 2020February 3, 2020 by Habibie

Hello everybody! What you are seeing here is an Android app that shows a local html file inside a Web View. Then on top of the web view there is a button to save web view contents as a pdf file. Pdf file is saved localy after you tapped the button and you can open…

Read more

Adding html file inside assets folder (Creating HTML5 Android WebApp)

Posted on December 11, 2019December 12, 2019 by Habibie

Now we are ready to add our html file inside assets folder. Create a folder named assets and put your html file there. Then build the app. You will see your app is running displaying that html page. This code is for html sample page used in this tutorial:

Read more

Edit the MainActivity.java file (Creating HTML5 Android WebApp)

Posted on December 11, 2019December 12, 2019 by Habibie

The next step is to edit MainActivity.java file. Copy and paste this code to your MainActivity, but remember keep your package name unchanged, my package name is “com.thirteenov.lightweightnotetaker” so you must your own package name as it is your unique app identifier.

Read more

Adding the WebView to activity_main.xml in Android Studio (Creating HTML5 Android WebApp)

Posted on December 11, 2019December 12, 2019 by Habibie

The next step is to add WebView to your layout file in Android Studio. Delete everything in your layout before adding WebView. Then after you drag and drop the WebView, you need to make it full screen. Make sure you set the constraint correctly and set the layout-width and layout-height to match constraint. Give it…

Read more

Creating New Android Project (Creating HTML5 Android WebApp)

Posted on December 11, 2019December 12, 2019 by Habibie

As usual, to create a new project of anything, in this case Android project, we just need to follow the dialog wizard. I named this project LightWeight NoteTaker, a light weight html5 note taking app. The package name of this app is “com.thirteenov.lightweightnotetaker” . So basically we need that package name as a unique identifier…

Read more

Let’s create an HTML5 based Android web app

Posted on December 11, 2019December 12, 2019 by Habibie

Hi, I’m going to start creating an HTML5 based Android web app. I’ve just Installed Android Studio and it’s getting ready now (it’s currently downloading some updates before I can use it). So basically, the idea behind creating Android WebApp is to have a WebView in the app and we create everything (the content) inside…

Read more

How to check is the device connected to internet or not in Android

Posted on August 9, 2018August 4, 2020 by Habibie

With this simple snippet, we can check is the device is connected to internet or not: private boolean isConnected(){ ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); return activeNetworkInfo != null && activeNetworkInfo.isConnected(); } So this “isConnected()” returns true if it’s connected, otherwise it returns false.

Read more

Listing image files in a directory and populate a ListView from it in Android

Posted on August 6, 2018August 4, 2020 by Habibie

I have a directory in sdcard called “mydir” and there are lot of .png image files with another files. Then I want to list only that .png files and populate a ListView from it. I do it like this: String path = “/sdcard/mydir”; File directory = new File(path); if (!directory.exists()){ directory.mkdir(); } File[] files =…

Read more

Simple clickable Android ListView example

Posted on August 5, 2018August 4, 2020 by Habibie

Follow this short tutorial to create a ListView in Android. First let’s create the list view element in our layout file: <ListView android:id=”@+id/lblistview” android:layout_width=”match_parent” android:layout_height=”match_parent” android:layout_marginBottom=”8dp” android:layout_marginEnd=”8dp” android:layout_marginStart=”8dp” android:layout_marginTop=”8dp” app:layout_constraintBottom_toBottomOf=”parent” app:layout_constraintEnd_toEndOf=”parent” app:layout_constraintStart_toStartOf=”parent” app:layout_constraintTop_toTopOf=”parent” /> Then in your Java file: lblist = (ListView)findViewById(R.id.lblistview); String[] items = new String[3]; items[0] = “First item”; items[1] = “Second item”;…

Read more

JSON to Object and Array in Java

Posted on August 5, 2018August 4, 2020 by Habibie

Try this snippet to convert JSON text into object and/or array in Java: JSONObject object = new JSONObject(jsontext); JSONArray array = jsonObj.getJSONArray(“somearray”); for (int i = 0; i < somearray.length(); i++) { JSONObject item = somearray.getJSONObject(i); String somevalue = item.getString(“somekey”); } jsontext is your JSON text.

Read more

Listing all files in a directory in Android

Posted on August 5, 2018August 4, 2020 by Habibie

Let’s say we have a directory in device’s storage called “mydir” and there are files inside it. By using this snippet we can list all names of that files and folders: String path = Environment.getExternalStorageDirectory().getAbsolutePath() + “/maktabamajaziya”; String downloadedbooks = “”; File directory = new File(path); File[] files = directory.listFiles(); for (int i = 0;…

Read more

Requesting permission in run time in Android

Posted on August 5, 2018August 4, 2020 by Habibie

If we are making an app for Android greater than SDK 23, we need to request some sensitive permissions (for example, to write file in external storage) in run time. Here is a snippet to do so: if (Build.VERSION.SDK_INT >= 23) { if (checkSelfPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) { } else { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1); }…

Read more

If a folder (directory) is not existed, create it – Android Java Snippet

Posted on August 5, 2018August 4, 2020 by Habibie

With this snippet, we are able to check if a folder existed in device’s storage or not. If not, then we create it. Here is the snippet: File directory = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + “/afolder”); if (! directory.exists()){ directory.mkdir(); }  

Read more

Picking an Image and Taking Photo in Android – Java source code

Posted on April 27, 2018August 4, 2020 by Habibie

This is Java source code for Android, providing you with two functions: to take a photo using camera and to pick an image from gallery.

Read more

Getting user’s latitude and longitude in Android – Java source code

Posted on April 26, 2018August 4, 2020 by Habibie

In this example, user’s device is showing it’s current latitude and longitude every 5 seconds. Coordinates are displayed inside Android Toast.

Read more

Pick an Image from Android device and upload it to server using PHP

Posted on April 25, 2018August 4, 2020 by Habibie

To upload an image from Android device to online server using PHP, first we need to create a PHP script to handle “post” request and store the image to a folder. So write this simple script on your server:

Read more

How to make Android’s WebView opens a link inside or outside current app?

Posted on April 24, 2018August 4, 2020 by Habibie

Initially if we use a WebView in our Android app, if there is a link and we click it, an intent manager is being called and asking how do we want to open that link. But we can manage it to open that link inside current that WebView or regular web browser.

Read more

Custom error page for Android’s WebView

Posted on December 3, 2017August 4, 2020 by Habibie

When you develop Android Web App, you may want to show loading bar or anything when the web view is still loading a page, so your web app looks nice.

Read more

Pick an image from Android gallery and load it on ImageView & Webview together

Posted on December 2, 2017August 4, 2020 by Habibie

I’m developing an app that the user should choose an image from Android gallery and then automatically loaded into Android ImageView and WebView together.

Read more

Posts pagination

  • 1
  • 2
  • Next
ciihuy2020

Welcome!

  • My YouTube Channel
  • My GitHub Page
  • About me

Categories

  • 3DVista
  • Android
  • Apache
  • C#
  • Cordova
  • Electron & Node JS
  • HTML5, CSS & JavaScript
  • iOS
  • Let's Make Unity Games
  • Misc
  • Photoshop
  • PHP
  • Python
  • Uncategorized
  • Unity
  • WordPress

Recent Posts

  • Hover Reveal script for Unity to show and hide object on mouse hover
  • How to Prevent UI Clicks in Unity from “Bleeding Through” to 3D Objects Behind Them
  • Make objects like wires and cables easily in Unity using Ciihuy Curved Mesh
  • [SOLVED] Can’t Add Custom Domain to Blogger After Losing CNAME Verification
  • iOS App Icon Generator by CiihuyCom
© 2025 ThirteeNov | Powered by Superbs Personal Blog theme