• Breaking News

    [Android][timeline][#f39c12]

    Tuesday, January 26, 2021

    Weekly Questions Thread - January 26, 2021 Android Dev

    Weekly Questions Thread - January 26, 2021 Android Dev


    Weekly Questions Thread - January 26, 2021

    Posted: 26 Jan 2021 06:00 AM PST

    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]

    Should I just ignore "This APK contains Java/Kotlin code, which might be obfuscated. We recommend you upload a deobfuscation file to make your crashes and ANRs easier to analyze and debug."?

    Posted: 26 Jan 2021 11:04 AM PST

    This warning comes up each time I'm uploading a new APK version. I'm working in Unity. Should I ignore it, or can it lead to a problem?

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

    noob here!

    Posted: 26 Jan 2021 01:26 AM PST

    Hi. I am actually a civil engineer but I have a huge interest in coding and web development. I just finished learning HTML on my own and also have a basic knowledge in C programming. now i want to learn about android app development but i don't have any basic background knowledge.. so which programming language should i learn ? or what are the things i need to learn for developing android app? where can i get the best online courses? (For free)

    (thanks in Advance)

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

    Looking for feedback on a project using Paging 3 with RemoteMediator and NetworkBoundResource

    Posted: 26 Jan 2021 10:10 AM PST

    Looking for feedback on a project using Paging 3 with RemoteMediator and NetworkBoundResource

    Hey, I'm looking for a code review on my project (link at the bottom). The focus of this project is offline caching with NeworkBoundResource and with Paging 3 + RemoteMediator. I tried to follow an MVVM architecture as described in the official Guide to App Architecture.

    If you want to try out the app you need a free API key from The Guardian and you have to put it as guardian_api_key="your_key" into gradle.properties.

    The project is a news app with 3 screens:

    The World fragment shows the 100 latest breaking news which are cached offline using NeworkBoundResource (with Flow) and Room. There is no pagination on this screen. The NeworkBoundResource refreshes every 5 minutes when the screen becomes active. I've set this timespan low for easier testing, normally this would be higher.

    The Search fragment is paginated using Paging 3 with RemoteMediator. All search queries get cached in Room and they will be displayed if the remote fetch fails (for example when there is no internet connection).

    The Bookmarks fragment is self-explaining. It should synchronize flawlessly between the other 2 fragments.

    If you want to help me find bugs please put emphasis on these things:

    -Search and refresh with and without airplane mode, does the RecyclerView show the correct state in every situation? Do earlier queries show up reliably if you search for a query again while offline?

    -When you search for a new query, the search results should not be visible until remote fetch either succeeded or failed. I did this on purpose because after refresh we scroll to the top and it would be confusing if the user was able to already start scrolling and then jumps back to the top after loading has finished.

    -Scroll very far and see if pagination causes any problems. Clicking on the bottom nav tab again should bring you back to the top no matter how far down you've scrolled.

    -Add and remove bookmarks on different screens, all RecyclerViews should keep their scrolling position.

    -Do you ever end up in weird/unexpected scrolling positions?

    -Try everything to break this project. The Search screen should be much more prone to bugs than the rest.

    Project link: https://github.com/codinginflow/MVVMNewsApp

    I'm thankful for any help!

    https://preview.redd.it/eoxch71gzpd61.png?width=383&format=png&auto=webp&s=c34938b12185d0477c45b77eb182b349d8cd4721

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

    Android Library for easing Media Selection to your apps with support for Images and Videos with a beautiful sample app.

    Posted: 26 Jan 2021 10:22 AM PST

    Android Library for easing Media Selection to your apps with support for Images and Videos with a beautiful sample app.

    Features

    • Written in Kotlin
    • Pick Multiple Images and Videos
    • Restrict User to Pick no of Images and Videos
    • Capture Images and Videos
    • Latest CameraX API

    https://github.com/akshaaatt/Media-Picker

    Make sure to star the project if you liked my contribution :)

    I've added a cool sample app which helps better understand the usage.

    Hope it helps you out!

    Sample App

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

    How to Customize Android Snackbar

    Posted: 26 Jan 2021 02:05 PM PST

    What is Android Snackbar 💭 and how to customize it: action button, anchor, themes, and a custom view.
    Everything is covered in this guide! 👇
    https://vladsonkin.com/how-to-customize-android-snackbar/

    🌟 I also added an article rating after the post. It's just 1 click, check it out! But don't give me 1 star 😅

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

    Can TV App Repo Be Modded?

    Posted: 26 Jan 2021 03:22 PM PST

    With tv app repo you can create a apk that it visible on android tv, it can make two different apks for different tasks one for installing a shortcut to open a different apk for the purpose of making a visable banner for sideloaded apks the other function is that it can open a https link in a browser window from a shortcut/banner on the Home Screen! Is there a way to find a way to put these two functions together, I would like a to build a single apk that can open a linked apk and also send a https get request silently instead of opening a browser

    This is the version on tv app repo I've been trying to learn from https://github.com/ITVlab/TvAppRepo/releases/tag/1.1.4

    Can any body make me a template I could edit and build with android studio? I am VERY new to this and could do with some direction please

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

    How do you share code between different apps?

    Posted: 26 Jan 2021 03:11 PM PST

    Hello Android Devs,

    At my company, we will have multiple applications that will re-use code from the same library modules. For those of you in a similar situation, how do you manage this situation?

    • Do you have a Single Project with Multiple App Modules?
      • Our main app project right now is pretty big, and I worry that adding more application modules will make the project much slower when compiling and syncing.
    • Do you deploy the shared modules as AARs in a private Maven Repository?
      • I feel like this will make the project more difficult to debug, especially when library code needs to be changed.
    • Maybe you use another strategy that I have not considered?

    Thanks!

    View Poll

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

    What exactly does Google Play want in my privacy policy?

    Posted: 26 Jan 2021 06:05 AM PST

    I have had my app rejected a few times because of my privacy policy. I am using Admob to serve ads.

    This is the privacy policy that got rejected:

    I use a Admob, a third party service. It collects some information about the user's habits and/or devices.

    Admob's privacy policy is available here: https://policies.google.com/privacy

    Does anyone here have experience with this? What exactly do they want?

    Edit: Heres what I am going to try again with:

    This app uses Admob, a third party service.

    It collects the following information:

    • IP address, which may be used to estimate the general location of a device.
    • Non-user related crash logs, which may be used to diagnose problems and improve the SDK. Diagnostic information may also be used for advertising and analytics purposes.
    • User-associated performance data such as app launch time, hang rate, or energy usage, which may be used to evaluate user behavior, understand the effectiveness of existing product features, and plan new features. Performance data may also be used for displaying ads, including sharing with other entities that display ads.
    • A Device ID such as the device's advertising identifier or other app-bounded device identifiers, which may be used for the purpose of third-party advertising and analytics.
    • Advertising data, such as advertisements the user has seen, may be used to power analytics and advertising features.
    • Other user product interactions like app launch taps, and interaction information, like video views, may be used to improve advertising performance.

    It uses the information to:

    • Deliver their services
    • Maintain and improve them
    • Develop new services
    • Measure the effectiveness of advertising
    • Protect against fraud and abuse
    • Personalize content and ads you see on Google and on our partners' sites and apps

    In order to opt out of personalized advertising, click here: https://adssettings.google.com/authenticated

    Admob's privacy policy is available here: https://policies.google.com/privacy

    submitted by /u/DROP-TABLE-GOOD-ALTS
    [link] [comments]

    Easy way to improve long-term retention: with User Stats ��

    Posted: 26 Jan 2021 02:20 PM PST

    I'm currently on a mission to improve the retention for my app. One way that I've recently been able to improve long-term retention is by adding user stats. It's just a small section in the menu that shows the user how many days they've been using the app and how many entries they've written with my app.

    Caveats:

    • This worked my journaling app called ✍️Writeaday, so the learning may be specific to this space.
    • Short-term retention was not affected.

    I write about this in more detail here: App Millionaire: [Experiment][Ship] User Stats 📊

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

    Need help Android Studio

    Posted: 26 Jan 2021 02:09 PM PST

    So I am new to coding so I am trying to learn by creating random things, I am trying to get a countdown timer off github ( GitHub - iwgang/CountdownView: Android Countdown View ) and I'm getting an error: "incompatible types: void cannot be converted to CountdownView"

    CountdownView mCvCountdownView = (CountdownView) mCvCountdownView.start(995550000); 

    I'm getting the error at the .start bit. This is done in Android Studio BTW. Any help is greatly appreciated!

    submitted by /u/1111cs
    [link] [comments]

    Someone told me when making layouts text sizes should always be in multiples of 2 for best performance. Eg 12sp 14sp 16sp ect. Is this correct?

    Posted: 26 Jan 2021 02:09 PM PST

    What do I need to develop an app like my Talking Pet

    Posted: 26 Jan 2021 12:17 PM PST

    What do I need to develop an app like my Talking Pet

    https://play.google.com/store/apps/details?id=info.wobamedia.mytalkingpet.free&hl=tr&gl=US

    For android for face landmark , animate , filters what do i need to use?(opencv etc)

    And how?

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

    How i can fix Notice of Violation of Facebook Audience Network Policy

    Posted: 26 Jan 2021 10:48 AM PST

    A while ago I received this violation from fb audience network .. i made changes to the app and made the ads smoother and less annoying to users (i only use interstitial ads)
    https://i.imgur.com/WWCpnrG.png
    However, Facebook refuses to reactivate the ads and does not seem to be reviewing the app at all

    I even deleted the ads permanently from the app And I've deleted a sdk audience network

    im very disappointed and i don't know what else to do :(

    if someone faces a similar problem, please help !

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

    Live coding interview - good or bad? Why?

    Posted: 26 Jan 2021 02:20 AM PST

    Hi All,

    I would like to know your opinion about live coding during the interview.

    What do you think about a live coding interview?

    What good or bad practices have you seen?

    I deliberately gave only two extreme answers in the survey, because others would be "it depends" answers. Please feel free to elaborate.

    My opinion:

    I see different types of live coding:

    1. Pair programming with IDE
    2. Solving real code problems without IDE
    3. Algorithmic challenge

    I have put it according to my personal usefulness ranking.

    Ad 1) Pair programming live coding can test not only technical skills but also teamwork. This is ok.

    Ad 2) Solving real code problems is a more realistic case scenario, but not a great check without code autocompletion.

    Ad 3 ) IMHO for any modern developer, algorithmically thinking isn't so much needed nowadays. Communication and analysis of business requirements are more useful.

    Of course, algorithms can help but in most common cases and for most of the tasks it's not necessary. Lots of things are done by Framework or IDE. An algorithm challenge can be funny, like solving sudoku, but is it really helpful to check the skills of the candidate? Maybe when it would be a simple algorithm you could check someone's way of thinking, but many times I've seen very hard algorithms and not much time to solve it. You need to know the answer from the beginning to solve it.

    FAANG uses algorithmic challenges, and many other companies want to copy it, but FAANG has a different business model, and they give much more time for the candidate than a typical company.I personally don't believe that this would work for typical software companies where the programmer needs to provide business value for the users.

    View Poll

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

    Login interface

    Posted: 26 Jan 2021 08:12 AM PST

    Hi, I am new to developing apps on Android Studio so I just wanted to know if for two accounts a student account and a volunteer account do I need two login interfaces or one is enough.

    Also if I need just one is there any way to identify which user is a student and which one is a volunteer using firebase because each one has a different kind of profile?

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

    ConstraintSet Overlay Issue

    Posted: 26 Jan 2021 07:51 AM PST

    ConstraintSet Overlay Issue

    Trying to insert a view below a recycler view at runtime for a fragment. For some reason, the inserted view keeps overlaying the recyclerview instead of going below it. Created simpler example below (real one inserts AdMob banners at runtime for any fragment so you could reuse it too)

    Screenshot

    https://preview.redd.it/g0a4d85d6pd61.png?width=135&format=png&auto=webp&s=7dde802f74b641ec8c6f87c00988801a5d29769f

    linear_recycler.xml

    <?xml version="1.0" encoding="utf-8"?> <layout> <androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/constraintLayout" android:layout_width="match_parent" android:layout_height="match_parent"> <androidx.recyclerview.widget.RecyclerView android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="0dp" tools:listitem="@layout/font_list_item" tools:itemCount="30" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout> </layout> 

    premium_banner.xml (view that should go below recycler)

    <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/premium" android:padding="@dimen/margin_small" android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView android:id="@+id/lock" android:layout_width="50dp" android:layout_height="50dp" android:src="@drawable/lock_flat" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" /> <TextView android:id="@+id/textview" android:layout_width="0dp" android:layout_height="wrap_content" android:text="@string/premium_banner_remove_title" android:textAlignment="center" android:paddingHorizontal="@dimen/margin_medium" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/noAds" app:layout_constraintStart_toEndOf="@id/lock" app:layout_constraintTop_toTopOf="parent" /> <ImageView android:id="@+id/noAds" android:layout_width="50dp" android:layout_height="50dp" android:src="@drawable/no_ads" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout> 

    Fragment

    class TestFragment : Fragment() { override fun onCreateView(inflater: LayoutInflater,container: ViewGroup?,savedInstanceState: Bundle?): View? { val binding = DataBindingUtil.inflate(inflater, R.layout.linear_recycler, container, false) insert(binding.recyclerView) val adapter = TestAdapter(this) binding.recyclerView.adapter = adapter return binding.root } fun insert(belowView: View) { val layout = belowView.parent as ConstraintLayout val pb = View.inflate(shared.context, R.layout.premium_banner, null) pb.layoutParams = ConstraintLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) layout.addView(pb) val set = ConstraintSet() set.clone(layout) set.clear(belowView.id, ConstraintSet.BOTTOM) set.connect(pb.id, ConstraintSet.BOTTOM, layout.id, ConstraintSet.BOTTOM) set.connect(pb.id, ConstraintSet.START, layout.id, ConstraintSet.START) set.connect(pb.id, ConstraintSet.END, layout.id, ConstraintSet.END) set.connect(belowView.id, ConstraintSet.BOTTOM, pb.id, ConstraintSet.TOP) set.applyTo(layout) } } 

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

    Admob match rate and impression dropped to 0 !

    Posted: 26 Jan 2021 03:51 AM PST

    Admob impression were fine when app launched, now it's dropped to 0 impression and 0% match rate per day. No policy violation email, no ad limit , nothing.. I don't understand what's happening. I know sometimes there isn't any ad to serve but it's been 10 days. There is no option to contact admob either.

    If any one had this problem and how you guys fixed it please let me know, Thanks !

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

    Can't find Network Debugging in my Android TV (MiBox)

    Posted: 26 Jan 2021 07:28 AM PST

    As AsyncTask is deprecated, what do I use?

    Posted: 26 Jan 2021 02:17 AM PST

    Hi peeps!

    I hope everyone is safe and well!

    I'm taking advice from my previous thread on here and creating a Repository to deal with my database. However, the tutorial of sorts I'm using to do this is using AsyncTask to do the majority of thread based functions. For example, I'll put my insert class within my repository class:

    public class ProjectRepository { public static class InsertProject extends AsyncTask<Project, Void, Void> { private ProjectDao dao; protected InsertProject(ProjectDao dao) { this.dao = dao; } @Override protected Void doInBackground(Project... projects) { dao.insertProject(projects[0]); return null; } } } 

    Now I'm very aware that AsyncTask is deprecated since API level 30 and I want to use the best way that is as future safe as possible.

    I already have an ExecutorService "ThreadUtil" class which is in charge of the initialisation of my app so should I use that? If so, how? Otherwise what should I use to achieve what the above is doing?

    Thanks guys!

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

    [theory] I think microdroid is related to android apps on windows

    Posted: 26 Jan 2021 05:22 AM PST

    Microdroid is a further stripped down version of GSIs, atleast as per XDA. At the same time, microsoft has announced its plans to bring android apps to windows. I think microsoft will implement microdroid in windows. The XDA post writer thinks microdroid will be used for drm and stuff, and maybe it will, but I think microsoft will also use microdroid for its own purposes.

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

    Video capture quality on social media apps

    Posted: 26 Jan 2021 03:13 AM PST

    Hey all, just a noob here Recently switched from iOS to Android and came to find out there's a noticable difference in video quality when captured in app (tiktok, ig, etc). I heard it's due to a difference in ios vs android coding.

    Does anyone know of a fix for this issue? If not, why is it not yet fixed in the firstplace?

    I hope my question is in place Thank you

    submitted by /u/Inside-Bread
    [link] [comments]

    To use a dependency injection framework or not to

    Posted: 25 Jan 2021 11:25 PM PST

    Ive been reading up on dagger2 and hilt to generate injectors. My use case is to instantiate the data sources, repository and viewmodel factory in an injector class so my code in the views avoid boilerplate. So for any module, I would need 4 methods in my injector object to achieve my requirement. Taking this into account, do I really need to spend time learning a framework and to deal with the pitfalls associated with committing to a library?

    submitted by /u/Revolutionary-Print4
    [link] [comments]

    Draw trail on offline map - which library would you choose ? (Excluding google maps)

    Posted: 25 Jan 2021 04:50 PM PST

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel