• Breaking News

    Monday, December 23, 2019

    Android Dev - Weekly "who's hiring" thread!

    Android Dev - Weekly "who's hiring" thread!


    Weekly "who's hiring" thread!

    Posted: 23 Dec 2019 04:44 AM PST

    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 - December 23, 2019

    Posted: 23 Dec 2019 02:56 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?

    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]

    How to not get banned on Google Play - a wide range of android dev issues with Google Play are summarized expertly in this satirical mandroiddev post

    Posted: 22 Dec 2019 10:13 PM PST

    Why working with fragments is so inconvenient in Android?

    Posted: 22 Dec 2019 08:32 PM PST

    TL;DR

    Fragments are great. But how you would solve following case: FirstFragment makes some network request. After some action, it is replaced to SecondFragment. Question: How to display FirstFragment again, not loosing its state and not making that network request again?

    Full

    I want to avoid using Activities, because they are slow and inconvenient some times. But Fragments are difficult to maintain. It is easy to show some fragment, but it is pretty hard for me, for instance, handling a back button press. Suppose, I want to go from FirstFragment to SecondFragment. Here is how I do it (pseudo code):

    activity?.supportFragmentManager.beginTransaction().replace(R.id.fragmentView, SecondFragment(), "second-tag") .addToBackStack(null).commit()

    Note that FirstFragment also displayed like above and added to the backstack.

    I use replace function, because add method would overlap fragments. It seems like replace removes fragment and adds it. Suppose, we want to go back to FirstFragment again from SecondFragment. To achieve this, I used popBackStack method of the FragmentManager. It just removes last fragment added to the backstack and displays previous one. But, the magic is here. Fragment's view is recreated again. It means its full lifecycle is made again. It means my network request is made again. Ok, we used addToBackStack and it means that fragment's instance can be reused again. It means, all of its variables still exists. Ok, I understand that Android decided to remove the view, because it was dismissed before, but it gave me my data again. But, the problem appears here. My network request is made again, which is the thing I want to avoid. It is called in onActivityCreated. Of course, I can make some ViewModel and observe LiveData inside it and it returns me my previous data not making a network request, cause it existed before. But, what about my RecyclerViewAdapter or ViewPagerAdapter? When I get back my data, my adapters are installed, which means they completely ruins previous state. Of course, I can create some flags and check it somehow, but it is really inconvenient. Of course, I can use show/hide methods, which acts like .visibility = View.GONE and seems completely nonsense, because it is not efficient for memory. Maybe I don't know the solution. Maybe Android engineers decided to create it like this. Please, help.

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

    Issue on Android Studio: no auto-suggestions for resources on a specific project

    Posted: 23 Dec 2019 07:46 AM PST

    Issue on Android Studio: no auto-suggestions for resources on a specific project

    Not sure why, but today after working on various branches of a large app, I tried to auto-complete something that's of R class of Android (for example R.drawable or R.string or R.id) , and it just doesn't offer me anything, as if nothing exists. If I enter it manually it works fine.

    https://preview.redd.it/2ndqsp1yle641.png?width=185&format=png&auto=webp&s=15e615c3af2f7a0342bc6da5d1ad0dac51fed743

    Weird thing is that it doesn't occur for R.color resource:

    https://preview.redd.it/fdyyx1d0me641.png?width=198&format=png&auto=webp&s=a6b4f46fa318be51f47a7109758c099779967dde

    It happens only for resources, not for functions. And it happens only on this project.

    I tried the various build functions in the "Build" menu (make project, rebuild, clean project, ...) and I tried to invalidate the cache and restart the IDE, and I tried to manually delete all "build" folders of the project and even restart the PC.

    Searching the Internet, I saw that some said to disable power mode of the IDE, but it's already off. I tried to enable and disable it, and still it didn't help.

    Why does it occur?

    How can I fix it without ruining various settings of the IDE and the project?

    EDIT: reported here, as I think it's a bug due to the very specific weird behavior:

    https://youtrack.jetbrains.com/issue/IDEA-229731

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

    MVP and calling a method in an activity from a viewholder in a recyclerview in a fragment in that activity.

    Posted: 23 Dec 2019 06:28 AM PST

    I have an activity which holds a fragment. This fragment has a recycler view, and the recycler view has items I want to be able to edit by opening a dialogue (or if you have any suggestions, I'm all for it). This viewholder has a button (though I might change it to clicking the viewholder instead, but that's irrelevant).

    Now, when I press the edit button for that viewholder I want to tell the activity to open the edit dialogue and send it the item.

    How do I call the method in the activity from that viewholder?

    How do I send it the item without breaking the MVP pattern?

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

    Is it recommended to publish newer version of my app to Beta before the previous version gets approved or should I wait for current pending publication to complete first?

    Posted: 23 Dec 2019 07:59 AM PST

    Will the latter publications after the initial one become faster to get approved? Is one way recommend than another?

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

    Why is my install count not updating on Google Play?

    Posted: 23 Dec 2019 07:42 AM PST

    My Google Play developer console has said that my app reached 5k new users acquired like a week ago. 5.07k rn. However, the Play Store is still showing 1,000+ installs instead of 5,000+. Does anyone know why it's not updating?

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

    Very limited Supported Devices on PlayConsole after App is published

    Posted: 23 Dec 2019 06:53 AM PST

    Its been a very fun adventure with Flutter (its what Ive used in making this app) so far and my app just got published in PlayStore but I have 2 problems

    1. Its not visible on most devices
    2. The supported devices is VERY FEW (25 only)

    NOTE: My app is in Alpha Release

    How do I increase the supported versions of Androids? Like from Jellybean to latest?

    You can check the images here if it helps:

    PlayConsole supported: https://imgur.com/a/SXwyBuv

    Apk that Ive uploaded to PlayConsole: https://imgur.com/a/pfGuMGL

    My code for app-level build.gradle is below:

    android { compileSdkVersion 28 sourceSets { main.java.srcDirs += 'src/main/kotlin' } lintOptions { disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.hivemanila.syncshop_webview" minSdkVersion 16 targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" multiDexEnabled true } signingConfigs { release { keyAlias keystoreProperties['keyAlias'] keyPassword keystoreProperties['keyPassword'] storeFile file(keystoreProperties['storeFile']) storePassword keystoreProperties['storePassword'] } } buildTypes { release { signingConfig signingConfigs.release minifyEnabled true useProguard true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } flutter { source '../..' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' } 

    My AndroidManifest.xml is code here

    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hivemanila.syncshop_webview"> <uses-permission android:name="android.permission.INTERNET"/> <application android:name="io.flutter.app.FlutterApplication" android:usesCleartextTraffic="true" android:label="SyncShop" android:icon="@mipmap/ic_launcher"> <activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> <meta-data android:name="io.flutter.app.android.SplashScreenUntilFirstFrame" android:value="true" /> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application> </manifest> 
    submitted by /u/cosmoph
    [link] [comments]

    Banner at bottom of screen and Gesture Navigation?

    Posted: 23 Dec 2019 06:15 AM PST

    Since our AdMob account has been disabled for invalid activity 30 days ago, we are looking into every possible option that could cause Invalid Activity(if there was any). Upon our inspection in our code and placements, we realized had banners placed at bottom(like most apps), and this made us wonder if, because of new gesture navigation, somehow users clicked accidentally?

    Does someone know how to test this? We looked at emulators in Android Studio, non of them had gesture navigation. And at the moment all of our devices are at Android 9 and non of them have Gesture Navigation.

    Did something change with gesture navigation and banner placement? What do you think of this? Is Gesture navigation and banner placed at bottom of screen recipe for invalid activity/accidental clicks

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

    Stuck at Using Volley-timeout-error

    Posted: 23 Dec 2019 05:50 AM PST

    I am developing the app to fetch data from the the localhost i wrote an api to do so and tested it on postman it is working fine .I am using xampp and my sql.

    when i am using in app it is showing "com.android.volley.TimeoutError".

    code:

    public class MainActivity extends FragmentActivity implements OnMapReadyCallback {

    private GoogleMap mMap;
    private Double lat,lng;
    private RequestQueue mRequestQueue;
    private StringRequest mStringRequest;
    private String s_url="http://192.168.x.x/<flodername>(i have my folder name here)/Retrive.php";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
    .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
    }

    u/Override
    public void onMapReady(final GoogleMap googleMap) {
    Log.e("started","started");
    mMap = googleMap;
    final Handler handler = new Handler();
    final int delay = 5 *1000;
    newLocation();
    handler.postDelayed(new Runnable() {
    u/Override
    public void run() {
    Log.e("Call","call");
    googleMap.clear();
    newLocation();
    handler.postDelayed(this,delay);
    }
    },delay);
    }

    public void newLocation()
    {
    mRequestQueue = Volley.newRequestQueue(this);
    mStringRequest = new StringRequest(Request.Method.POST, s_url, new Response.Listener<String>() {
    u/Override
    public void onResponse(String response) {
    Log.e("response","Response");
    try {
    JSONObject jsonObject = new JSONObject(response);
    lat = Double.valueOf(jsonObject.getString("latitude"));
    lng = Double.valueOf(jsonObject.getString("longitude"));
    LatLng live = new LatLng(lat,lng);
    mMap.addMarker(new MarkerOptions().position(live).title("Your are here")
    .icon(bitmapDescriptorFromVector(getApplicationContext(),R.drawable.ic_directions_bus_black_24dp)));
    mMap.moveCamera(CameraUpdateFactory.newLatLng(live));
    }
    catch (JSONException e)
    {
    e.printStackTrace();
    }
    }
    }, new Response.ErrorListener() {
    u/Override
    public void onErrorResponse(VolleyError error) {

    Log.e("error","Error: "+error.toString());
    error.printStackTrace();
    }
    });
    mRequestQueue.add(mStringRequest);
    }

    private BitmapDescriptor bitmapDescriptorFromVector(Context context, int vectorResId){
    Drawable vectorDrawable = ContextCompat.getDrawable(context,vectorResId);
    vectorDrawable.setBounds(0,0,vectorDrawable.getIntrinsicWidth(),vectorDrawable.getIntrinsicHeight());
    Bitmap bitmap = Bitmap.createBitmap(vectorDrawable.getIntrinsicWidth(),vectorDrawable.getIntrinsicHeight(),Bitmap.Config.ARGB_8888);
    Canvas canvas = new Canvas(bitmap);
    vectorDrawable.draw(canvas);
    return BitmapDescriptorFactory.fromBitmap(bitmap);
    }
    }

    Can someone help me with this error?

    Thankyou!

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

    Fragments ❤ ViewPager2

    Posted: 23 Dec 2019 12:31 AM PST

    New to Android Development - Need help starting Project

    Posted: 23 Dec 2019 03:33 AM PST

    Hi all.

    Am new to Android development and have been using the obvious guides to get started and learn Android Studio etc. I have an app idea in mind that will be specifically for in-house within my workplace. I think it's a fairly simple idea and implementation and want to use it as a starting project whilst I learn Android development. I would like some ideas as to what I should be focusing on in terms of tutorials to help get it off the ground. The basic premise of the app is:

    • Image viewer with a set of locally stored images (about 12 or so images)
    • Swipe left and right through images (full screen)
    • A call out from the left hand side that shows all images as a list to pick which to view

    Where would be a good place to start to help get these things together? What specific tutorials should I look for to help implement each element needed? Have seen some posts that link to GitHub repos but I would prefer to learn each element myself.

    Any help is much appreciated.

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

    OnePlus 7T Pro udev rules (Ubuntu dev)

    Posted: 23 Dec 2019 02:48 AM PST

    Hi all, I am trying to get into app dev using Android Studio for Ubuntu. I am wanting to use my phone to debug the app, and have found that I need to create a udev rule for the phone. I was wondering if anyone else had already done this or could point me in the direction of how to find out! Thanks in advance.

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

    App sometimes freezes running in the background

    Posted: 23 Dec 2019 03:58 AM PST

    Hi. I wrote my first app, very basic, just counts down and when it gets to 0 it plays a sound and restarts the timer, running indefinitely. It works fine except sometimes I'll lock the screen, or it will run in the background and it will just freeze. If I press the back button or minimise and reopen it goes back to counting down as normal. I've turned off battery optimisation for the app. I'm testing on a Samsung galaxy s9+. Not to sure how to troubleshoot this, any help would be appreciated. Thanks.

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

    Installing the ADB and fastboot tools from the APT repository is not a new stable update. How can I installed a new one?

    Posted: 23 Dec 2019 12:08 AM PST

    Rotate Animation in android Studio Tutorial

    Posted: 23 Dec 2019 04:50 AM PST

    Do You Know How Android App Benefits Your Business to Grow Globally?

    Posted: 23 Dec 2019 05:07 AM PST

    Curse you android why must you hate me, let me love you

    Posted: 22 Dec 2019 11:19 PM PST

    I spent around 2 years self-educating in web development but couldn't land a junior role anywhere so I figured the market was saturated from boot camps and made the move to android development which I was highly interested in.

    I started with Udacity, felt like it was old, outdated, most materials were from 2015 & earlier so I started working with some udemy material (Tim Buchalka). I felt like I was following directions not really learning so I went back to Udacity. I wasn't able to go to college for the traditional CS degree so maybe this is why I'm just not grasping it. It's aggravating and recently considered taking the Google IT Support course on Coursera because it seems like everyone is getting some kind of work from home decent salary IT job.

    I'm sorry if you're still reading this I'm really just venting, software development is what I wanted to go to college for before my Dad said he wasn't going to risk his trailer on me and if I wanted to go to school I'd have to pay for it myself. Then when I started working he charged me $2000 a month in rent plus utilities.

    It feels like a bad dream where you're constantly running after your goal but it never gets any closer.

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

    The Changing Market for Food Delivery

    Posted: 23 Dec 2019 04:35 AM PST

    The Changing Market for Food Delivery

    In recent times, the food delivery industry is witnessing a rapid transition with the emergence of new trends and new business models, especially by the new business players in the industry. Let's have a look at the changing environment in the food business.

    https://preview.redd.it/tnoooa1ynd641.jpg?width=2210&format=pjpg&auto=webp&s=cfacbdbdbe67311c9d77301feadc270c9070c5c7

    Everyone is demanding their own slice of pie:

    Businesses that are not even directly linked to food businesses are getting into action to generate their share of the revenue from the growing food market. For example, fintech firms have managed to get their own piece of cake by integrating their payment gateways into the food delivery apps.

    Companies operating in the transportation industry are witnessing tremendous growth by leveraging the benefits of last-mile delivery of food orders. Thus, it has become necessary for businesses functioning directly in the food industry to keep themselves updated to retain their existing positions.

    Constant innovation is the key to succeed:

    Sticking to the conventional ways of the food business is never going to earn profits in the current business environment. So, it is a must for companies to keep moving forward with innovative business models.

    The recent trend is the launch of cloud kitchens. These are kitchens that have space to cook but do not have the facility to dine in, i.e., it is dedicated to serving online food orders and takeaways.

    Dive into the ever-growing food industry:

    If you are already operating in the food industry or looking for ways to jump into it, then you must take advantage of technology. Develop an app for your business and keep constantly updating to retain your state in the market. If you feel that developing an app from scratch is tricky, then do not worry. Several app development companies offer UberEats clone apps that can be personalized as per your needs. Customization of these apps assists you to launch the app in a jiffy, saving both time and resources. Then, what are you waiting for? Go, hit the market with your own food delivery app.

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

    ImageViews have an offset/displacement in the emulator, but are placed correctly in the editor

    Posted: 22 Dec 2019 01:08 PM PST

    Hello, I am making an app that includes a vertical barchart and thought of using two thin black boxes (ImageViews) for the Y and X axis. When I place them how I want in the Editor, they suddenly have an offset in the Emulator. (Y axis is too far down f.ex although I placed it correctly in the Editor). Every axis has the 4 constraints, so that cant be the problem. Also, some emulators have less of an offset than others (Pixel 3a XL is better than Pixel 2 f.ex). This makes me think of another problem; how does one make sure every ImageView is showed correctly by every screen size/resolution?

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

    No comments:

    Post a Comment