October 22, 2024
Chicago 12, Melborne City, USA
Android

How to make the first element of each row in Jetpack Compose take the maximum width?

In my case the first element in each row can be of different widths how can I make them all have the same maximum width? I placed the elements in 2 different columns but then it’s hard to align them vertically So I need to somehow calculate the maximum width of each first element, and

Read More
Android

Can I promote Premium via self-ads?

I’m working on an Android app where I don’t want to sell subscriptions directly through Google Play. Obviously, I know I can’t include external links or anything for purchasing via a third-party provider. However, I was wondering if it would be allowed to show my own ads (banners, interstitials, etc.) by implementing AppLovin or a

Read More
Android

How are the default version of dependencies for an Android project determined?

What criteria are used to set the versions of the libraries that are automatically added to the dependencies when creating an Android project? like that dependencies { implementation("androidx.core:core-ktx:1.13.1") implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.6") implementation("androidx.activity:activity-compose:1.9.2") implementation(platform("androidx.compose:compose-bom:2023.08.00")) implementation("androidx.compose.ui:ui") implementation("androidx.compose.ui:ui-graphics") implementation("androidx.compose.ui:ui-tooling-preview") implementation("androidx.compose.material3:material3") testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.2.1") androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1") androidTestImplementation(platform("androidx.compose:compose-bom:2023.08.00")) androidTestImplementation("androidx.compose.ui:ui-test-junit4") debugImplementation("androidx.compose.ui:ui-tooling") debugImplementation("androidx.compose.ui:ui-test-manifest") } I tried the following, but the version of the newly created project

Read More
Android

Using AndroidFragment inside Compose BottomNavigation gets recreated

I have a MainActivity using Jetpack Compose to set up a Scaffold with a BottomBar. The BottomBar manages a NavHost containing composables, which include AndroidFragment. When switching between tabs, I notice the fragments are recreated. How can I retain the fragments so they don’t reload their data? internal fun NavGraph( navController: NavHostController, modifier: Modifier =

Read More
Android

Save data class into protobuf data store

I am working on an app which is receiving data from an endpoint. I used to save a backup of this data into the Shared Prefrences but as the object is complex the JsonToString and StringToJson serialization is not efficient specifically when there is an update in the data class. In case, the app is

Read More
Android

Android Modular Library and App data exchange

I get data in my android kotlin app and map them in class Client. now I want to send this data to my modular lib and make some changes. Lib does not know about client class. My lib has function mapToClientData(someVariable: SomeClass). This function will remap this data that my app has (or any other

Read More
Android

Mollie checkout URL not showing in Android Webview

In my Android App built using Jetpack Compose and Kotlin, I am using Android Webview to load Mollie checkout url for payments. The URL (https://www.mollie.com/checkout/select-method/SOMECODESPECIFICTOPAYMENT) shows content like this Initially everything was working and Android Webview was loading Mollie URLs properly, but now the users on live app are facing issue of empty page display,

Read More
Android

Android 15. Edge to edge mode hide a top View

I have a Pixel 6 device and updated today Android version to 15. I test a simple activity for Android 15 and see that a part of top TextView is hiden. I guess this is a bug of edge-to-edge mode. How to disable this mode or fix this problem? I tryed many ways to show

Read More
Android

Selecting and loading a *.json file using Expo DocumentPicker in older versions of Android

In React Native Expo project, I am using Expo DocumentPicker to select a JSON file and load it into the application. On modern version of Android there is no problem with this, in file explorer I select the desired JSON file and upload it. But on older versions of Android( 7, 8) I can’t select

Read More
Android

How to allign textView with bullet points in a linear layout in Android

I have the following XML layout file <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".FR_Options"> <HorizontalScrollView android:layout_width="match_parent" android:layout_height="wrap_content" android:fillViewport="true"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:orientation="vertical" android:padding="5dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:text="@string/cap_efficiency" android:textSize="13sp" android:textStyle="bold" /> <ImageView android:layout_width="250dp" android:layout_height="160dp" android:src="@drawable/facts_efficiency_english" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/info_efficiency_test" android:textSize="8sp" /> </LinearLayout> </LinearLayout> </HorizontalScrollView> </FrameLayout> with the

Read More