Hi all,

Me my self an android developer and we know that most of the developer usually work on an android platform with architecture for better code maintenance and reliability. Mostly used architectures are MVVM, MVI or anything done by our own :P.

So here what we gonna see much about MVVM in flutter which is helpful for an android developer who wanna do code in Flutter.

Let's see,

Photo by Edi Libedinsky on Unsplash

Before start, those who have a question “what the heck is MVVM?“ let us see the answer.

The Model-View-ViewModel Pattern

The main players in the MVVM pattern are: The View —…


Photo by Element5 Digital on Unsplash

Hi,

This is me, we gonna look at how to get location from the device Android, Ios and Web as well.

It's quite straight forward by using the following flutter dependency.

Following the above documentation, we can get set up permissions, enable location in the device and get the current location as well.

So what I did something new here is create a manager class that still does the same thing but in an efficient manner in the coolest way.


This library WebView Logger(WVL) gets the logs from the console without using remote logging chrome://inspect.

Photo by Markus Spiske on Unsplash

Notable usage

  1. View Logs from WebView(ConsoleLogs)
  2. Send logs to mail

Add below line in Project.gradle

repositories {      //... other repos maven 
{
url "https://dl.bintray.com/arulmani/WebKit"
}
}

Add below line in App.gradle under Dependecy section

implementation 'com.arul.webkit:wvl:1.0.4'

That’s it sync the project.

We can configure mail and cache size of log tobe store. Add below line in strings.xml .

<string name="wvl_report_email">sample@mail.com</string> 
<string name="wvl_log_cache_size">20</string>

Adding web chrome client for WebView follow below implementation

That’s it now we can see logs

Open WVL first then open the WebView logger…


Photo by Sergio Martínez on Unsplash

Hy fellas, We face a lot of issues in implementing camera into your projects and it took some time to complete the implementation part which includes reading all documentations and the capability of devices(Android Version).

So I created an open-source package(Mini-camera) which is helps the developer to integrate the camera into the project without any hassle. With four lines of code, you can get camera support into your project.

Mini-Camera uses CameraX library

def camerax_version = "1.0.0-rc01"
implementation "androidx.camera:camera-camera2:${camerax_version}"
// If you want to additionally use the CameraX Lifecycle library
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
// If you want to additionally use the CameraX View class
implementation "androidx.camera:camera-view:1.0.0-alpha20"
//…

Hi there,

By default, Android will try to load resources based on the System language that is set on the user’s phone. Therefore, if a Tamil language user, Kavi, with her Android set to the Tamil language opened our android application on her phone, she’d see an app localized to her own language.

But what if another user wants to use the Tamil language for his android application on an Android that has its default language set to English?

To deal with this, we will have to programmatically update the locale of our android application to override the default locale…


A simple example of converting java interface callback into Kotlin function callback.

For example, in java, we use to interface to get a callback inside to do some work. In java,

First, need to declare an interface,

interface OnDialogOkClickListener {
fun onDialogOkClicked()
}

Then the implementation will be,

// In java 7
showPrompt("title", "message", new OkDialogOkLisneter() {
@Override
public void onOkClicked() {
// Do something you here want when user click ok in prompt
}
})
// In Java 8
showPrompt("title", "message",() -> {
// Do something you here want when user click ok in prompt
})

When you use…


Every Android developer knows how time taking is to create a new project from the scratch so rectify this android development have special architecture called modules architecture. We can reduce time, reuse the code by configuring into your project here is an elaborated guide to a modular architecture.

Photo by Ashkan Forouzani on Unsplash

Creating a module is pretty simple thanks to the android studio by following steps its do work for you.

To add a new module to your project for a new device, proceed as follows:

  1. Click File > New > New Module.
  2. In the Create New Module window that appears, Android Studio offers…

Hello world,

I have working on my project which is seamlessly communicate HTML page (Includes javascript) which is loaded in WebView. The communication mostly consumes data from API or local DB send back to the WebView to populate in HTML.

Its quite simply explained in this following thread

Then where is the Problem !!!

@JavascriptInterface  
public void setWebViewTextCallback() {
// here !!!
}

The javascript interface we added in WebView and the callback method (Annotated JavascriptInterface) works in Background Thread.

Background thread can’t touch the main thread view that is wroten inscription ancient times.

Solution

Its Simple,

We can…

Arul mani

Dreamer | Doer | Mobile Application Developer(Android, Flutter). Find me: https://www.linkedin.com/in/arulmani33/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store