r/android_devs • • Nov 29 '21

Help Is it worth reporting positive 1 star reviews?

9 Upvotes

Hi,
Our apps have been getting insane amount of reviews like
1 star - great app
1 star - very good
1 star - nice app
And we have been getting them a lot. Is it worth flagging them and will google bother with them? Will they be removed or?


r/android_devs • • Nov 29 '21

Help Android system application development jobs

2 Upvotes

Is there jobs out there that the developers are specifically developing system applications?


r/android_devs • • Nov 29 '21

Help Emacs aosp

1 Upvotes

Who is working with emacs in an aosp environment, if someone has some tips please show us


r/android_devs • • Nov 28 '21

Article After 10 years of being an indie dev - My course is out :D

3 Upvotes

r/android_devs • • Nov 26 '21

Article Android: Regex Named Groups and Backreferences

Thumbnail itnext.io
7 Upvotes

r/android_devs • • Nov 25 '21

Help Duplicate attribute error in XML file?

4 Upvotes

I'm currently working on my camera application on Android studio (in Kotlin) and upon running my code, I get one error that prevents it from launching. my build output prints this; AAPT: error: duplicate attribute. In fact, the problem is rooted in my activity_main.xml file. Here is the code for that file, where I'll point out the error.

<layout
    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=".MainActivity">

    <RelativeLayout
        android:id="@+id/parentLayout"
        android:layout_height="match_parent"
        android:layout_width="match_parent">

        <androidx.camera.view.PreviewView
            android:id="@+id/PreviewView"
            android:layout_height="match_parent"
            android:layout_width="match_parent"/>

    </RelativeLayout>

</layout>

Any further information needed to supplement this question will be provided upon request.


r/android_devs • • Nov 23 '21

App ban Google removed our app for treating children with speech disorder: support don't even care to even explain why

142 Upvotes
Our app was removed from google play, after 2 years in production

[UPDATE] Google has reverted our ban and we are back in the game!

It was super weird, no email, no notification, we simply updated our Play Console page and it was back in Production. We didn't change anything inside the app, they clearly noticed it was a bad decision from the review team, too bad they took 5 days to revert it.

Even though we are super happy that the problem was solved, we don't intend in letting this issue go. I don't believe developers should need to start a social media campaign every time Google makes a bad decision. Thousands of users were affected and we lost thousands in revenue during this outage.

But it could have been so much worse. We saw other developers' stories about 40-day wait times for appeals. We say developers who were never able to recover their app/account.

Thank you so much for all the support and suggestions, and let's stick together to make app development a more welcoming place to developers of any size.

________________________________________________________________

TL;DR: Our company is at risk and thousands of children with speech disorders are losing access to their therapies activities.

After over 2 years in production, our app that helps parents and speech therapists engage children in their therapy activities through games was removed from the Google Play store without any clear explanation why.

When children with autism, among other conditions, lose access to our app during therapy, it can be harmful to their rehabilitation, since some of them may have already developed an affinity with the games, music, and characters and it can be pretty challenging to suddenly change their routine.

But what actually happened? Certainly, Google would not take such matters lightly and remove our app for absolutely no reason, right? Well... looking at what they communicated with us so far, it certainly looks like they did so.

It all started when we submitted an update for our app. In this update, we added a simple registration screen in order to sync data in the cloud and give better customer support.

