• Breaking News

    [Android][timeline][#f39c12]

    Tuesday, August 3, 2021

    Weekly Questions Thread - August 03, 2021 Android Dev

    Weekly Questions Thread - August 03, 2021 Android Dev


    Weekly Questions Thread - August 03, 2021

    Posted: 03 Aug 2021 06:00 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?

    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]

    AppSweep, mobile application scanning for developers

    Posted: 03 Aug 2021 05:29 AM PDT

    AppSweep, mobile application scanning for developers

    Hi all!
    Today we've released the first version of our free app scanning tool 'AppSweep'.

    https://appsweep.guardsquare.com/

    https://i.redd.it/mfudoz26z4f71.gif

    The initial set of static analysis passes aims to check your uploaded apk for bad crypto setups, faulty handling of TLS connection and webviews, visible keys, leftover logging code, etc..

    Different from other tools, our goal is to make a tool for mobile apps that is focused on dev users.
    This means, for example;

    • we don't tell you which permissions your app is using 😉
    • you can easily cut through any potential noise using familiar navigation such as the package structure, libs & dependencies vs your code,…
    • we support ProGuard/R8 mapping files so you can easily locate issues
    • clear, technical explanations of findings
    • a simple API for CI integration and a GitHub app are available

    We also created a Gradle plugin, in order to seamlessly integrate into CI/CD pipelines. The plugin can be found on the gradle plugin repo and on GitHub.

    Similar to ProGuard, we're counting on the Android developer community to guide us in further development. What did you like? What annoyed you? Any insights on things you hoped we would flag, info about issues you previously had flagged in pentests… All input is welcome here or at our Discourse community.

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

    Re-writing the AOSP Calendar App in Kotlin

    Posted: 03 Aug 2021 10:13 AM PDT

    How would one go about bypassing this? How does the app recognise the device?

    Posted: 03 Aug 2021 03:35 PM PDT

    Terms of Service and Privacy Policy question

    Posted: 03 Aug 2021 12:03 PM PDT

    I'm Planning to publish my app soon on the google play store and had questions regarding TOS requirements. Specifically do I need to have the document notarized and do I need to be a company to do so. Currently the TOS is binding to me an individual and not a company is this legally correct, and if yes is it even a wise decision to publish as an individual rather than under an LLC. Any thoughts and or advice would be much appreciated as I am a novice to the publishing process. Thanks!

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

    How to make a custom SeekBar?

    Posted: 03 Aug 2021 05:50 AM PDT

    How to make a custom SeekBar?

    I want to make a SeekBar with which you can move another view. This seekbar should have preview of another view as a background. It should look like this one in the picture. Is this a custom SeekBar or something completely different?

    https://preview.redd.it/t5w1nbyi35f71.jpg?width=1998&format=pjpg&auto=webp&s=d15cf4ad5157840f367a0e665f8517bea4855a93

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

    Kiwi: An Auto-scroller Adventure Game!

    Posted: 03 Aug 2021 10:08 AM PDT

    Kiwi needs your help! We're planning on releasing this game soon with @moonriftentertainment and could use help spreading the word about it. You could also donate to the Indiegogo campaign, this would help offset development costs and help with advertising. I hope you have just as much fun playing Kiwi as I did helping create it! This game will be released on mobile and PC platforms, specifically the Google Play store, Windows store, itch.io, and Steam.

    Kiwi Game Trailer

    Source code: https://github.com/connorjbryant/Kiwi

    Indiegogo Campaign: https://www.indiegogo.com/projects/kiwi--2/x/26912515#/

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

    Viewmodels, delays and lifecycle problems

    Posted: 03 Aug 2021 04:40 AM PDT

    I am animating a view in a fragment. I would like to pause the animation when it goes to background and restart it again when it returns to foreground. I also need to show a button with 10 seconds delay in the same screen. How can I achieve it on ViewModel ?

    We can get the fragment to inform ViewModel about the lifecycle changes like onResume() or onPause() by calling some methods in ViewModel. Or we can use LifecycleObserver. Is there any other way to do this ? Which option would be better for my scenario ?

    To show button with 10 second delay, we can use Handler in ViewModel. Or use coroutines which would still use Handler internally. I also need to cancel the delay if app goes to background. Is there any other way to handle this ?

    submitted by /u/No-Week7414
    [link] [comments]

    Android Studio arctic fox blurry preview in XML

    Posted: 02 Aug 2021 08:27 PM PDT

    Has anyone seen this?

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

    Accessing chrome content provider

    Posted: 03 Aug 2021 06:46 AM PDT

    Im trying to access the browsing history of my mobile browser (Chrome) via adb shell.The command i'm using is:

    content query --uri content://com.android.chrome/org.chromium.chrome.browser.provider.ChromeBrowserProvider

    Please correct if i'm wrong, but the string "com.android.chrome" is the name of Content Provider of the Chrome app, and the string "org.chromium.chrome.browser.provider.ChromeBrowserProvider" is a reference to the database table that i'm presuming contains data related to my browsing history.

    When i run this command i get a "No results found" message in the shell terminal so obviously there's something i'm missing here.Am i going about this the right way? Is my content uri structured correctly? Can anyone provide me some sort of link that can help me out with accessing data specifically from the Chrome content provider via adb shell? If it makes any difference i'm using powershell on windows 10 and my phone is android 10

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

    Android Integrated Softphone

    Posted: 03 Aug 2021 05:08 AM PDT

    Hello all,

    I have been using zoiper for a while, but it is quite expensive and I don't even use 1/3 of my total devices

    I'm wondering if there's any native / integrated softphone already in android

    Thanks for any help you can give

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

    ViewModel and Fragment

    Posted: 03 Aug 2021 01:12 AM PDT

    I have a couple of questions regarding viewmodel and fragment as I couldn't find my answers online.

    Let's assume we have a fragment and inside of it we do:

     private val viewModel by viewModels<UsersViewModel>() 

    As I understood, here we use the extension method viewModels() which will create an instance of the class UsersViewModel .... So let's say in the UsersViewModel I have:

     private val userLiveData = MutableLiveData<MutableList<UserResponse>>() private val dataStatusLiveData = MutableLiveData<Int>() fun getUsers(): MutableLiveData<MutableList<UserResponse>> { return userLiveData } fun getDataStatus(): MutableLiveData<Int> { return dataStatusLiveData } init { loadUsers() } private fun loadUsers() { viewModelScope.launch { dataStatusLiveData.postValue(View.VISIBLE) val users = repository.fetchAllUsers() when (users.isSuccessful) { true -> { if (users.body() != null) { usersLiveData.postValue(countries.body()) dataStatusLiveData.postValue(View.GONE) } } else -> { dataStatusLiveData.postValue(1) } } } } 

    And in Fragment I have:

     private fun setUpUserList() { adapter = usersView.adapter as UserAdapter viewModel.getUser().observe(viewLifecycleOwner, { userList -> adapter.setUserList(userList) }) observeStatus() } private fun observeStatus() { viewModel.getDataStatus().observe(viewLifecycleOwner, { status -> when(status){ 0 -> { progressBar.visibility = View.VISIBLE } 8 -> { progressBar.visibility = View.GONE } 1 -> { Toast.makeText(context,getString(R.string.errorMsg),Toast.LENGTH_SHORT).show() } } }) } 

    1. When this is called private val viewModel by viewModels<UsersViewModel>() does it call the init block since it's creating an instance of it? Or when getUser().observe(..) does it call the init block and observes the data?
    2. Inside loadUsers I'm using a liveData for status and for the data I'm getting from the web service. If let's say I comment this call observeStatus() in fragment, why doesnt getDataStatus() observe the status?
    submitted by /u/learningcodes
    [link] [comments]

    Where to go from here?

    Posted: 02 Aug 2021 06:28 PM PDT

    Hi guys I've been taking computer engineering in college and I'm in my 5th semester last semester I took mobile programming in android studio since then I've been dead set on getting a job in the field I enjoy it very much I'm just gonna finish my degree since it's a 6 semester program but so far in android I've made tons of apps and I'm comfortable using rest apis getting them using okhttp, fragments or activities, json parsing and some material design aspects also I'm a java programmer is kotlin that much different? What should I try to learn next to make myself a better programmer?

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

    Question on optimizing recyclerview/viewpager2 that loads image performance.

    Posted: 02 Aug 2021 11:30 PM PDT

    Hi. I'm looking for ideas as to how I could improve the performance of my code. I need to populate my recyclerviews with data that includes image data, and the loading of images take time. I implemented viewbinding bindingadapters in my recyclerview item layout. Currently in my fragment, I call submitList to my adapter only after receiving all of my data from the server, and even loading 5 profiles takes up to 8 secs on this.

    I believe I can optimized the recycle view by decoupling the loading of the image from the rest of the data, but I'm not sure how to bind the image if I'm loading it later because with my current implementation I submit the list in the fragment which includes the image bytes data. Can anyone please help me through this?

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

    Can someone walk me through how emojicompat works and its implementation?

    Posted: 02 Aug 2021 11:04 PM PDT

    I've spent about 2 weeks looking at different articles and the little information I can find on youtube but I have no idea what to do or how to implement it. There must be a code already made or something. If there is, I can't find it.

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

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel