• Breaking News

    Monday, June 13, 2022

    Android Dev - Weekly discussion, code review, and feedback thread - June 13, 2022

    Android Dev - Weekly discussion, code review, and feedback thread - June 13, 2022


    Weekly discussion, code review, and feedback thread - June 13, 2022

    Posted: 13 Jun 2022 05:00 AM PDT

    This weekly thread is for the following purposes but is not limited to.

    1. Simple questions that don't warrant their own thread.
    2. Code reviews.
    3. Share and seek feedback on personal projects (closed source), articles, videos, etc. Rule 3 (promoting your apps without source code) and rule no 6 (self-promotion) are not applied to this thread.

    Please check sidebar before posting for the wiki, our Discord, and Stack Overflow before posting). Examples of questions:

    • How do I pass data between my Activities?
    • Does anyone have a link to the source for the AOSP messaging app?
    • Is it possible to programmatically change the color of the status bar without targeting API 21?

    Large code snippets don't read well on Reddit and take up a lot of space, so please don't paste them in your comments. Consider linking Gists instead.

    Have a question about the subreddit or otherwise for /r/androiddev mods? We welcome your mod mail!

    Looking for all the Questions threads? Want an easy way to locate this week's thread? Click here for old questions thread and here for discussion thread.

    submitted by /u/AutoModerator
    [link] [comments]

    Weekly Who's Hiring Thread - June 13, 2022

    Posted: 13 Jun 2022 06:00 AM PDT

    Looking for Android developers? Heard about a cool job posting? Let people know!

    Here is a suggested posting template:

    Company: <Best Company Ever>
    Job: [<Title>](https://example.com/job)
    Location: <City, State, Country>
    Allows remote: <Yes/No>
    Visa: <Yes/No>

    Feel free to include any other information about the job.

    submitted by /u/AutoModerator
    [link] [comments]

    Put File in asset or res/raw folder?

    Posted: 13 Jun 2022 03:37 AM PDT

    Can you A/B test an app title in play console?

    Posted: 13 Jun 2022 08:12 AM PDT

    Can you A/B test an app title in play console?

    I need to A/B test some app titles, i thought that i could just create an experiment but apparently you cant test it....

    https://preview.redd.it/ol93r4qyme591.png?width=1125&format=png&auto=webp&s=cc0359ebb0aa4b0c7d9675f719f33721c9999f35

    Am i missing something or this is just not possible?

    submitted by /u/Baccho_4h
    [link] [comments]

    Error generating Android app with Cordova Plugin - "Duplicate class com.google.gson...."

    Posted: 13 Jun 2022 07:57 AM PDT

    Hello everyone,

    I'm trying to generate an Android app which uses a Cordova Plugin, and I've tried everything and couldn't manage to solve the following error:

    Execution failed for task ':app:checkDebugDuplicateClasses'. [2022-06-13T14:48:03.937Z] [VERBOSE] [Build] > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable [2022-06-13T14:48:03.938Z] [VERBOSE] [Build] > Duplicate class com.google.gson.DefaultDateTypeAdapter found in modules jetified-gson-2.6.2 (com.google.code.gson:gson:2.6.2) and jetified-mposSDKRelease-runtime (:mposSDKRelease:) [2022-06-13T14:48:03.938Z] [VERBOSE] [Build] Duplicate class com.google.gson.ExclusionStrategy found in modules jetified-gson-2.6.2 (com.google.code.gson:gson:2.6.2) and jetified-mposSDKRelease-runtime (:mposSDKRelease:) [2022-06-13T14:48:03.938Z] [VERBOSE] [Build] Duplicate class com.google.gson.FieldAttributes found in modules jetified-gson-2.6.2 (com.google.code.gson:gson:2.6.2) and jetified-mposSDKRelease-runtime (:mposSDKRelease:) [2022-06-13T14:48:03.938Z] [VERBOSE] [Build] Duplicate class com.google.gson.FieldNamingPolicy found in modules jetified-gson-2.6.2 (com.google.code.gson:gson:2.6.2) and jetified-mposSDKRelease-runtime (:mposSDKRelease:)

    The list goes on with similar logs.

    Does anyone know what I should do to fix these errors? I have the 'build.gradle', 'build-extras.gradle' and 'gradle.properties' files.

    submitted by /u/BolotoF
    [link] [comments]

    will the splash screen api in API 32 work same for the Android 11 or lower devices??

    Posted: 13 Jun 2022 07:56 AM PDT

    Please correct me if I am wrong.

    submitted by /u/Upper_Nectarine_7030
    [link] [comments]

    Creating Android app which can record video at 120FPS.

    Posted: 13 Jun 2022 07:50 AM PDT

    Hi Everyone,

    I'm looking to create an Android app which can use the some specific features of the camera, e.g., recoding a video at 120FPS. Is there a react-native library which can do that? I tried using 'react-native-vision-camera' but that shows support only for 60FPS and not 120FPS. I have a pixel 4a and I know it supports 120FPS. Any suggestions would be really helpful.

    Thanks for your time!

    submitted by /u/kudekar
    [link] [comments]

    Can we write a room db type converter to convert from string to string? I need to make some data processing before it get stored.

    Posted: 13 Jun 2022 07:49 AM PDT

    Any advice on how to structure Compose functions in an activity/fragment?

    Posted: 13 Jun 2022 03:36 AM PDT

    Compose is making my Activity massive. I would put them in a separate class but my clickable scopes are generally dependent on ViewModel. I am not sure if I should expose the viewModel to a non-lifecycle class.

    But the amount of compose functions needed to build the UI of the screen is affecting the readability.

    Any advice?

    submitted by /u/BKMagicWut
    [link] [comments]

    Can I enable static local IPv4 on Android 12?

    Posted: 13 Jun 2022 07:19 AM PDT

    I don't have home internet service, and instead use my phone's wireless tethering to provide access to my devices. I usually get around ~100mbit so it's been fine.

    I use an app called "Every Proxy" to create a HTTPS/SOCKS5 proxy on my Android device. I then connect to this proxy on my machines (Android TV, Windows, Mac etc). This redirects the traffic through my phone, and effectively bypasses tethering limits.

    This works great. The "problem" is that, since Android 12, the local IP on Android devices is no longer static. It used to always be 192.168.43.1. Now, everytime the device is rebooted, it changes local IPv4s, meaning I have to update the proxy settings among all my devices. This is a minor annoyance, but I'd like to find a way around it if possible.

    Note: This began occurring on my Note 20 Ultra after updating to Android 12, and continues on my S22 Ultra. The problem could actually be OneUI/Samsung's Android 12 distro. I don't know, as I don't have any other Android 12 devices.

    Thanks for the assistance.

    submitted by /u/virtualmnemonic
    [link] [comments]

    Why are browsers allowed to use query_all_apps permission?

    Posted: 13 Jun 2022 03:30 AM PDT

    Ola!

    I would like to understand why browsers are one of the types of apps that are allowed to keep using the permission after Googles update to their policy. Why would a browser make use of that permission?

    The Infor article just mentions "awareness of interoperability". But what would be a concrete example that applies to every browser app?

    submitted by /u/JensJensen
    [link] [comments]

    No ads

    Posted: 13 Jun 2022 06:12 AM PDT

    What are the social channels you follow related to Android programming or general programming? Instagram, YouTube, tiktok..

    submitted by /u/Ok-Present-7144
    [link] [comments]

    as a junior android dev what should i study, use and get better at using to become middle

    Posted: 12 Jun 2022 01:33 PM PDT

    for now i am studying and trying to write unit tests and ui tests

    i have 4 months of experience

    submitted by /u/MolassesOtherwise942
    [link] [comments]

    Does anyone use Google Pay as payment gateway for their app?

    Posted: 13 Jun 2022 04:08 AM PDT

    Hi, I want to try Google Pay for one of my project and I have a several question regarding the use of Google Pay.

    1. Where can you create/setup your UPI?
    2. What country it can support (Android)? Google Pay in iOS said to only support US and India. I check this page but it doesn't mention any countries.
    3. What are the main limitation of using this service?
    4. What sort of security should be perform when using it? Like protecting the UPI information?
    5. Where can you track all the transaction?

    If you know any blog or tutorial that can help would be very appreciated. Thank you in advance.

    submitted by /u/Interesting_Music464
    [link] [comments]

    Any of you making any money by selling android *library*?

    Posted: 13 Jun 2022 04:00 AM PDT

    If yes, then what, how and where.

    Thanks for your attention.

    submitted by /u/Present-Effective-52
    [link] [comments]

    Is using Lua to make an app for Android still possible?

    Posted: 12 Jun 2022 04:37 AM PDT

    I recently heard about someone using Lua for Android development. I try searching out, just to learn about it.

    I found this library, but fail to get it to compile on my machine https://github.com/qtiuto/lua-for-android
    I also found this https://github.com/kigkrazy/luaj-android, but also fail to get it compiled. Seems like it is not supported on the latest Gradle 7.x

    Does anyone know if it is still possible to use Lua to make an Android App? (using the latest Android Studio Chipmunk)

    submitted by /u/ElyeProj
    [link] [comments]

    anyone know what this weird optomization app is for ?

    Posted: 13 Jun 2022 05:24 AM PDT

    anyone had a "error: package R does not exist" before? I can't get this to go

    Posted: 12 Jun 2022 04:21 PM PDT

    Since adding an Assets folder to my project I now get:

    error: package R does not exist "return new ActionOnlyNavDirections(R.id.action_newAlarmFragment_to_homeFragment);" 

    which is from this auto generated code:

    import androidx.annotation.NonNull; import androidx.navigation.ActionOnlyNavDirections; import androidx.navigation.NavDirections; public class SetNewAlarmFragmentDirections { private SetNewAlarmFragmentDirections() { } @NonNull public static NavDirections actionNewAlarmFragmentToHomeFragment() { return new ActionOnlyNavDirections(R.id.action_newAlarmFragment_to_homeFragment); } } 

    I have tried cleaning and rebuilding the project and tried "Invalidate caches and restart". Removing the assests folder does nothing, so it might not even be the assets folder and commenting out the nav code like below also does nothing.

    Looking through other answered questions here it seems it can be an import of R. somewhere causing this, but I can't find anything..

    The NavDirection itself comes from this fragment and three others that are basically doing the same in terms of navigation:

    import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.CompoundButton import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider import androidx.navigation.Navigation import com.pleavinseven.alarmclockproject.alarmmanager.AlarmManager import com.pleavinseven.alarmclockproject.data.model.Alarm import com.pleavinseven.alarmclockproject.data.viewmodel.AlarmViewModel import com.pleavinseven.alarmclockproject.databinding.FragmentSetNewAlarmBinding import com.pleavinseven.alarmclockproject.util.TimePickerUtil import java.util.* class SetNewAlarmFragment : Fragment() { private val timePickerUtil = TimePickerUtil() lateinit var binding: FragmentSetNewAlarmBinding private lateinit var alarmViewModel: AlarmViewModel override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View { binding = FragmentSetNewAlarmBinding.inflate(inflater, container, false) binding.fragmentCreateAlarmRecurring.setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener { _, isChecked -> if (isChecked) { binding.fragmentCreateAlarmRecurring.visibility = View.VISIBLE } else { binding.fragmentCreateAlarmRecurring.visibility = View.GONE } }) alarmViewModel = ViewModelProvider(this)[AlarmViewModel::class.java] // binding.fragmentBtnSetAlarm.setOnClickListener(View.OnClickListener { _ -> // scheduleAlarm() // Navigation.findNavController(requireView()) // .navigate(SetNewAlarmFragmentDirections.actionNewAlarmFragmentToHomeFragment()) // }) return binding.root } 
    submitted by /u/yerba-matee
    [link] [comments]

    Camcorder: Tool to create, preview, and save GIFs using Compose Desktop

    Posted: 12 Jun 2022 07:13 AM PDT

    Fresh Android intern, how should I approach large codebase for enterprise apps? Grant me you guidance r/Androiddev :)

    Posted: 12 Jun 2022 09:44 AM PDT

    tl;dr Got accepted in an internship and I'm given a few days to dive into the codebase until I'm given tasks, what to do?

    Their app is big, not gigantic big and certainly grokkable, about 25-30 fragments, split into 5 modules, is a payment system app so there's a lot to do with keys, encryption, security, etc (things I literally know nothing about but I'm very excited to start researching them).

    So far I've been stuffing the app with log statements on Main Activity and the initial Fragment on almost all of their methods so that I can grok the app's workflow, what calls what and when, and will work my way to the other Fragments with logs. Am I on the right track? What else should I do?

    For people who were in my position and were initially anxious about an intimidatingly large codebase at your first/new work, how did you get through it?

    submitted by /u/ED9898A
    [link] [comments]

    A question related to Facebook and Android Media Playback.....!

    Posted: 12 Jun 2022 01:16 PM PDT

    Just out my curiosity - For a long time while watching videos on Facebook i have noticed it can automatically pause my own device background music Playback. What bugging me is that why can it resume the playback after the video i was watching is finished or i moved on to watching something else?!!! Like i can play whatever i like in background while surfing right? Why does Facebook have the knowledge of if I'm playing anything or not and not only that it can control it?!!

    submitted by /u/DrkXo
    [link] [comments]

    is firebase cloud storage a good choice for an video based app?

    Posted: 12 Jun 2022 01:50 PM PDT

    I've been using firebase cloud storage for a long time, but up until now I only needed to store images and zip files. But now there is a new demand to create a video based platform, where users can post and see video of other users (mainly short videos), but I never worked with this type of content on firebase, so I don't know if the price is good or bad...even the cloud storage calculator doesn't show this (only shows about images). So, anyone knows if firebase cloud storage is a good service for this new platform or is it to expensive when it comes to videos? Also, if you know any other services for this, I would appreciate.

    submitted by /u/Baccho_4h
    [link] [comments]

    what is the best practice to get room database two table join in a dao class. what should be the return type?

    Posted: 12 Jun 2022 08:53 AM PDT

    Most of the subscriptions in Google Play console showing as Payment Pending after free trail

    Posted: 12 Jun 2022 05:01 AM PDT

    After completing the free trail for 7 days almost 80% of the subscriptions are showing as Payment Pending. Please let me know if anybody facing the same issue. Normally how long does google play takes to show the Payment as Charges for the pending subscriptions.

    submitted by /u/sri_346
    [link] [comments]

    How to change state while changing locale in Jetpack compose? Able to change the locale but strings are not changing in Jetpack Compose.

    Posted: 12 Jun 2022 07:29 AM PDT

    No comments:

    Post a Comment