• Breaking News

    [Android][timeline][#f39c12]

    Thursday, January 2, 2020

    Implementing your first Android lint rule Android Dev

    Implementing your first Android lint rule Android Dev


    Implementing your first Android lint rule

    Posted: 02 Jan 2020 07:17 AM PST

    New Google Play Algorithm - Deleted reviews remain

    Posted: 02 Jan 2020 10:37 AM PST

    I just learned from Google Support that deleted reviews are not removed from the new calculation used to calculate Google plays new rating. Figured you all might like to know. This seems absolutely wrong and unintuitive to me.

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

    Different views in a layout

    Posted: 02 Jan 2020 10:52 AM PST

    How do I switch between different views in 1 layout? I'm trying to make an event application where the views will switch depending on the user's group status.

    For example, I have a fragment that displays events. By default, there is only a "Join" and "Create" button in the layout. Once the user successfully joins an event, the layout will change to show details of that event (textviews, images, buttons, etc). The Join and Create buttons are no longer there. Once the user leaves the group, the default layout will be shown.

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

    A question about a new release on an application...

    Posted: 02 Jan 2020 10:15 AM PST

    Hi everyone,

    I have a question. We sent our app through Google Play last week. We submitted it as an Alpha. Now, they have reviewed it and everything is good. But I was wondering... See the screenshot below, if we click this to push a new version to production, will it send it through another review process, or are we good to roll out updates without them being reviewed?

    Basically, simplified, my question is: If we press the "Start Rollout to Production" button, will it be instant or will it have to be reviewed again?

    Screenshot: https://imgur.com/a/vxB23zr

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

    Permission READ_PHONE_STATE misleading my users

    Posted: 02 Jan 2020 05:32 AM PST

    I get quite a few complaints about this permission in my app. I just want to know when a phone call comes in so that I can stop the audio playing.

    The android reference for this permission says:

    READ_PHONE_STATE Allows read only access to phone state, including the phone number of the device, current cellular network information, the status of any ongoing calls, and a list of any PhoneAccounts registered on the device. 

    But the system popup from ActivityCompat.requestPermissions says:

    Allow <app> to make and manage phone calls 

    I do explain what the permission is for before asking, but my users think I may be up to something dodgy, as I appear to be asking for permission to make phone calls.

    Am I doing this correctly? Is there any way of avoiding the "make and manage" calls description when the permission clearly doesn't allow this?

    Edit: For completeness my full permissions list is:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.BILLING" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> <uses-permission android:name="android.permission.BLUETOOTH"/> 
    submitted by /u/kiwi_in_england
    [link] [comments]

    Library migration to AndroidX

    Posted: 02 Jan 2020 12:17 PM PST

    I'm using Paho MQTT library in my AndroidX application. I'm getting exception `NoClassDefFoundError` for \Landroid/support/v4/content/LocalBroadcastManager``. I found that library uses deprecated import:

    import android.support.v4.content.LocalBroadcastManager;

    Function that rises exception:

    private void registerReceiver(BroadcastReceiver receiver) {

    IntentFilter filter = new IntentFilter();

    filter.addAction(MqttServiceConstants.CALLBACK_TO_ACTIVITY);

    LocalBroadcastManager.getInstance(myContext).registerReceiver(receiver, filter);

    receiverRegistered = true;

    }

    How to solve this problem? Should I download source and recompile library? Why it is not already done in latest release?

    Whole exception:

    E/AndroidRuntime: FATAL EXCEPTION: main

    Process: com.eurbon.pahomqttclientexample, PID: 17368

    java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/content/LocalBroadcastManager;

    at org.eclipse.paho.android.service.MqttAndroidClient.registerReceiver(MqttAndroidClient.java:450)

    at org.eclipse.paho.android.service.MqttAndroidClient.connect(MqttAndroidClient.java:428)

    at org.eclipse.paho.android.service.MqttAndroidClient.connect(MqttAndroidClient.java:334)

    at paho.android.mqtt_example.MainActivity.MqttConnect(MainActivity.java:121)

    at paho.android.mqtt_example.MainActivity.onCreate(MainActivity.java:63)

    at android.app.Activity.performCreate(Activity.java:6679)

    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)

    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)

    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)

    at android.app.ActivityThread.-wrap12(ActivityThread.java)

    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)

    at android.os.Handler.dispatchMessage(Handler.java:102)

    at android.os.Looper.loop(Looper.java:154)

    at android.app.ActivityThread.main(ActivityThread.java:6119)

    at java.lang.reflect.Method.invoke(Native Method)

    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)

    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

    Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.content.LocalBroadcastManager" on path: DexPathList[[zip file "/data/app/com.eurbon.pahomqttclientexample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.eurbon.pahomqttclientexample-1/lib/x86, /system/lib, /vendor/lib]]

    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:380)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

    at org.eclipse.paho.android.service.MqttAndroidClient.registerReceiver(MqttAndroidClient.java:450)

    at org.eclipse.paho.android.service.MqttAndroidClient.connect(MqttAndroidClient.java:428)

    at org.eclipse.paho.android.service.MqttAndroidClient.connect(MqttAndroidClient.java:334)

    at paho.android.mqtt_example.MainActivity.MqttConnect(MainActivity.java:121)

    at paho.android.mqtt_example.MainActivity.onCreate(MainActivity.java:63)

    at android.app.Activity.performCreate(Activity.java:6679)

    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)

    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)

    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)

    at android.app.ActivityThread.-wrap12(ActivityThread.java)

    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)

    at android.os.Handler.dispatchMessage(Handler.java:102)

    at android.os.Looper.loop(Looper.java:154)

    at android.app.ActivityThread.main(ActivityThread.java:6119)

    at java.lang.reflect.Method.invoke(Native Method)

    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)

    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

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

    How to send data from a service to a Fragment?

    Posted: 02 Jan 2020 11:39 AM PST

    I'm using Firebase Cloud Messaging to receive data in my app:

    class CustomFirebaseMessagingService : FirebaseMessagingService() { override fun onMessageReceived(msg: RemoteMessage?) { val data = msg?.data ?: return val name = data["name"] as String val age = data["age"]?.toIntOrNull() ?: return val bio = data["bio"] as String val img1 = data["img1"] as String val match = Profile(name, age, bio, img1, null, null) Log.d(TAG, "onMessageReceived(): $name is $age") val fcmViewModel = ViewModelProviders.of(this).get(FcmViewModel::class.java) // .of() only takes a fragment/activity FcmViewModel().match.postValue(match) Log.d(TAG, "Value: " + FcmViewModel().match.value.toString()) // null super.onMessageReceived(msg) } 

    When I receive the FCM, I want to pass it to my Fragment. I've tried to use LiveData + ViewModel, but unfortunately, postValue() isn't actually changing the data in the ViewModel from the service because I can't instantiate a reference to the ViewModel from a service.

    class FcmViewModel : ViewModel() { val match: MutableLiveData<Profile> by lazy { MutableLiveData<Profile>() } } class MapFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { fcmViewModel.match.observe(this, Observer<Profile> { profile -> log("${profile.name} is ${profile.age}") // doesn't print }) } } 

    Is there a better way to pass data from FirebaseMessagingService() to my fragment or a way to post data to FcmViewModel() within the FirebaseMessagingService()?

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

    How do apps create "new" saved variables w/ SharedPreferences?

    Posted: 02 Jan 2020 11:12 AM PST

    I get that SharedPreferences are declared outright in the code. But if this is the case, how do some apps, like for example an alarm app, create new instances of things when the user wants to? Only one preference per variable right? I've looked up how to generate new, unique variables programmatically, but it seems impossible. So how can apps like alarm apps create infinite new alarms that are saved?

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

    Lessons learned with a personal application

    Posted: 02 Jan 2020 02:42 PM PST

    Android Studio "project" view icons - distinguish Kotlin v.s. Java class?

    Posted: 02 Jan 2020 10:44 AM PST

    Android Studio "project" view icons - distinguish Kotlin v.s. Java class?

    I'm in the process of migrating my Java project to Kotlin, and I'm trying to make it easier on myself for these 100+ files, so I'm trying to configure AS to show a different icon for Java v.s. Kotlin.

    Here is a screenshot of the current icon set. That little blue cube is the same for Java and Kotlin.

    https://preview.redd.it/brdcoo3wte841.png?width=889&format=png&auto=webp&s=7a47cec57911eac4093f6b9febc366a448efbcdb

    However, on the top tab bar, it shows a cool little Kotlin icon:

    https://preview.redd.it/q03nkn3wte841.png?width=126&format=png&auto=webp&s=d0a51c78bab3d561389757d4b70b4ce96ca1a3d4

    If I use a singleton Kotlin object, such as for this file, it does show up in the Project with a different icon for Kotlin.

    https://preview.redd.it/fifo4m3wte841.png?width=181&format=png&auto=webp&s=b1ad054981b8c56e0c7fe3ff36358983320b8d38

    Is there any way to change these icons to distinguish between Java & Kotlin classes?

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

    Topeka : Transition Animations [ 2]

    Posted: 02 Jan 2020 09:51 AM PST

    How do you make a generic dagger module for MVP implementation?

    Posted: 02 Jan 2020 09:35 AM PST

    I'm trying to implement MVP using dagger and all the tutorials I have found implement a single activity app where the MvpModule is hard-coded for a particular activity only. Example - https://www.journaldev.com/20644/android-mvp-dagger2. Here, MvpModule is only able to provide MainContract.ViewCallBack and MainContract.PresenterCallBack and hence is tightly bound to MainContract and MainActivity.

    My question is how do I make a module which is generic enough so that it can be injected it into any activity in which I wish to implement MVP?

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

    Question: can layout_constraintHeight_percent (and similar ones) be in relation to other views, instead of the parent?

    Posted: 02 Jan 2020 06:10 AM PST

    Suppose you want to create a view that has a height of 0.5 of the ConstraintLayout, and you want to create a view that seems in it, and of 0.5 of this view in height (meaning 0.25 of the ConstraintLayout in this case).

    I tried to do this (actually quite different, but similar scenario), but it seems that layout_constraintHeight_percent (and others) are only in relation to the ConstraintLayout:

    https://i.imgur.com/YycP5EJ.png

    <View

    android:id="@+id/centerView"

    android:layout_width="match_parent"

    android:layout_height="0px"

    android:background="#33ff0000"

    app:layout_constraintBottom_toBottomOf="parent"

    app:layout_constraintHeight_percent="0.5"

    app:layout_constraintTop_toTopOf="parent" />

    <View

    android:layout_width="match_parent"

    android:layout_height="0px"

    android:background="#3300ff00"

    app:layout_constraintBottom_toBottomOf="@id/centerView"

    app:layout_constraintHeight_percent="0.5"

    app:layout_constraintTop_toTopOf="@id/centerView" />

    Is there a way to do it? Or should I really either calculate the new ratio (as one of the ConstraintLayout), or create a ConstraintLayout (or other layout) within the ConstraintLayout ?

    For now, I just use the percentage of the ConstraintLayout, but the disadvantage of it is that if I change one value, I have to remember to change the rest too.

    submitted by /u/AD-LB
    [link] [comments]

    how many dots in 3d space can i print in app mobile phone ARGUMENTED REALITY

    Posted: 02 Jan 2020 07:56 AM PST

    My question is how many dots can i print in a 3d ARGUMENTE REALITY mapped in a mobile app as BIXBY VISION but made it by me :D.

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

    How can I give a circular image a circular shadow (elevation)?

    Posted: 02 Jan 2020 11:09 AM PST

    I have a png file I want to use for an image view. What I am trying to do is to use the circular image only, and give it an elevation, however the actual image is square shaped with the checkered background areas being transparent. So if I try to give this an elevation the shadow is actually around the entire square shaped image, not the circle only. How can I achieve this?

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

    Performant image filters

    Posted: 02 Jan 2020 11:09 AM PST

    I tried some libraries for image Filters, but all of them caused the app to lag and/or crash, how can I use filters which dont lag?

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

    Need Suggestion fo Anime Streaming app

    Posted: 02 Jan 2020 04:44 AM PST

    Hello guys, I am developer of Anime X Wallpaper, Unique Wallpaper Wall X. I am looking to make a open source anime app without ads for our anime community. App will be used to watch anime on your android without ads. I need some of your suggestions. What type offeature you guys want. It will be completely ad free forever. App will only available on android platform. So kindly please drop your suggestions

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

    AdMob Developers who have been banned recently, has anyone successfully appealed?

    Posted: 01 Jan 2020 11:53 PM PST

    In the latest massive ban wave by AdMob, many developers have been banned for Invalid Activity, without any explanation or warning. My account has also been banned, almost two months ago and I tried to appeal multiple times but I am getting the usual responses from what seem to be bots aka "The AdSense Team"

    The responses usually go by: thank you for additional info, unfortunately our specialist has confirmed that we are unable to reinstate your account, thank you for understanding

    So, has anyone who has been banned recently, or any who has been banned by AdMob successfully appealed?
    My account was disabled instantly without previous warnings or violations, and I simply refuse to give up until this is resolved.

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

    How I began writing Kotlin tests using the Unidirectional Data Flow

    Posted: 02 Jan 2020 09:55 AM PST

    Make babbar translucent in Android 10

    Posted: 02 Jan 2020 07:41 AM PST

    So this kinda pisses me off a little bit but everytime I'm in an application, the gesture bar is present but there's also this ugly slit of a navbar which seems very out of place. Is there any way to make that transparent? I just want the gesture bar floating and no navbar

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

    Creating an android app that cannot be uninstalled even after a factory reset

    Posted: 02 Jan 2020 11:06 AM PST

    Guys, i have been thinking of something lately which kind of think will be beneficial for anyone whose phone is stolen or lost. It would be a lot to type in here, but the idea requires a programmer, an app developer (android) and an ethical hacker's contribution. I don't know if posting link to the video is against the rules exactly,

    but i need as much contributions as i can get. The idea is creating an Uninstallable mobile app. Pls, refer to video link for more info. Pls, the reason there is a link is because there is a discussion in the video and i can't put everything to writing. Your comments and ideas are needed there. Sadly, this topic isn't searchable.

    https://youtu.be/Y7NUy2rQg3U

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

    Who is selling their Android Devoloper Account!

    Posted: 02 Jan 2020 01:25 PM PST

    looking to buy one. lmk if you have one

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

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel