• Breaking News

    [Android][timeline][#f39c12]

    Sunday, January 3, 2021

    Google should stop Lifetime ban for developers account. Android Dev

    Google should stop Lifetime ban for developers account. Android Dev


    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]

    Android 11 very slow file access performance.

    Posted: 03 Jan 2021 08:10 AM PST

    Has anyone else noticed very slow file access performance on Android 11?

    I noticed this on my Pixel 2 device after upgrading to Android 11, opening and accessing files seems to become noticeably slower.

    I wasn't sure if it was just me or my device having issues, but I have now had two emails from users of my app complaining about this issue after upgrading to Android 11.

    I am pretty sure its Googles new layer they have put in right down at the OS level in order to support Scoped Storage, it has now made ALL file operations much slower..

    Edit:

    This is using normal access using File, fopen etc. - NOT using SAF. It is accessing files on the internal flash in user space (/sdcard/)

    TESTS

    Just tested by downgrading my Pixel 2 to Android 10 and timing the loading of a game, then upgrading to 11 and doing the same test.

    1:

    Android 10 = 1.2 seconds

    Android 11 = 10 seconds

    2:

    Android 10 = 11 seconds

    Android 11 = 62 seconds

    It is over 6 times slower to load on Android 11

    From the logs I can see a section which loads 17 files, this takes 20ms on Android 10, on Android 11 it is taking 2000ms.

    No idea if related but the performance difference I see would causes issues like this: https://support.google.com/pixelphone/thread/70091441?hl=en

    submitted by /u/emile_b
    [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

    How to promote your app with almost no budget?

    Posted: 03 Jan 2021 02:35 PM PST

    I made an app for learning the parts of a microscope, but im a broke college student how do i get more downloads?

    submitted by /u/godlike-dawn
    [link] [comments]

    Automated Android malware research (GPL-3.0)

    Posted: 03 Jan 2021 01:28 PM PST

    MAD-Pure (Mass APKs Download - Pure) is a tool that downloads list of APKs (file) from APKPure and analyze them using androguard and pwntools: https://github.com/SecTheTech/MAD-Pure/

    Current profile malware:
    - ActionSpy
    - WolfRAT
    - Anubis

    submitted by /u/s3c-7ech
    [link] [comments]

    ConnectivityLifeData for API 16 - API 30

    Posted: 03 Jan 2021 12:54 PM PST

    I made this super lightweight library to enable Android Developers handle network changes across API 16 to 30.

    https://github.com/mbobiosio/ConnectivityLiveData

    Please star if you find it useful. Contributions are welcome.

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

    Android equivalent of iOS' SpriteKit

    Posted: 03 Jan 2021 12:06 PM PST

    I have a background in iOS development and was using Apple's SpriteKit as a framework for 2D board games. Switching to Android (Kotlin), what would be the equivalent? It seems that there is no natively supported 2d game engine (backed by Google), is there?

    I was looking into libgdx but struggled to embed a game into a fragment (not the entire screen/activity). I'm now wondering if I should work on that a bit more or if there's a better way? Cross-platform is not a requirement, pure Android would be enough.

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

    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]

    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]

    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. I just used flutter's basic provider package only

    So I switched to native android for learning and programming with basic architectures like mvp, mvvm I think it will help me to understanding new decorative ui architectures in future (for example bloc and stacked are based on mvvm architecture) and also I can get rid of declarative ui state management

    I saw 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]

    Working on legacy code.

    Posted: 03 Jan 2021 08:30 AM PST

    I am disappointed in the startup that I landed my first job at a week ago. Their app was already published, I guess in 2017, but the last update was committed in July 2019

    First of all, their app was developed back in 2016. There were two developers who were working on the application in different timelines, first dev was working from 16-18 and the second dev was working only 1-2 weeks. Now I as third android dev suppose to work on the app. I got apk file to review the app which turn out to have a lot of bugs and consumes more CPU.

    Second of all, the CEO told me to wait for a week to get the source code from first (original) developer. Okay, I got the source code, and when I saw what state the app is... it was disastrous. When I inherited the git remote repo, there was no documentation for the app. (For example, which package the activities stored, fragments, services, database and so on, at LEAST WRITE DOWN SOMETHING IN README). I took a look at gradle app, where a bunch of unused dependencies were written (50% of them were commented, Idk why), which are mostly UI components and Unit testing. Moreover, gradle app is still at 3.2 ver (I am too scared to update). The facebook login button doesn't work because facebook keep updating their API, consequently, the old methods are deprecated. Also, I had to ask the CEO to create a facebook platform for developers which created a new ID so I have to make a new release hash key and etc (this is the bug I haven't fixed yet). Next, a kotlin file where database functions initialized, is called "G.kt", even some functions that should be reused are just rewritten in different source files. No comments with explanations in the files, except beautifully added space lines "*==================*". At this pace, what I can say is that the folder structure is messed up and not sorted properly.

    Most importantly, previous developers didn't set up multiple environments: production and testing for the android, iOS and database. So when I make test requests, they will be to the real server.

    Bruh, with such a grain of salt I don't know what to do. My plan is to talk to the CEO about the problem and start coding on the app from scratch.

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

    If anyone is looking for a job and has experience building android apps message me

    Posted: 03 Jan 2021 02:09 PM PST

    Help...

    Posted: 03 Jan 2021 07:38 AM PST

    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]

    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]

    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]

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel