• Breaking News

    Sunday, January 3, 2021

    Android Dev - Google should stop Lifetime ban for developers account.

    Android Dev - Google should stop Lifetime ban for developers account.


    Google should stop Lifetime ban for developers account.

    Posted: 03 Jan 2021 01:04 AM PST

    Google should stop Lifetime ban for developers account. You can ban for 6 months, 1 year or 5 years. But why lifetime? People make mistakes and learn from their mistakes.Now I feel like I killed someone and they gave me death penalty.

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

    Scala 2.13 on Android (with GraalVM and Gluon Mobile)

    Posted: 03 Jan 2021 05:16 AM PST

    Hi all,

    As you may know, it is possible to write Android apps in Scala, but usually it means being stuck with Scala 2.11 which is quite old, with old versions of libraries, and some hacks and tricks. To the point that even though I work with Scala on Android, I wouldn't start a new project this way.

    But recently there were some new developments. GraalVM is able now to create a native image for Android, and Gluon Mobile provides widgets and communication with Android OS. In the last few days I tried to put this all together and document it. And here you go, a dummy app written in Scala 2.13:

    https://github.com/makingthematrix/scala_android_dummyapp

    It's still a pretty much uncharted territory. A lot of questions need to be answered before we can say that it's actually a reasonable way to write Android apps. But I think I like and I will write more about in close future.

    Let me know what you think :)

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

    �� A curated list of awesome Android articles sorted by topic.

    Posted: 03 Jan 2021 12:59 AM PST

    Composition vs Inheritance with Kotlin!

    Posted: 02 Jan 2021 12:54 PM PST

    27 December — 2 January Android Newsletter

    Posted: 03 Jan 2021 04:59 AM PST

    Stay up to date with Android development, in this week's edition:
    🎉 Find the 8 best things in Android Development 2020
    ⏱️ Improve your code with the Systrace
    ☔ Master the null checks in Kotlin
    🏢 Build a complex RecyclerView easily
    and much more!

    Read it here 👉 https://vladsonkin.com/android-newsletter-27/
    What's your favorite one?

    🔥Featuring @abbas_oveissi @imShreyasPatil @elye_project @eric_ampire @AlexanderLeont8 @programmerr47 @jmuseyibli and many other great authors!

    💚 Subscribe and receive new editions directly to your email. Weekly, no spam, unsub anytime.
    Here is an example: https://mailchi.mp/c5ea1259ffb2/android-newsletter-27

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

    Should a newbie use jetpack compose?

    Posted: 03 Jan 2021 04:54 AM PST

    Hi i have experience creating apps with flutter I didn't understand declarative ui functional reactive architectures like bloc redux etc. So i switched to native android for learning and programming with basic architectures like mvp, mvvm to understanding new decorative ui architectures in future (bloc is based on mvvp i think) and also get rid of state management i have seen new jetpack compose it is declarative too what am i should to do? as begginer Should i start learning android development in 2021 with jetpack compose? Or I should (can) learn xml and layouts before ?

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

    Is AdGem paying?

    Posted: 03 Jan 2021 02:10 AM PST

    I've recently joined Adgem, revenue seems amazing, but I've only joined a couple of months or so and their website doesn't have payment terms. Any idea?

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

    Can you properly restore the RecyclerView scroll position when using Paging (3) without placeholders?

    Posted: 03 Jan 2021 01:41 AM PST

    I can't manage to restore the scroll position of a RecyclerView after process death once I've scrolled a few pages into the data set when using Paging 3. It works if I just scroll through the first page, kill the process, and go back into the app. But once I scroll to pages further down, the scroll position either restarts at 0 or at the end of page 1, waiting for the next page to load.

    It works if I enable null placeholders because then all items are there right away, but for this, I have to know the size of the total data set (+ some other caveats)

    I don't know if restoring the scroll position is even possible when not using placeholders because the pages are not there yet after the app was started. Hence the RecyclerView can not jump somewhere into the middle of the list.

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

    Help...

    Posted: 03 Jan 2021 07:38 AM PST

    Keep getting this error

    Posted: 03 Jan 2021 03:51 AM PST

    Whenever I try to switch the app from dark mode to light mode I keep getting this error that says:

    java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class com.google.android.material.button.MaterialButton$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/allCountriesButton. Make sure other views do not use the same id.

    here is a snippet of my code:

    public class MainActivity extends AppCompatActivity { Button allCountriesButton, byCountryButton; SwitchCompat switchButton; SharedPreferences sharedPreferences; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); allCountriesButton = findViewById(R.id.allCountriesButton); byCountryButton = findViewById(R.id.byCountryButton); sharedPreferences = getSharedPreferences("nightModePrefs", Context.MODE_PRIVATE); allCountriesButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, AllCountriesData.class); startActivity(intent); } }); byCountryButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, DataByCountry.class); startActivity(intent); } }); switchButton = findViewById(R.id.switchButton); nightModeActivated(); switchButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); saveNightModeState(true); recreate(); } else { AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); saveNightModeState(false); recreate(); } } }); } private void saveNightModeState(boolean nightMode) { SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putBoolean("isNightMode", nightMode); editor.apply(); } public void nightModeActivated() { if (sharedPreferences.getBoolean("isNightMode", false)) { switchButton.setChecked(true); AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); } else { switchButton.setChecked(false); AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); } } 

    <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Covid-19 Cases" android:textSize="45sp" android:textColor="?attr/primaryButtonColor" android:layout_centerHorizontal="true" android:layout_marginTop="70dp"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/allCountriesButton" android:text="All Countries" android:textColor="@color/white" android:backgroundTint="?attr/primaryButtonColor" android:layout_centerInParent="true"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/byCountryButton" android:text="BY Country" android:textColor="@color/white" android:backgroundTint="?attr/primaryButtonColor" android:layout_below="@id/allCountriesButton" android:layout_centerHorizontal="true"/> <androidx.appcompat.widget.SwitchCompat android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/switchButton"/> </RelativeLayout> 
    submitted by /u/genius_dp
    [link] [comments]

    Harmony v1.1.3 - Multiprocess SharedPreferences

    Posted: 02 Jan 2021 07:26 PM PST

    Cross-posting from r/android_devs (https://www.reddit.com/r/android_devs/comments/kpcjvf/harmony_v113_multiprocess_sharedpreferences/)

    After several procrastinating months (partially due to the pandemic), I have finally gotten around to getting this release done: https://github.com/pablobaxter/Harmony

    Shameless spiel about Harmony -- Harmony is a thread-safe, multi-process safe SharedPreferences
    implementation. It began as a challenge to see how well FileObserver
    and FileLock
    worked in Android, and slowly morphed into what it is now.

    What's new?

    I made several improvements on Harmony, with the main one being the time to replicate changes made to SharedPreferences
    across all processes of the app (now ~150 ms on average). The more minor ones are bug fixes with crashes, and not being able to store more than 64KB strings.

    How does it work?

    The basic gist of it... It writes changes made via calls to apply()
    or commit()
    as single transactions to a file, which is listened to by a FileObserver object, notifying any process of the changes to the file. In turn, these other processes read the transaction from the file, and apply the changes to memory. When this "transaction" file reaches a certain size, the state of all preferences are flushed into a "main" file.

    Wait... reading and writing to a file at the same time? Sounds dangerous.

    I'm able to do so with the use of FileLock, which I use as a reentrant lock between processes (check out https://github.com/pablobaxter/Harmony/blob/main/library/src/main/java/com/frybits/harmony/internal/HarmonyFileUtils.kt). A simple synchronized block prevents multiple read/writes within the same process.

    Any feedback, questions, reviews, comments, or criticism would be greatly appreciated!

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

    What is Google's stance on usage of WIFI broadcast over local network?

    Posted: 03 Jan 2021 06:16 AM PST

    I've developed an app which uses broadcasts over local network to communicate with other instances of the app on the same network, intended to be used with one user creating a hotspot and the other members of the group joining it (standard p2p wasn't effective for my use case as it requires the users to confirm each connection).

    While I am aware that this may not be the most suitable approach, I can't help but wonder what Google's stance on such broadcasts? It required some lines of code which look "hacky" to me, such as System.setProperty("java.net.preferIPv4Stack", "true") .

    This is a project designed to help my father and his band and I currently have no plan of distributing it over Play Store, but I am inclined as to whether I even could without refactoring the sync module of my application. Does anyone happen to have any experience in this matter, please?

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

    Subscriptions in Developer Console are stuck as “inactive”

    Posted: 03 Jan 2021 05:44 AM PST

    I just published my app for internal testing and all my subscriptions are blocked as "inactive". I cannot change the state. The app was published yesterday after 5 days of review, should I wait for the subscriptions to become active? Or am I missing something?

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

    Trying to port Android Studio to M1 (apple silicon/arm), app boots but crashes

    Posted: 02 Jan 2021 06:58 PM PST

    Trying to port Android Studio to M1 (apple silicon/arm), app boots but crashes

    I was working on porting android studio to apple silicon, and combined some files and replaced a few others, the new codesigned app shows up as a universal binary so that looks good. It also shows up as a apple process as expected

    image of activity monitor

    https://preview.redd.it/e8xiq5zn71961.png?width=754&format=png&auto=webp&s=667a4895e8b5ad02a5d42d1586edd250ec7a8382

    It boots the app to this screen, and everything looks good

    However, clicking on something results in the app crashing, and it shows this error message: https://pastebin.com/mWFRwTWk

    What do you think would be the issue? Also is there any word on an offical m1 port?

    Replacing just the jna.jar makes it boot fine, so its not that

    Steps i followed to make universal binary:

    merged/replaced everything under Contents/jre/jdk/Contents with the folder from intellij ultimate native

    replaced the jna.jar with the one from ultimate (in the contents/lib folder)

    replaced the studio executable with the one from ultimate (in Contents/MacOS)

    Any help would be greatly appriciated!

    Steps I followed to make a universal binary: replaced JRE/JDK/Contents with the folder from IntelliJ ultimate native, the new codesigned app shows up as a universal binary so that looks good. It also shows up as an apple process as expected

    This is the file layout in the end:

    https://preview.redd.it/v71tidvl81961.png?width=2064&format=png&auto=webp&s=eb3caffd110ee011d80d5dfa07b5a6347d1ae872

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

    A Few apps on Samsung Galaxy Tab A7 are Stuttering, and have a broken Picture - Is there anything I can tweak to fix this?

    Posted: 02 Jan 2021 07:28 PM PST

    Hey guys,

    I'm having a few issues with the Samsung Tab A7 (2020) a few apps when I play back Media the stream Jitters/Stutters and breaks up. This happens onf a fair few apps. Virgin TV Go mainly.

    I have messed with the usual uninstall/reinstall and change Battery Optimisation modes etc. Nothing seems to be running in the background and to make matters more confusing I switch over to Plex and I can play 4k h265 Files flawlessly, Netflix/Prime is also fine. However like I say Virgin TV Go and Kodi as well as DAZN have the same issue issues. I've got 500MB Internet and that has been ruled out as the issue persists across several networks. Not only that the APPS work on my older Moto G4 and a Really old Nexus (2013). It's like it's a 'Hardware Acceleration' issue

    Issue Video: https://streamable.com/ojulon

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

    react native vs. koltin

    Posted: 02 Jan 2021 05:39 PM PST

    I'm looking to make an app to put on my portfolio. I'm wondering if using react native (javascript) or koltin will seem more impressive to employers or does it not matter. Or is there something i should learn that is more impressive or in demand

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

    Wacky intermittent (dns?) problem.

    Posted: 02 Jan 2021 04:53 PM PST

    Please allow me to post this question here, I don't think I can get answers in other subreddits I know.

    I have this weird problem that starts suddenly, without user interaction from me that I know of.

    The problem is: while using 4g internet one of the following wouldn't load/connect (Youtube and Play store, Twitter, Telegram, Whatsapp). Not the app, not the webpage. It's always just one of them, and the rest would be working.

    THIS DOES NOT HAPPEN ON WIFI, ever.

    I would restart, or remove sim, or airplane mode off/on, or 4g internet off/on. Everything would work for a minute or so, then the problem returns.

    I changed a few things on the phone, most recently a few of Smali Patcher patches and MagiskHide Props Config module, But those were installed days ago. I disabled both modules in magisk but didn't fix the issue.

    I gave up searching how to flush Android DNS but nothing I found works in the terminal.

    I tried a magisk module (CloudflareDNS4Magisk) forcing dns servers on the device to cloudflare, nslookup shows the dns server being used is 8.8.8.8.

    Please help I'm stuck.

    Samsung Galaxy S10 Hades ROM v2.0

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

    Huawei devices are killing foreground services for battery optimization, but apps are breaking because of it?

    Posted: 02 Jan 2021 04:50 PM PST

    Hey guys. I have been tracking down a crash in my app for a while now and I think I've discovered what's going on. My app uses a foreground service so that it can record audio while the app is closed or the phone is locked. On my personal device (Pixel 4a) and on various emulators it works great. But I found on Huawei devices the foreground service seems to be getting killed. This results in a crash in my app because I am assuming the service is still active until it's stopped. Anyway, I looked this up a bit and it seems Huawei has some strict battery optimizations to the detriment of apps. It doesn't sound like there's a good fix for this either (for developers). Even a wake lock doesn't guarantee the service won't be killed.

    I'm wondering if anyone else can confirm this and if there's any suggestions as to what to do. Should I put a warning in the app? One thing a user can do is to turn off battery optimizations themselves for the app, so maybe I should state that somewhere. Any input would be welcomed. Thanks.

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

    Beginner-Bottom Navigation using navigation graph, is it proper?

    Posted: 02 Jan 2021 09:32 AM PST

    I am working on bottom navigation on my Java app where it has 3 menu. When each menu is clicked, they will navigate to their respective fragment.

    I discovered (so far) that there is 3 ways to implement this. First is by using getFragment() on main activity, it worked fine at first but then I encountered fatal error that said something like "onNavigationItemSelected" is null reference. I did try to fix by implementing suggestions from stack overflow and etc but it didn't work so I moved on to another method.

    Second method was by using navigation UI but I still got fatal error. This time it said the host Nav Fragment is null. I tried to fix by looking at the ID and so on..but to no avail..

    so the third method that I tried was by using navigation graph, but I did not see this method anywhere on the Internet so i think it might possibly not the proper way to do it but it works fine so far. So right now my navigation graph looks like this (which is messy) Navigation Graph. What do you think? To me, it looks messy and probably not the right way but it works fine so I'm kinda stuck here.

    TLDR; I'm stuck cause not sure if the method i'm implementing is the proper way (please click on the link to see how my nav graph looks right now). What do you think?

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

    How long until google approves my application?

    Posted: 02 Jan 2021 02:51 PM PST

    I initially submitted the application on December 14 (internal testing / open testing / production) and so far only internal testing has been approved.

    The application is for one of my clients and should have been in production at least a week ago.

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

    No comments:

    Post a Comment