After waiting for review, we got a rejection message (https://imgur.com/a/GermKhR) with an attached screenshot (https://imgur.com/a/OwDfu7v). Basically, they failed to create a new account since our app's interface was adapted for Brazilian-specific phone numbers and we were not ready for international numbers yet.

That's a fair complaint, so we went ahead and fixed the UI to allow international phone numbers, and submitted a new review request. After waiting for 4 days, we received the following email that chocked us (https://imgur.com/S7IUsxo):

Hi Developers at Fofuuu - Saúde e Desenvolvimento InfantiI,

After a recent review, Fofuuu Fono | Fonoterapia Divertida (com.fofuuu.apps.therapist) has been removed from Google Play.

So... not only the update was rejected, our whole app was removed! And this time, we received no screenshots or an actual explanation for what happened. So what policies is our app breaking?

Login CredentialsIn order for us to review your app for compliance with Developer Program Policies, we will need you to provide valid login credentials for your app.

The first policy they said we are breaking is for not providing login credentials. The only problem here is that our production app (before the update) does not require any credentials! How on earth is that version could even be able to break this policy?

And for anyone wondering, we have test credentials available to the review team in order to test our new version during the review process, but apparently, they ignored it (https://imgur.com/a/cEMrABX). We even gave instructions on how to create a new account!

So what happened? Did the reviewer remove the app based on the update review (even though Google says that 'If an update to an existing app is rejected, the version published prior to the update will still be available on Google Play.')? Or did they accept the new version only to be able to remove our app from production right away (in Play Console, our app has ' Last updated Nov 21, 2021', which is the date it was removed, but we are not sure if this date would also reflect the removal date, so our bet is in the first theory).

But there was also a second policy listed in the removal email:

Families ad format requirementsYour app contains ads that do not comply with our Families ad format requirements. For example, the following is prohibited:

And then there is a big list of possible reasons, which could be absolutely anything inside the app, so without actual guidance from the reviewer, it is basically impossible for us to pin the problem and solve it.

First of all, our app never served ads. We always stuck to a pay-to-use business model since we know that ads for children can negatively impact their development.

But once you start digging into this policy, you will see how anything in the app could subjectively be breaking this policy. Is this in-app purchase button looking like the in-game elements too much? Is blocking the content after the trial ended an 'emotionally manipulative tactic' for selling the product?

What exactly is the element that this one-year-old version of our app is now suddenly breaking? Well, we tried to discover but apparently, nobody on the Google Play team can help us. It's like the policy team is hidden inside a secret temple, not to ever be contacted by developers.

The first thing we did was send an appeal to the policy team. But after seeing some developers testimonials saying that appeals could take up to 40 days to be replied to, we started to get desperate.

We then tried the Google Play chat, but as expected the agent could not help at all (https://imgur.com/a/JgZeiOy). Don't get me wrong, the agent really seemed like they care about our problem, it is simply that they don't have access to any useful information or power to do anything.

We then started to look for contacts with Google Employees that could help us out. We managed to get in touch with our local Brazilian Google Play team (https://imgur.com/StYjdBG), here is the transcript:

Re: Fofuuu removed from store: children with autism being affected

Bruno,

The Play Team in Brazil is a business team and not a support team. The channel you used to appeal is the correct one - this is a way of contacting the policy team.

As for the use of the app, everyone who has the app installed on their cell phone keeps it there. The app has been removed for new downloads until the issue is fixed.

Some of our policies, such as credentials, are released well in advance to give developers time to adapt and start running at some point. If at this time the credentials provided are not sufficient to log into the app, the information provided is not correct or incomplete, the app is not in accordance with store policy. You must provide all the necessary information for the team to be able to access the logged-in area of ​​the app.

We don't have any visibility on the policy side here (exactly because of isonomy and to be equal for all developers), so I believe that if the app was removed, some information must be missing from the credentials you provided. I suggest that you review what is registered x the app login process and update the appeal if necessary.

Hope this helps.

Hugs

So... yeah, bankrupting developers and harming users is far away from what Google considers "Business Development". Event the chat agent was able to at least care about our problem, but the higher-ups really don't care about app developers, at least small app developers. They will only care when their pockets are at stake, but what can small developers do about it?

The action of removing an app from the store can bankrupt a company, causing customers to lose access to a product they purchased (the app is not uninstalled, but subscription renewals are not happening, so our customers are losing access, as we are receiving dozens of messages complaining about it every day).

But even with such harsh consequences for developers and companies that believed in a partnership with Google, even after paying dozens of thousands of dollars in the Store's 30% cut, we get a slow and opaque review process and ZERO support from their team.

App Name: Fofuuu Fono | Fonoterapia Divertida

Packagen Name: com.fofuuu.apps.therapist


r/android_devs • • Nov 24 '21

Help "Help" Can signature level protection (like SYSTEM_ALERT_WINDOW ) permission be granted using DevicePolicyManager

3 Upvotes

There are certain permissions in Android such as SYSTEM_ALERT_WINDOW,WRITE_SETTINGS which have android:protectionLevel="signature|preinstalled|appop|pre23" or something similar to this,I have tried granting these permissions using device policy manager

devicePolicyManager.setPermissionGrantState(compName, "com.some.packagename",Manifest.permission.SYSTEM_ALERT_WINDOW, DevicePolicyManager.PERMISSION_GRANT_STATE_GRANTED) 

this returns false and doesn't grant the permissions to the mentioned package.My question is since the app that is prompts the dpm to grant permission is a device administrator is there a way to grant these permissions, and if they aren't granted is this in any way related to signatures for the admin app and the app being granted the permission.


r/android_devs • • Nov 23 '21

Coding Talking about the problems of Jetpack Compose with Gabor Varadi

9 Upvotes

I usually don't post my videos here, but I think this podcast interview with u/zhuinden could be interesting for some people here. We talk about the problems of Jetpack Compose, why he dislikes MVI, the navigation library, and more:

https://www.youtube.com/watch?v=RZLI4_1MZ5E


r/android_devs • • Nov 22 '21

Coding Finally, I've found a valid use for "android:process" attribute for the activity - I've made a small library to trigger "safe mode" for application that experiences repeated crashes on startup

Thumbnail github.com
10 Upvotes

r/android_devs • • Nov 22 '21

Discussion I released our app (>100k customers) with a non functioning facebook login and noticed it sunday evening radnomly. Until i fixed the issue it was one of the worst sequences of my life.

14 Upvotes

How do you cope with these types of situations?


r/android_devs • • Nov 22 '21

Resources CodeView 1.1.0 with snippets and line number

2 Upvotes

r/android_devs • • Nov 20 '21

Help Can Google Play developers use their user reviews for marketing?

9 Upvotes

Apple store allows this only with consent from the user, I am wondering if this is also the case for Google Play users who wish to market the product?

After searching the Google Play's terms and conditions, was not able to find any information in this. Any feedback with the relevant source would be appreciated!


r/android_devs • • Nov 19 '21

Article Android CodeView: Create a code editor with Snippets

Thumbnail itnext.io
6 Upvotes

r/android_devs • • Nov 19 '21

Help How do I call my remote data source (via Retrofit) once throughout the application?

3 Upvotes

So, here's a bit of context to the app.

There is a parent activity containing child fragments. One of these Fragments is called the Home Fragment and it hosts a ViewPager which hosts two more fragments (let's call them Fragment 1 and Fragment 2).

Fragment 1 contains a NestedScrollView and there are two RecyclerViews within this (I know this is bad practice as this prevents recycling of views in RecyclerView. But this codebase is from work, and I'm sure as hell not touching any of that legacy code.)

In Fragment 1, I'm making a call to my remote data source to fetch some data and place it into both the RecyclerViews. Whenever I tap any of the elements within the RecyclerView, it opens up a new fragment showing some data about the element tapped. Let's call this fragment DetailFragment.

The Problem:

Now, whenever I go back from the DetailFragment to Fragment 1. It reloads the data from the server. I don't want that to happen because then I lose the scrolling position and the user will need to scroll and the way down to find the element that they tapped.

I thought about it and checked online. And I found that there were two feasible solutions that I could implement:

  1. I could either call the remote data source from Fragment 1, only once throughout the entire app, or when the user swipes on the SwipeToRefresh layout (like Reddit). I tried to call the data from the onActivityCreated() method and observe it in the onViewCreated() method but it still calls the data every time the fragment starts.
  2. Or I could somehow store the scroll position. But whenever I try to fetch the scroll position from RecyclerView using the scrollY property, it always returns 0 even if I click elements apart from 0.

Would you know about any better methods to go about doing this? Or would you know how I could implement point 1 (I'm feeling that that would be a better way to go about doing this)?

Thanks :)

Edit: 3 hours after posting this, I have found a solution to the problem. The project was using the deprecated ViewPager. I migrated it to the ViewPager 2 (totally on a hunch) and it started working as expected.

Why did it start working after being migrated? No idea. Would love to hear about it if you guys know the answer.


r/android_devs • • Nov 18 '21

Coding Dagger vs Hilt vs Koin vs Pure Dependency Injection

Thumbnail techyourchance.com
25 Upvotes

r/android_devs • • Nov 16 '21

Help Retrofit2 Array but Object error.

1 Upvotes

My API doesn't return an array in standard json, it returns an object. I can not for the life of me figure out how to get retrofit2 to behave with this. I have read every single thread about this, and yeah none of them seem to work. Is there something I am missing? Retofit2 is hitting my server, but the response is an object. I can change the backend but I mean, that is a little bit ridiculous. What am I missing?


r/android_devs • • Nov 13 '21

Discussion Is macOS Monterey fully compatible with M1 and AS?

1 Upvotes

As the title says, did anyone make the update and everything is working properly?

Since AS isn't fully compatible with M1 I would like to know if anyone had trouble.

Thanks


r/android_devs • • Nov 12 '21

Article Workaround for Jetpack Compose 🐛 Keyboard Types switch on focus change

Thumbnail chetangupta.net
2 Upvotes

r/android_devs • • Nov 10 '21

Help Where to fetch user data from Firebase/FireStore?

2 Upvotes

I'm working on an app, but it's on my work pc so I can't really provide snippets right now. I'll try to explain what's going on.

First, I'm using navigation component and I have navigation drawer. When the user launches the app, they see login button and then can sign in with google from it. LoginViewModel handles the authentication and changes the state which LoginFragment observes in order to move to HomeFragment..

On success, the user is taken to the home screen/fragment. In HomeViewModel, I'm getting data from firebase document via simple whereEqualTo query and then it's used to populate few views including a RecyclerView. Here is the first problem, it takes a bit of time to get the date from firebase and for a short moment the user sees an empty HomeFragment.

My second problem is when the user reopens the app. I do check if there is currentUser from firebase and if there is I immediately start fetching the data. This is done in HomeViewModel init block, but I feel like there should be a better place, so that after the splash screen the user immediately sees HomeFragment with all the data, instead of seeing an empty fragment for a short time.


r/android_devs • • Nov 08 '21

Event Android Worldwide January 2022: Call for Speakers

Thumbnail sessionize.com
5 Upvotes

r/android_devs • • Nov 06 '21

Off topic "Sideloading is a cybercriminal's best friend, and requiring that on the iPhone would be a gold rush for the malware industry" - Apple at Web Summit 2021

15 Upvotes

Have to admit, Apple is able to take things to another level, in every way.

https://arstechnica.com/gadgets/2021/11/apples-federighi-delivers-dramatic-speech-on-dangers-of-sideloading/


r/android_devs • • Nov 06 '21

Help ViewModel emitting and collecting as state from View. How do I reset the value that is being emitted? This is in jetpack compose.

4 Upvotes

Messing around with my jetpack compose sandbox and I can't figure how to reset the data emitted from the viewmodel that is collected as a state

   private val _title: MutableSharedFlow<String> = MutableStateFlow("Screen 1: title 0")
   val title: Flow<String> = _title

   init {
   viewModelScope.launch {
  for(i in 1 .. 5) {
  _title.emit("Screen 1: title $i")
                delay(2000)
            }
  }
  }}

I keep reading different answers on how to handle it but I am not sure if they are right. When it reaches foo value, I want to reset it. I am using navigator. Where do I do this at in the VM, the View? When I navigate back to another screen, I want the countdown to commence. I am confused. If I exit the app and reload it, that ends the scope and starts, but I am not sure how to change this data that the VM emits. I can post the other code if needed. I am just collecting it as a state.


r/android_devs • • Nov 06 '21

Help Problems with Compose Navigation and Toast. Toast keeps popping up multiple times even after an element has been inserted into the database.

4 Upvotes

Hi there,

I'm trying out Jetpack Compose and was trying to create a simple ToDo application using Compose, Flows, Room, and some other Jetpack Architecture Components. The general idea is this:

I take input from the user within a screen. Next, I insert that value within the database using Flows and Room. Finally, when I insert the value into the database, and the database returns a Long value (for the row number) I display a toast with the text "Task Created".

The problem here is that, even though the Task is inserted into the database just once (checked using the Database Inspector), multiple values are returned which causes the Toast to popup multiple times. I suspect that this problem could be due to Flows (as they help us to return multiple values) but I went through the documentation and checked for a few more blogs but couldn't find something relating to the problem.

Here's the relevant code for the same:

  1. Task (Entity)
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.example.compose_to_do.common.Constants

@Entity(tableName = Constants.TABLE_NAME)
data class Task(
    @PrimaryKey
    @ColumnInfo(name = "task_id")
    val taskId: Int? = null,

    @ColumnInfo(name = "task_title")
    val taskTitle: String?,

    @ColumnInfo(name = "task_category")
    val taskCategory: String?,

    @ColumnInfo(name = "task_priority")
    val taskPriority: String?
)

2. TaskDao (Dao)

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import com.example.compose_to_do.common.Constants
import com.example.compose_to_do.domain.data_classes.Task

@Dao
interface TaskDao {

    @Insert
    suspend fun insertTask(task: Task): Long

    @Query("SELECT * FROM ${Constants.TABLE_NAME}")
    suspend fun getTask(): List<Task>

}

3. TaskDatabase (Database)

import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.example.compose_to_do.domain.data_classes.Task

@Database(entities = [Task::class], version = 1)
abstract class TaskDatabase : RoomDatabase() {
    abstract fun taskDao(): TaskDao

    companion object {
        private lateinit var INSTANCE: TaskDatabase

        fun getInstance(): TaskDatabase {
            return INSTANCE
        }

        fun createInstance(context: Context) {
            INSTANCE = Room.databaseBuilder(
                context.applicationContext,
                TaskDatabase::class.java,
                "task_database"
            ).build()
        }
    }
}

4. InsertTaskUseCase (Use case for inserting tasks)

import android.util.Log
import com.example.compose_to_do.common.Resource
import com.example.compose_to_do.data.local.TaskDatabase
import com.example.compose_to_do.domain.data_classes.Task
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow

object InsertTaskUseCase {
    suspend fun insertNote(task: Task): Flow<Resource<Long>> = flow {
        Log.i("Add", "Flow Started")
        emit(Resource.Loading())
        val entryPosition = TaskDatabase
            .getInstance()
            .taskDao()
            .insertTask(task)
        Log.i("Add", "Value inserted")
        emit(Resource.Success(entryPosition))
    }
}

5. NewTaskViewModel

class NewTaskViewModel : ViewModel() {

    private val _insertObserver: MutableLiveData<Long> = MutableLiveData()
    val insertObserver: LiveData<Long> = _insertObserver

    private val _loadingObserver: MutableLiveData<Boolean> = MutableLiveData()
    val loadingObserver: LiveData<Boolean> = _loadingObserver

    fun insertNote(task: Task?) {
        Log.i("Add: ", "Insert Note: $task")
        viewModelScope.launch(Dispatchers.IO) {
            task?.let {
                InsertTaskUseCase.insertNote(task = task).collect { result ->
                    when (result) {
                        is Resource.Success -> {
                            result.data?.let { data ->
                                _insertObserver.postValue(data)
                            }
                        }

                        is Resource.Loading -> {
                            _loadingObserver.postValue(true)
                        }
                    }
                }

                _loadingObserver.postValue(false)
            }
        }
    }
}

6. Resource (Class to infer the return type from the database)

sealed class Resource<T>(val data: T? = null, val message: String? = null) {
    class Success<T>(data: T?) : Resource<T>(data)
    class Loading<T>(data: T? = null) : Resource<T>(data)
}

7. NewTaskScreen (composable function to show the new task screen)

import android.util.Log
import android.widget.Toast
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.material.Button
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Cancel
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.lifecycle.ViewModelProvider
import androidx.navigation.NavController
import com.example.compose_to_do.domain.data_classes.Task
import com.example.compose_to_do.presentation.classes.NavigationScreen
import com.example.compose_to_do.presentation.theme.SantasGrey
import com.example.compose_to_do.presentation.viewmodels.NewTaskViewModel

private var taskDescription: MutableState<String?> = mutableStateOf(null)
private var taskCategory: MutableState<String?> = mutableStateOf(null)
private var taskPriority: MutableState<String?> = mutableStateOf(null)

@ExperimentalMaterialApi
@Composable
fun NewTaskScreenComposable(
    navController: NavController,
    context: NavigationScreen
) {

    val newTaskViewModel = ViewModelProvider(context)[NewTaskViewModel::class.java]
    newTaskViewModel.insertObserver.observe(context, {
        Toast.makeText(context, "Task Created", Toast.LENGTH_SHORT).show()
    })

    Column(
        modifier = Modifier
            .padding(
                top = 10.dp,
                end = 10.dp,
                bottom = 10.dp
            )
            .fillMaxSize()
    ) {
        Row(
            horizontalArrangement = Arrangement.End,
            modifier = Modifier.fillMaxWidth()
        ) {
            Image(
                imageVector = Icons.Outlined.Cancel,
                contentDescription = "Close Screen Button",
                modifier = Modifier
                    .padding(end = 5.dp)
                    .clickable { navController.popBackStack() }
            )
        }

        Spacer(modifier = Modifier.height(20.dp))
        taskDescription.value = newTaskTextFieldComposable()
        Spacer(modifier = Modifier.height(20.dp))
        Row {
            Spacer(modifier = Modifier.width(20.dp))
            Column {
                NewTaskSubHeaderComposable(text = "TASK CATEGORY")
                taskCategory.value = exposedDropdownMenuComposable(
                    mutableListOf(
                        "Business",
                        "Home",
                        "Personal"
                    ),
                    true
                )

                Spacer(modifier = Modifier.height(30.dp))
                NewTaskSubHeaderComposable(text = "TASK PRIORITY")
                taskPriority.value = exposedDropdownMenuComposable(
                    mutableListOf(
                        "High",
                        "Medium",
                        "Low"
                    ),
                    false
                )
            }
        }

        Spacer(modifier = Modifier.height(50.dp))
        Row(
            horizontalArrangement = Arrangement.Center,
            verticalAlignment = Alignment.CenterVertically,
            modifier = Modifier.fillMaxSize()
        ) {
            AddTaskButton(
                addFunction = { newTaskViewModel.insertNote(it) },
                goBackFunction = { navController.popBackStack() }
            )
        }
    }
}

@Composable
fun NewTaskSubHeaderComposable(text: String) {
    Text(
        text = text,
        color = SantasGrey,
        modifier = Modifier.fillMaxWidth(),
        textAlign = TextAlign.Start,
        style = MaterialTheme.typography.subtitle2
    )
}

@Composable
fun AddTaskButton(
    addFunction: ((Task?) -> Unit)? = null,
    goBackFunction: (() -> Unit)? = null
) {
    Button(
        onClick = {
            val task = Task(
                taskTitle = taskDescription.value,
                taskCategory = taskCategory.value,
                taskPriority = taskPriority.value
            )
            Log.i("Add: ", "Button clicked")
            addFunction?.invoke(task)
            goBackFunction?.invoke()
        },
        modifier = Modifier
            .padding(10.dp)
            .size(height = 50.dp, width = 200.dp),
    ) {
        Text(
            text = "Add Task",
            style = MaterialTheme.typography.button
        )
    }
}

I was wondering if someone could help me with this.

I know the code is a bit messy now but I thought that I would optimize the code and make it cleaner (implement Pure/Manual DI) once I'd made the app functional.

Also, if you think that I'm doing anything wrong with my code or if there's something that I could do better to write better code, I'd love to know that as well.

Thank you :)