• Breaking News

    Sunday, April 5, 2020

    Android Dev - Chucker v3.2.0 is out 🚀 - with a lot of UI/perf. improvements, RTL support, URL decoding and much more.

    Android Dev - Chucker v3.2.0 is out �� - with a lot of UI/perf. improvements, RTL support, URL decoding and much more.


    Chucker v3.2.0 is out �� - with a lot of UI/perf. improvements, RTL support, URL decoding and much more.

    Posted: 05 Apr 2020 03:17 AM PDT

    Google is trying to fix Android camera apps but it's not going to work - AndroidCentral

    Posted: 05 Apr 2020 01:02 AM PDT

    I need to do some large math operations in my app, and i used AsyncTask till now, what is a good alternative?

    Posted: 05 Apr 2020 02:34 AM PDT

    The app is in Java, so can't use coroutines. Also i am a multithreading noob.

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

    Android Navigation component button navigation to another fragment and back shows blank screen

    Posted: 05 Apr 2020 06:05 AM PDT

    Am using navigation component to handle navigation in my app, i have a user profile with two buttons , one is to navigate to users posts when clicked and the other is to log out the user

    class MeFragment : BaseFragment() {

    override fun onCreateView(
    inflater: LayoutInflater, container: ViewGroup?,
    savedInstanceState: Bundle?
    ): View? {
    // Inflate the layout for this fragment
    return inflater.inflate(R.layout.fragment_me, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
    super.onViewCreated(view, savedInstanceState)

    myProperty.setOnClickListener {
    val action = MeFragmentDirections.actionMeFragmentToMyUploadHousesFragment()
    findNavController().navigate(R.id.myUploadHousesFragment)
    }
    logout.setOnClickListener {
    FirebaseAuth.getInstance().signOut()
    }
    }

    }
    but when user clicks on user profile they can navigate just fine, issue is when they click from the posts back to the meFragment, the whole app breaks and shows a blank, here is my navigation component graph

    <?xml version="1.0" encoding="utf-8"?>
    <navigation 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/main_graph.xml"
    app:startDestination="@id/onBoarding">
    <action
    android:id="@+id/action_logout"
    app:destination="@id/authFragment"
    app:enterAnim="@anim/nav_default_enter_anim"
    app:exitAnim="@anim/nav_default_exit_anim"
    app:popEnterAnim="@anim/nav_default_pop_enter_anim"
    app:popExitAnim="@anim/nav_default_pop_exit_anim"
    app:popUpTo="@id/main_graph.xml"
    app:popUpToInclusive="true" />
    <fragment
    android:id="@+id/onBoarding"
    android:name="org.hero76.zedhousely.ui.fragments.onBoarding.OnBoarding"
    android:label="OnBoarding"
    tools:layout="@layout/fragment_on_boarding">
    <action
    android:id="@+id/action_onBoarding_to_authFragment"
    app:destination="@id/authFragment"
    app:enterAnim="@anim/nav_default_enter_anim"
    app:exitAnim="@anim/nav_default_exit_anim"
    app:popEnterAnim="@anim/nav_default_pop_enter_anim"
    app:popExitAnim="@anim/nav_default_pop_exit_anim"
    app:popUpTo="@id/main_graph.xml"
    app:popUpToInclusive="true" />
    </fragment>
    <fragment
    android:id="@+id/authFragment"
    android:name="org.hero76.zedhousely.ui.fragments.authHost.AuthFragment"
    android:label="AuthFragment"
    tools:layout="@layout/fragment_auth">
    <action
    android:id="@+id/action_authFragment_to_phoneVerificationFragment"
    app:destination="@id/phoneVerificationFragment"
    app:enterAnim="@anim/nav_default_enter_anim"
    app:exitAnim="@anim/nav_default_exit_anim"
    app:popEnterAnim="@anim/nav_default_pop_enter_anim"
    app:popExitAnim="@anim/nav_default_pop_exit_anim"/>
    </fragment>
    <fragment
    android:id="@+id/loginFragment"
    android:name="org.hero76.zedhousely.ui.fragments.login.LoginFragment"
    android:label="LoginFragment"
    tools:layout="@layout/fragment_login" />
    <fragment
    android:id="@+id/signUpFragment"
    android:name="org.hero76.zedhousely.ui.fragments.signUp.SignUpFragment"
    android:label="SignUpFragment"
    tools:layout="@layout/fragment_sign_up" />
    <fragment
    android:id="@+id/homeFragment"
    android:name="org.hero76.zedhousely.ui.fragments.home.HomeFragment"
    android:label="Home"
    tools:layout="@layout/fragment_home" />
    <fragment
    android:id="@+id/homepageFragment"
    android:name="org.hero76.zedhousely.ui.fragments.homepage.HomepageFragment"
    android:label="fragment_homepage"
    tools:layout="@layout/fragment_homepage" >
    <action
    android:id="@+id/action_homepageFragment_to_categoryFragment"
    app:destination="@id/categoryFragment"
    app:popUpToInclusive="false" />
    </fragment>
    <fragment
    android:id="@+id/meFragment"
    android:name="org.hero76.zedhousely.ui.fragments.me.MeFragment"
    android:label="fragment_me"
    tools:layout="@layout/fragment_me" >
    <action
    android:id="@+id/action_meFragment_to_myUploadHousesFragment"
    app:destination="@id/myUploadHousesFragment" />
    </fragment>
    <fragment
    android:id="@+id/postFragment"
    android:name="org.hero76.zedhousely.ui.fragments.post.PostFragment"
    android:label="fragment_post"
    tools:layout="@layout/fragment_post" />
    <fragment
    android:id="@+id/searchFragment"
    android:name="org.hero76.zedhousely.ui.fragments.search.SearchFragment"
    android:label="fragment_search"
    tools:layout="@layout/fragment_search" />
    <fragment
    android:id="@+id/servicesFragment"
    android:name="org.hero76.zedhousely.ui.fragments.services.ServicesFragment"
    android:label="fragment_services"
    tools:layout="@layout/fragment_services" />
    <fragment
    android:id="@+id/otpVerificationFragment"
    android:name="org.hero76.zedhousely.ui.fragments.phone.OtpVerificationFragment"
    android:label="OtpVerificationFragment" >
    <action
    android:id="@+id/action_otpVerificationFragment_to_signUpFragment"
    app:destination="@id/signUpFragment" />
    <action
    android:id="@+id/action_otpVerificationFragment_to_homeFragment"
    app:destination="@id/homeFragment" />
    </fragment>
    <fragment
    android:id="@+id/phoneVerificationFragment"
    android:name="org.hero76.zedhousely.ui.fragments.phone.PhoneVerificationFragment"
    android:label="PhoneVerificationFragment" >
    <action
    android:id="@+id/action_phoneVerificationFragment_to_otpVerificationFragment"
    app:destination="@id/otpVerificationFragment" />
    </fragment>
    <fragment
    android:id="@+id/myUploadHousesFragment"
    android:name="org.hero76.zedhousely.ui.fragments.me.MyUploadHousesFragment"
    android:label="fragment_my_upload_houses"
    tools:layout="@layout/fragment_my_upload_houses" >
    <action
    android:id="@+id/action_myUploadHousesFragment_pop"
    app:popUpTo="@id/meFragment"
    app:popUpToInclusive="true" />
    </fragment>
    <fragment
    android:id="@+id/categoryFragment"
    android:name="org.hero76.zedhousely.ui.fragments.category.CategoryFragment"
    android:label="CategoryFragment" >
    <action
    android:id="@+id/action_categoryFragment_to_homepageFragment"
    app:destination="@id/homepageFragment" />
    </fragment>
    </navigation>

    Asking for help on how to fix the issue.

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

    Greg Kroah Hartman AMA coming next week, write your questions now!

    Posted: 05 Apr 2020 01:23 AM PDT

    What subjects do I need to learn for a stick balance game?

    Posted: 05 Apr 2020 05:49 AM PDT

    Our professor wanted us to build something simple with Android sensors. A simple app that displays sensor values would probably do just fine but I want to build a fun app, an app that would teach me more than a 5-10 minutes tutorial does.

    So I decided to build a stick balance game where a long stick slowly tips one side and the player uses accelerometer to try to keep it standing up.

    I am a novice Android dev but I thought it is still doable for someone on my level, with a bit of a challenge of course.

    Now, my question is, what topics should I be looking at to build something like this? I hope I don't have to use a physics engine or something

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

    Android Studio Layout Inspector

    Posted: 04 Apr 2020 10:21 AM PDT

    Coroutines and callbacks

    Posted: 05 Apr 2020 05:31 AM PDT

    Sharing ad revenue with app users?

    Posted: 05 Apr 2020 09:03 AM PDT

    I wanted to ask if it is feasible to share ad revenue with your app users and still be in profit? I see no one using revenue sharing in their apps and idk why. Does ad agencies like admob allow it? I checked a social platform called "Tsu" that got shut down in 2014 and they were sharing ad revenue. Can someone please guide me a bit.

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

    how does a constrain layout work ?

    Posted: 05 Apr 2020 08:45 AM PDT

    I'm a beginner and the course I'm doing won't teach what a constrain layout is. I've trie to see various tutorials but I'm not able to understand. Any help will be appreciated :)

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

    I am making an application in android studio with Java and having a problem with getting the user to set a max value to then start a new intent? Any solutions?

    Posted: 05 Apr 2020 08:40 AM PDT

    1. Hello I am having a problem with some code in android studio Java, i am quite new to this and not understanding how to get the code to work I have tried multiple things. I am making a counter app, I want the user to be able to input a max value to then start a new activity that will show a message. i am struggling to get the set numbers to start the intent when chosen.
    2. I have used the radio button for the selection of the values 100, 200 and 300. I was able to get them to select and the counter works, however the counter either becomes slow when I remove some things or the intent does not start when the selected radio button is hit. Also when selected the counter will get to 102 and then crash? When i use the minus button it also crashes the app, However when i keep it simple everything works.
    3. I was wondering should i change it to a for loop? or is it the code within the switch? or is it the plus method ?
    4. I have tried changing the ` if (checked && CounterValue == 100 )` as well but nothing seemed to work.
    5. Any help i would be very much grateful thanks.

    package com.example.myapp; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.content.Intent; import android.view.View; import android.widget.RadioButton; import android.widget.TextView; public class MainActivity extends AppCompatActivity { // counter value declared as zero int CounterValue = 0; u/Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public void minus(View view) { // when button is clicked will minus the value. TextView textView = (TextView) findViewById(R.id.tx); // Value cant fall below 0 when being subtracted. if (CounterValue > 0) { CounterValue--; } textView.setText(String.valueOf(CounterValue)); } public void plus(View view) { TextView textView = (TextView) findViewById(R.id.textZero); CounterValue++; textView.setText(String.valueOf(CounterValue)); } public void onRadioButtonClicked(View view) { boolean checked = ((RadioButton) view).isChecked(); // Check which radio button was clicked switch(view.getId()) { case R.id.value1: if (checked ) { CounterValue = 100; Intent intent = new Intent(MainActivity.this, Main2Activity.class); startActivity(intent); } break; case R.id.value2: if (checked ) { CounterValue = 200; Intent intent = new Intent(MainActivity.this, Main2Activity.class); startActivity(intent); } break; case R.id.value3: if (checked ) { CounterValue = 300; Intent intent = new Intent(MainActivity.this, Main2Activity.class); startActivity(intent); } break; } } } 
    submitted by /u/Not_zedd_ko
    [link] [comments]

    Survey: How do you deal with strings across modules and projects?

    Posted: 05 Apr 2020 08:36 AM PDT

    There are many ways to manage strings across projects, and I am curious how you all have it set up.

    A few questions to get started:

    • How do you handle common strings such as ok, cancel, etc. They don't need to be re-translated in each project. Translation Memory in many translation systems can help with this, but it requires each project to be correctly set up as well. How do you copy/paste the source strings: manually, or do you have any automation to reuse strings already translated?

    • How do you share strings across modules? Again, taking the samples from above, many strings are expected to be common across multiple modules in the same project. Do you only keep a single copy in a dependent module, or have an overriding definition in the depending module?

    • How do you have the same string being included using different names, E.g. @string/ok & @string/ok_button both referring to OK in two separate modules.

    Things I tried:

    • Keeping separate copies of strings in each module: Immediately became a pain to manage.

    • Moving all strings out to a :strings module, that all other modules depend on. Make this a git submodule so strings are easy to update across multiple projects. The big downside is that Android Studio & Lint cannot remove any strings from any projects, because apparently the UnusedResources rule only works within modules.

    • Speaking of lint, the UnusedResources rule is pretty un-intelligent. It failed to identify several instances of strings that were actually unused. E.g. if a string is defined in both :core module and :ui module (names are examples), and is only used in the :core module, I would expect it to be trimmed from the :ui module, but lint cannot catch that.

    • shrinkResources is true for my release build, but it ends up keeping all the strings, even those that are completely unused anywhere in any module.

    • I have multiple files to separate strings by purpose, e.g. strings_common.xml for multiple projects, and then strings_project1.xml, strings_project2.xml, strings_project3.xml. But there are many strings in strings_common.xml that are only used in Project 1 and 2 but not 3. Lint & resource shrinking have been useless when run on Project 3.

    • Marking certain strings as private in a library module (using <public/>) seems to have no effect on lint or shrinkResources handling.

    My ideal set up would be to have lint and shrinkResources work correctly, and then use a single :strings module across projects with multiple strings.xml files, one for each project. That way, it's easy to reuse any common strings, and only the minimal set of strings will get compiled into resources.arsc.

    Maybe there's a better linter than the default? Maybe it's worth rolling out a simple script that does regexp matching for R\.string\.[a-z]+ and @strings/[a-z_]+ and trims away unused strings?

    So, Reddit, how do you manage your strings? Thanks for sharing your strategies!

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

    project balls - Android Game

    Posted: 05 Apr 2020 08:23 AM PDT

    Hi,

    I develop mobile games in my spare time and I'm faily new to this. So I made a very simple arcade game about falling balls.

    I would love to hear your thougths about it. I want to improve this game as much as possible.

    Have fun playing!

    Google Play

    My Website

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

    How difficult is it to create overlaying apps?

    Posted: 05 Apr 2020 03:51 AM PDT

    I don't have any experience developing with Android (I do have experience with Java applications).

    How hard do you think it would be to create an app that is an "app edge drawer" (overlay on the screen)? Like the thousands that exist but I would like to make one with some specific configurations to suit my needs.

    I am talking about this kind of apps: https://play.google.com/store/apps/details?id=com.schiztech.swapps, where I can have 5 or 6 apps appear after a specific gesture or something.

    Also if I were to dive in, Kotlin or Java?

    Thanks!

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

    Image from camera or gallery comes rotated sometimes

    Posted: 05 Apr 2020 06:06 AM PDT

    Sometimes, when I load an image from the gallery or the camera the image gets rotated not in a 90Degrees angle but just a little bit something like 5 Degrees and I can't explain it since it's not even happening consistently but random, and it has nothing to do with the actual image sometimes it rotates a certain image and sometimes it doesn't rotate the same image. I already have tried setting the rotation to the actual rotation of the image after selecting but somehow it doesn't care and I can't find people with the same problem, so thanks in advance for everyone helping me with this.

    Here is my code for the selection of the image:

    code

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

    How to add margin to the MaterialButton inside MaterialButtonToggleGroup?

    Posted: 05 Apr 2020 05:39 AM PDT

    It's not working by setting android:layout_margin="16dp" to the buttons

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

    [Lyla Fujiwara / Shailen Tull] Android Conference Talks - Easy Android accessibility

    Posted: 04 Apr 2020 06:14 PM PDT

    The Killer App for Learning and Career Growth

    Posted: 05 Apr 2020 05:09 AM PDT

    Why would you ever use a Relative Layout over a Constraint Layout?

    Posted: 05 Apr 2020 07:58 AM PDT

    I understand constraint layouts are a tad bit faster to render, but seriously isn't constraint layout just a better Relative Layout?

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

    Do you guys ever need to use Relative layouts over Constraint Layouts?

    Posted: 05 Apr 2020 08:08 AM PDT

    I understand constraint layouts are a tad bit faster to render, but seriously isn't constraint layout just a better Relative Layout?

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

    Why would you ever use a Relative Layout over a Constraint Layout?

    Posted: 05 Apr 2020 07:56 AM PDT

    I understand constraint layouts are a tad bit faster to render, but seriously isn't constraint layout just a better Relative Layout?

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

    Is it possible to "upgrade" a legacy app?

    Posted: 04 Apr 2020 12:39 PM PDT

    Hi all,

    To start, I have a very old Android app that is not created by me. The app is not listed on the Google Play Store anymore, and I couldn't track down the original developer even after some intense Googling.

    The issue i have with the app is that... its functions are placed behind the legacy "menu" button. With Android 10, that button is gone - so now the app is pretty much unusable. I couldn't find any alternatives that work as well as the original app, so which is why I am asking here.

    I just want to change the functions locked behind the menu button to be placed in any other form of a "menu" button.

    I tried exploring some methods of decompiling it and modifying it, but my coding skills are at a beginner level at best.

    So I'm wondering... is "upgrading" a legacy app even possible?

    P/S: This app is not meant to be published in any app store. It's strictly for personal use.

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

    Why do we use an integer array to store images?

    Posted: 04 Apr 2020 11:10 PM PDT

    I'm very new to Android App Development and I recently learnt that integer arrays are used to store images that we have in the drawables folder, that is we write the command as int[] arrayName = {R.drawables.img1, R.drawables.img2 .. and so on}. Can please someone help me understand how integer arrays store images?

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

    Need to save changes on activity exit, but also need to inform user via AlertDialog if something goes wrong

    Posted: 04 Apr 2020 10:25 PM PDT

    I'm in a bit of an interesting situation.

    My app has a bottom navigation that switches between five main activities. Right now it does not use fragments, it just switches to a whole new activity when you click one of the bottom nav icons (fragments are likely coming in the next iteration of the project). The app also makes use of an API to get/update data.

    When the user clicks the "Inventory" tab, the inventory activity is shown. It gets all of the items in the user's current inventory, along with buttons to change the quantity or add a new item. So that I don't have to hit the API every single time an update is made, I store these changes locally until the user leaves the activity (which calls OnPause()).

    In OnPause(), I call the API asynchronously to update the data. This works out perfectly fine, assuming that the API is accessible and is served valid data. If an exception occurs or the API returns a negative result, I have code that is supposed to pop up an AlertDialog informing the user. However, this dialog never appears. And if the API can't be reached at all, the app *crashes* after about a 20 second timeout - the exception handling code is never called at all.

    To test further, I added a toast message - these work fine, but I really would like to show a dialog, as I don't think a toast clarifies the situation well enough, and it doesn't give the user an opportunity to rectify it or possibly email the devs/file a bug report.

    After further research, it seems that the dialog won't work because I'm using the current activity (this) as the dialog context, and the activity is destroyed before that dialog has a chance to appear. (Still doesn't explain why the toasts still work, as I do pass this for the context. I guess toasts are special?) If I push down the call to super (base in my case, since I'm using Xamarin), the whole app crashes claiming I never called through to super. Some people are saying to override OnBackPressed(), but that doesn't work for me since I'm using bottom nav.

    What is the best way to accomplish what I'm trying to do?

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

    No comments:

    Post a Comment