• Breaking News

    [Android][timeline][#f39c12]

    Monday, August 5, 2019

    Weekly "who's hiring" thread! Android Dev

    Weekly "who's hiring" thread! Android Dev


    Weekly "who's hiring" thread!

    Posted: 05 Aug 2019 05:45 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]

    Weekly Questions Thread - August 05, 2019

    Posted: 05 Aug 2019 03:57 AM PDT

    This thread is for simple questions that don't warrant their own thread (although we suggest checking the sidebar, the wiki, our Discord, or 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?

    Important: Downvotes are strongly discouraged in this thread. Sorting by new is strongly encouraged.

    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!

    Also, please don't link to Play Store pages or ask for feedback on this thread. Save those for the App Feedback threads we host on Saturdays.

    Looking for all the Questions threads? Want an easy way to locate this week's thread? Click this link!

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

    Who relates

    Posted: 05 Aug 2019 01:52 PM PDT

    What can be done about search boxes in a world of creating easier to reach UI elements?

    Posted: 05 Aug 2019 11:58 AM PDT

    With phones getting larger, a lot of developers/designers are moving their UI elements to the bottom of screens. Floating Action Buttons, Bottom Navigation Views, large headers that push the first item of a list down. But I haven't seen any good solutions to search boxes. Sure, I can add a FAB that triggers the search box or just move the search box to the bottom entirely, but once the user is finished typing their query, where are the most relevant result? The top of the list.

    So what can be done? Showing some arrow buttons at the bottom of the screen? Using the FAB like some sort of joystick or dpad? Show the results at the bottom of the screen in "reverse" bottom to top order? Anyone tried or seen any solutions?

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

    [Help] Root MotionLayout as a choreographer of nested MotionLayout = laggy

    Posted: 05 Aug 2019 01:59 AM PDT

    [Help] Root MotionLayout as a choreographer of nested MotionLayout = laggy

    Hello guys,

    I have a kinda complicated view to implement, we somehow managed to do it, it looks like this : https://imgur.com/gwxJe9B

    This page contains :

    • A root View, a MotionLayout (rootMotionLayout) containing 2 ViewPager
    • 1st ViewPager shows purple cards, that are also MotionLayouts (nested cardMotionLayout)
    • 2nd ViewPager is a RecyclerView

    Why do we need 2 ViewPager ? Swiping the card or the list should move the other one to the same page. We use distinct ViewPager because we want to have a peak on the next card, but not on the list.

    To perform this animation, we listen to the rootMotionLayout progress then set every nested cardMotionLayout's progress, thus the animation is CPU based. It may not look like it on this GIF but it is kinda laggy. Here is a comparison with a more with only the rootMotionLayout, and a "classic" Android animation :

    Taken individually, each animation is fluid ! But forwarding the rootMotionLayout progress to the nested cardMotionLayout is what makes it laggy, here is the guilty piece of code :

    rootMotionLayout.setTransitionListener(object : MotionLayout.TransitionListener { override fun onTransitionChange(motionLayout: MotionLayout?, startId: Int, endId: Int, progress: Float) { nestedMotionLayoutList.forEach { it.progress = progress } } override fun onTransitionTrigger(motionLayout: MotionLayout?, startId: Int, positive: Boolean, progress: Float) = Unit override fun onTransitionStarted(motionLayout: MotionLayout?, startId: Int, endId: Int) = Unit override fun onTransitionCompleted(motionLayout: MotionLayout?, currentId: Int) = Unit }) 

    Do you have any ideas how to make it more fluid ? To be honest, I was hoping that the next article from Nicolas Roard on MotionLayout (MotionLayout as a choreographer of root layout) would help me achieve this, but it has not been released yet ^^'

    Thanks in advance !

    EDIT: Added links to GIFs

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

    I always thought mocking web apis in Android should be simple an straight forward. Then I came up with my own little mocking lib :-) Please let me know what you think.

    Posted: 05 Aug 2019 02:11 PM PDT

    Questions about the article "Activities in Android are not UI Elements"

    Posted: 05 Aug 2019 06:20 AM PDT

    Hi everyone,

    I'm currently trying to refactor one of my apps into the MVVM design pattern. I found the article Activities in Android are not UI Elements and the ideas mentioned in this article make a lot of sense to me. However since there are many ways to implement MVVM, I find it is different from the way that MVVM is usually taught and this caused a few questions to arise that I thought I would ask here:

    1. How do the ideas mentioned in this post relate to Android's ViewModel architecture component? It seems to me that ViewModel forces the developer to make the Activity class the view. All of the tutorials I am watching are saying to make the Activity contain all of the ui logic and extract the business logic into the ViewModel. I am confused as to how to implement MVVM with Android's ViewModel component and still have it follow the ideas mentioned in this blog post and I was wondering if anyone could explain from a high level how you would do this.
    2. One of the points I always hear mentioned in Mvx tutorials is to extract the business logic away from the Activity in order to make it so that you can test the "x" (Presenter, ViewModel, ...) with a unit test instead of an espresso test. This makes a lot of sense to me since not only does it make testing the "x" much easier since it is completely isolated from the Activity, but it is faster to run a unit test than an espresso test. Which brings me to my last question: when using the ideas in this blog post, since the "x" is in the Activity, do I need an espresso test since it is still tied to parts of the Activity, such as lifecycle methods?

    Thanks for your time.

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

    How to send an x-www-form-urlencoded POST request in Kotlin?

    Posted: 05 Aug 2019 04:06 AM PDT

    Stupid question, noobie to Android development...

    I'm having the hardest time finding simple guides online on how to do this. All I need to be able to do is send a POST request in my Android app (built with Kotlin) that sends the data in x-www-form-urlencoded format.

    From what I've found out, all I know for now is that I need to add <uses-permission android:name="android.permission.INTERNET"/> to AndroidManifest.xml. Apart from that, I don't know what to do. I guess I need to install OKHttp, Volley or Retrofit as a depenency as well? It seems OKHttp is best but their documentation is extremely lacking. They say they support Kotlin but everything in there is written in Java at an extremely high level.

    I'm sure plenty of people here have done this before. Can you please copy-paste your code (which I guess goes in MainActivity.kt??)?

    submitted by /u/stupid-sexy-jake
    [link] [comments]

    Jetpack navigation library with bottom navigation fragment - prevent recreation

    Posted: 05 Aug 2019 01:15 AM PDT

    I am currently out of ideas and would like to ask if any of you have a better alternative to my problem.

    I have a bottom navigation bar with multiple fragments. If click something in any of those fragments a detail page (another fragment) or something similar should open. The problem is if I have everything in the same navigation graph, the whole fragment which contains the bottom navigation and therefore the fragments that belong to that navigation will be destroyed. Upon navigating back everything needs to be recreated, which is laggy and undesired.

    My solution would be to have the bottom navigation directly in the activity and overlay a NavHostFragment that has a transparent/empty fragment as its starting point. If I need to navigate to a detail screen I use that NavHostFragment and replace the empty fragment. This works, but now I don't have lifecycle hooks like onStart/onStop in my fragments in the bottom navigation and I also can't do animations that require the showing fragment to move out.

    How would you handle this with single activity architecture and the navigation library?

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

    Deobfuscate

    Posted: 05 Aug 2019 01:59 PM PDT

    Can anyone help deobfuscate an android apk file

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

    Question about bytecode / machine code and apk's

    Posted: 05 Aug 2019 01:56 PM PDT

    I was thinking that installing an apk turns the bytecode inside of an apk into Maschinecode (atleast in the case of art, I know that dalvik isn't ahead of time compiling). But later I discovered that installing an apk copies the apk into a extra folder instead, so the apk continues to exist as a apk. Where is the machinecode, why is the apk with the bytecode kept, what am I missing?

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

    Scanning the 802.11 network

    Posted: 05 Aug 2019 09:51 AM PDT

    Hey guys!

    I'm currently working on a research project for my University and I need to be able to scan the wireless network using my android phone. I'm currently developing in Android Studios using the Kotlin language and found some great APIs such as the TelephonyManger which allows me to scan the network. HOWEVER, The .requestNetworkScan method requires the android.permission.MODIFY_PHONE_STATE permission which is a permission only granted to system apps :( . I tried looking at the WifiManager class however it's been deprecated in the API level 28.

    Are there any other API/method I could use to get access to my phones wireless card without needing all these permissions? I know there are Network Scanners out there that do this, but I can't figure out how they do it without these permissions. Any help/suggestions would be a huge help.

    Thanks in advance!!

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

    Quick question about NFC transactions

    Posted: 05 Aug 2019 01:10 PM PDT

    Is there a way to setup phone-to-phone NFC payments? I would like to allow certain users of my app to accept payment for a service without having to purchase and distribute contactless card readers.

    I haven't don't a ton of digging yet, but the only results that turn up regarding this topic are articles from 8 years ago that says PayPal announced it.

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

    Adopting the Arm Memory Tagging Extension in Android

    Posted: 05 Aug 2019 09:01 AM PDT

    Remove AdView in Relative Layout - RecyclerView

    Posted: 05 Aug 2019 12:32 PM PDT

    Hi. I'm trying to show admob ads in my recyclerview. I use this code:

    AdView mAdView = new AdView(holder.adView.getContext()); mAdView.setAdSize(AdSize.MEDIUM_RECTANGLE); mAdView.setAdUnitId(admobadunitid); ((RelativeLayout)holder.adView).addView(mAdView); AdRequest adRequest = newAdRequest.Builder() .addTestDevice("6BD8B99160F5002174D12271DD4D954B") .build(); mAdView.loadAd(adRequest); 

    And in Adapters OnViewRecycled method I wanna destroy the adview. Adview has a destroy method but since I show ads in relative layout I cannot use that. How can I solve this?

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

    Pen Name

    Posted: 05 Aug 2019 10:42 AM PDT

    If I make an app that generates revenue can I publish using an alias to the consumer. I don't mind if google has my name.

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

    [Call Logs / Sms Permission] - New submitting app is rejected by Google Play Console

    Posted: 05 Aug 2019 02:52 AM PDT

    [Call Logs / Sms Permission] - New submitting app is rejected by Google Play Console

    My app reads call logs and display total time for the contacts. The app uses READ_CALL_LOG permissions.

    By mistake i added WRITE_CALL_LOG permissions and my app was rejected by google.

    I got mail from google stating to remove WRITE_CALL_LOG permissions since it is not required under CRM category.

    Later I removed WRITE_CALL_LOG permissions and submitted an update.

    I am getting this screen

    App rejected message

    I am confused by the processing update message .

    Also I am using targetSDKVersion 28.

    I am unable to understand following things:

    1. Has google rejected my update or is still processing update.
    2. If they are rejecting the update then why are they rejecting it?
    3. How can I solve this issue?
    4. Shall I change targetSDKVersion to lower version? Will it work?
    5. Shall I submit new app with lower targetSDKVersion?

    Please provide me solution.

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

    How does your team implement persistence for network calls that isn't a database?

    Posted: 05 Aug 2019 09:37 AM PDT

    Creating a database for like 80% of the network calls of the project I'm working on is overkill as I only need the last payload to be saved. Also, I don't need to query anything.

    How does your team do persistence with something like that? I personally like Room because it gives me a LiveData and so I don't have to worry about changing my architecture and we pass livedata around. But room is too heavyweight for a lot of our network calls. Does your team just use plain old files?

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

    Convert a Relative Layout to a Linear Layout

    Posted: 05 Aug 2019 08:08 AM PDT

    Convert a Relative Layout to a Linear Layout

    I'm developing an Android app, and for the graphic part I'm using the useful editor of Android Studio. This means that I'm moving the objects with the margin commands to make them fit the Google Pixel C screen perfectly. Now I tried the app on the tablet and, of course, it doesn't works. I read that I should be using a Linear Layout, but I think that the code I want to convert doesn't respect its rules, because I've elements on every row and in a different position. How can I represent it with a Linear Layout? This is the code, as you can see it has a specified margin for each element.

    <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/background_main" android:scaleType = "centerCrop" tools:context=".MainActivity"> <TextView android:id="@+id/textView2" android:layout_width="1063dp" android:layout_height="476dp" android:layout_marginLeft="275dp" android:layout_marginTop="200dp" android:fontFamily="@font/kotta_one" android:text="Test del pensiero\n divergente" android:textColor="#000000" android:textSize="100dp" android:textStyle="bold" tools:layout_editor_absoluteX="78dp" tools:layout_editor_absoluteY="123dp" /> <Button android:id="@+id/button_1" android:layout_width="200dp" android:layout_height="50dp" android:layout_marginLeft="400dp" android:layout_marginTop="480dp" android:background="@drawable/button_bg" android:text="@string/invioA" android:textAllCaps="false" android:textColor="#FFFFFF" android:textSize="18dp" app:layout_constraintVertical_bias="0.771" /> <Button android:id="@+id/button_2" android:layout_width="200dp" android:layout_height="50dp" android:layout_marginLeft="680dp" android:layout_marginTop="480dp" android:background="@drawable/button_bg" android:text="@string/invioB" android:textAllCaps="false" android:textColor="#FFFFFF" android:textSize="18dp" app:layout_constraintVertical_bias="0.771" /> <Button android:id="@+id/button_3" android:layout_width="90dp" android:layout_height="70dp" android:layout_marginLeft="40dp" android:layout_marginTop="22dp" android:background="@android:color/transparent" android:fontFamily="@font/kotta_one" android:text="Area\nDocenti" android:textAllCaps="false" android:textColor="#030000" android:textSize="24dp" app:layout_constraintVertical_bias="0.771" /> </RelativeLayout> 

    This is the screenshot of the desired output, which I get only one the emulator:

    https://i.redd.it/u7pu4h9nbne31.png

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

    [HELP] Best way to learn Kotlin in 1 month

    Posted: 05 Aug 2019 06:02 AM PDT

    Hello guys,
    I'm an Android developer since 2014. Due to personal projects and my job, which is only java projects, I couldn't find time to learn Kotlin.

    My goal is to learn(and master?) kotlin in 1-2 months and having that in mind I'd like to ask to those who dominate kotlin, how would you start and which resources would you use in order to achieve that.

    I guess most of ppl would suggest these three resources:
    · https://eu.udacity.com/course/kotlin-for-android-developers--ud888
    · https://eu.udacity.com/course/kotlin-bootcamp-for-programmers--ud9011
    · https://kotlinlang.org/docs/tutorials/koans.html

    But I'm sure there a lot of small projects, medium blogs and these kind of stuff that would help a lot and that's what I'm looking for.

    Thanks.

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

    How to make it responsive. This form works well in Nexus 2 and other with large display but not works in Nexus S and other with small display. How I can make it responsive so that it will work perfectly in every mobile.

    Posted: 05 Aug 2019 11:17 AM PDT

    PlayStore: Large quantity of rating removal

    Posted: 05 Aug 2019 01:27 AM PDT

    Seems like with the change in statistics they also removed a large bunch of reviews from some applications.

    Does anyone have noticed the same?

    I'm talking about 1K ratings removed from 70K this is not small number, there was always some small adjustments from Google that removed perfectly legit comments, but not in such high numbers.

    Strangely they do that just at the time they should be applying the new rating system (That is still not applied) meaning let you think for months that the new rating have no impact on you, then the day before remove a bunch of ratings and then hey finally you are impacted.....

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

    Writing Android apps only with Kotlin

    Posted: 05 Aug 2019 04:55 AM PDT

    Is it possible to write Android apps that are completely written in Kotlin without any use of Java?

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

    How do you go about technical change logs in multiple languages?

    Posted: 05 Aug 2019 12:34 AM PDT

    To all my people who release apps in multiple languages and do change logs with technical info (e.g fixed 'view in examplefragment not aligning properly with the rest of view')

    How do you go about getting that info out to users in multiple languages?

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

    Successful android development résumé samples?

    Posted: 04 Aug 2019 08:32 PM PDT

    I've been having trouble getting interviews. I'm finishing up a PhD in mathematics and I'm trying to pivot into some kind of software role. I've recently been getting into android development and would love to find a job doing it, but I'm having trouble getting interviews (as was the case when I was just looking for general software engineering).

    I was hoping maybe some people out there could help out by posting (or at least DMing) résumés that successfully got them interviews/hired. This might help me and others with figuring out holes in our existing résumés.

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

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel