• Breaking News

    [Android][timeline][#f39c12]

    Tuesday, August 13, 2019

    Android Studio 3.6 Canary 6 available Android Dev

    Android Studio 3.6 Canary 6 available Android Dev


    Android Studio 3.6 Canary 6 available

    Posted: 13 Aug 2019 10:53 AM PDT

    Packing the Room: Pre-populate your database with this one method

    Posted: 13 Aug 2019 09:16 AM PDT

    Animating a strike through with AnimatedVectorDrawable and AnimatedStateListDrawable

    Posted: 13 Aug 2019 08:09 AM PDT

    10 Tips for Android Library Developers

    Posted: 13 Aug 2019 11:52 AM PDT

    Can't check warnings in the Google Play dev console

    Posted: 13 Aug 2019 11:18 AM PDT

    Looking to put out my first ever rollout, and the review page is giving me a warning.

    Clicking to view this warning results in an error message at the top of the screen that reads:

    An unexpected error occurred. Please try again later. [988878155]

    The error code at the end of that message changes every time I attempt to view this warning, and the rollout button is still grey-ed out. Looks like I can't do anything else until I resolve whatever that issue is, but I have no idea what needs fixing.

    Has anyone else ever encountered this before, and is there anything I can do to fix this?

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

    You can now add tags on store listing on google play console.

    Posted: 12 Aug 2019 08:25 PM PDT

    Facebook Audience Network Quality check failing. What means "High impact" and "Low impact"? I mean, the high impact placement has a positive impact ? What would you do to improve quality ?

    Posted: 13 Aug 2019 03:43 PM PDT

    Library suggestions for flipping a card?

    Posted: 13 Aug 2019 03:35 PM PDT

    I've had a look at https://github.com/wajahatkarim3/EasyFlipView but the animations are all wonky on the multiple devices I've tested it on. Are there any alternatives? I just need a simple flip animation that reveals a back view like a flashcard.

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

    Looking for advice with regards to smart home door bell project

    Posted: 13 Aug 2019 01:48 PM PDT

    I have set up a ESP8266 to activate my buildings door buzzer if it has received a token through WLAN < 2min prior to detecting a doorbell ring.

    I have a BLE beacon in my mailbox. When my phone comes into range and connects to my WLAN it checks whether the BLE beacon is nearby and sends a token to my ESP8266 if the BLE beacon is in range. I'm using the deprecated method of having a broadcast receiver trigger my app to perform its BLE scan when I walk into range of my home WLAN.

    The catch is that I'm trying to make this work with the phone locked, screen off and in my pocket. While my current setup functions to some extent.. it's not very reliable. Among other things I'm not sure how often my mobile phone polls for WLANetworks while in standby.

    Since my WLAN connection down by my mailbox isn't stellar either, I am looking for an approach that might do away with WLAN entirely (e.g. sending the token through the internet). However as of right now I am not sure how to implement the behaviour I am looking for because I have no clue how android manages the different sensors while in standby.

    I want to avoid BLE scanning continuously at all costs. I'm therefore looking for a reliable way to trigger the BLE scan when I'm near my mailbox with my phone in standby. Can anyone shed some light on Android's standby behaviour and maybe suggest an alternate way of getting things to work?

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

    Can you use a specific branch of a library without waiting for a version release in Studio/Gradle?

    Posted: 13 Aug 2019 09:58 AM PDT

    I encounter a similar situation a lot.

    Library is a version 1.5.0

    The maintainer updates master with new code that I need

    But the maintainer doesn't make a release

    Is there anyway to specify that you want to just use what's the latest master as a dependency?

    Some ways around this I suppose:

    1. Download the repo and put it into your app
    2. Create some kind of middle layer that takes master on your behalf and publishes the artifact

    I've heard of "SNAPSHOT", but admittedly never learned what it meant or how to use it. Has anyone else encountered this problem and found a solution they like?

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

    Tips to get organic traffic?

    Posted: 13 Aug 2019 11:05 AM PDT

    Please give me some tips on how can I get organic traffic. I was constantly getting 100-150 downloads a day for around 2 months. Then the number suddenly increased to 300 then to 900 then again back to 500 then back to 200 per day. All this happened in about a week and now I'm getting only 30-40 installs a day. What can be the reason for this sudden rise and fall?

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

    Which library should i use to load remote svg files on my app?

    Posted: 13 Aug 2019 06:52 AM PDT

    Picasso was fine but it doesn't seem to work with svg format. What should i use instead of it?

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

    Overriding back button in fragments?

    Posted: 13 Aug 2019 05:01 AM PDT

    I'm using Navigation components to navigate between fragments. But I'm running into the issue of the back button takes the user back to fragments in the stack that I don't want them to be able to access.

    For instance in a fragment that's meant to create a new object of something. When a user presses the "save/create" button inside this fragment they get sent to a list view of these objects. However, when they press the back button they are redirected back to the create page. This is not the behavior I would like to have.

    What is the best way to override/force the back button behavior to not navigate back to certain fragments?

    EDIT:

    I got it working good enough by, first of all, instead of calling findNavController().navigate(R.id.fragment, bundle) I set up the actions from the nav_graph interface. Then I set it to popUpToInclusive = true. By doing this the back button has the desired behavior that I want! :)

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

    If I add an initial disclaimer, can I be in legal trouble if my databases are leaked?

    Posted: 13 Aug 2019 02:42 PM PDT

    In an app that allows for image sharing, if the app is created by a single person and that person adds a disclaimer at the app boot up, saying something like "Please do not submit anything you would not post publicly on social media", could that person be in legal trouble if the database was hacked or something?

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

    Tips to learn android dev faster?

    Posted: 13 Aug 2019 01:45 PM PDT

    Hello community, I'm quame. I recently begun my journey into the android development, world with some online tutorials and books as a guide. Everything seems so different from web development, and I often get confused with how to use the concepts from time to time. What tips, tricks and online resources, can you recommend to help me become a better android developer?

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

    Anyway to send a preloaded message via whatsapp, messenger, etc. to a set of selected contexts from another app?

    Posted: 13 Aug 2019 01:10 PM PDT

    Say my app has a button and a preloaded message. I want to be able to push that button and a message will be sent a set of contacts within another app (whatsapp, messenger, etc.) .

    Any way to do this? It seems like companies would block this sort of behavior in fear of spam but I am not sure.

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

    CameraX Image Analyzer Frame Rate - Can it go higher than 16fps?

    Posted: 13 Aug 2019 12:24 PM PDT

    Hi

    This is more just a broad question for anyone else out there who's experimented with the new CameraX API, specifically the ImageAnalysis stuff ( https://developer.android.com/training/camerax/analyze )

    I've spun it up to test, and I'm seeing it return around 15/16fps (60ms per frame) regardless of resolution size. If I set the preview to 320x240 or 1920x960, they both come out at 16fps.

    Has anyone else managed to get higher FPS from this new API? I'm asking as i'm looking at its potential to replace a custom Camera2 project/component that I've been working on that scrapes + analyses frames from the Camera2 preview that hits 30fps fine, and 60fps in certain auto-exposure setups.

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

    What android libraries you can't live without?

    Posted: 13 Aug 2019 09:46 AM PDT

    I have done android development 3 years ago for 3 years. Now I am doing web frontend development.

    I want to get back in creating android applications and wanted to check the landscape. As someone who has used react, what is the closest way I could replicate that experience in native android?

    What libraries do you use frequently when building android applications?

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

    ViewModel, multiple 'commands', single livedata observer and error handling

    Posted: 13 Aug 2019 02:44 AM PDT

    I'm new to Android ViewModel, I've read many posts and the official documentation but I really don't understand which is the best practice to use a single livedata that can post exception for distinct commands, well an example can clarify what I mean

    Suppose a Fragment observes the view model for different network commands (eg Command1 and Command2) using the same live data, as shown below

    class MyDialogFragment : DialogFragment() { override fun onActivityCreated(savedInstanceState: Bundle?) { super.onActivityCreated(savedInstanceState) val viewModel = ViewModelProviders.of(this).get(MyViewModel::class.java) viewModel.commands.observe(this, Observer { command -> when (command) { is MyState.OnError -> { if (command.resultCode == RESULT_CODE_COMMAND1) { println("Error occured calling the command one") } else if (command.resultCode == RESULT_CODE_COMMAND2) { println("Error occured calling the command two") } } } }) viewModel.loadCommand1() } } 

    to distinguish which command failed I use a resultCode but this is really ugly, is there a better solution?

    The ViewModel code is shown below, every method is responsible to set the result code the runAction is an helper method to avoid wrapping viewModelScope/try ... catch in every command method

    Is this approach correct?

    const val RESULT_CODE_COMMAND1 = 1 const val RESULT_CODE_COMMAND2 = 2 sealed class MyState { data class OnCommand1(val number: Int) : MyState() data class OnCommand2(val text: String) : MyState() data class OnError(val resultCode: Int, val t: Throwable) : MyState() } class MyViewModel : ViewModel() { // for simplicity the Mutable data is exposed val commands = MutableLiveData<MyState>() fun loadCommand1() { runAction(RESULT_CODE_COMMAND1) { // api call to command 1 postState(MyState.OnCommand1(10)) } } fun loadCommand2() { runAction(RESULT_CODE_COMMAND2) { // api call to command 2 postState(MyState.OnCommand2("Hellow world")) } } private fun runAction(resultCode: Int, action: suspend () -> Unit) { viewModelScope.launch { try { action() } catch (t: Throwable) { postState(MyState.OnError(resultCode, t)) } } } private fun postState(state: MyState) = commands.postValue(state) } 
    submitted by /u/ternaryop
    [link] [comments]

    Help! I can't get these buttons to change to be borderless. Also I have my Alert dialog theme set in styles.Xml but nothing is changing.

    Posted: 13 Aug 2019 01:16 PM PDT

    How often Android app developers use Stripe or any other 3d party billing services?

    Posted: 13 Aug 2019 03:22 AM PDT

    I'm asking because I've heard that it may be against the Google Play rules and Google doesn't earn its commissions if Stripe or Braintree or PayPal used.

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

    UnsupportedOperationException: Alert dialogcrashing when positive button clicked

    Posted: 13 Aug 2019 06:18 AM PDT

    So i have this recycler view in which the last item is supposed to show a dialog on its click. the dialog is further comprising of 2 buttons, positive and negetive( the default ones).
    On the press of Positive button, the dialog is supposed to trigger a callback which will add a new entry in the recycler view. On the press of the negetive button, the dialog simply dismisses.

    Everything is working fine until when the user clicks positive button. the app crashes with the following log: ```

    2019-08-13 18:27:35.668 29482-29482/z.y.x E/AndroidRuntime: FATAL EXCEPTION: main Process: z.y.x, PID: 29482 java.lang.UnsupportedOperationException at java.util.AbstractList.add(AbstractList.java:148) at java.util.AbstractList.add(AbstractList.java:108) at z.y.x.dashboard_files.dashboard_fragment.QuantityButtonsAdapter.addItemInCentre(QuantityButtonsAdapter.java:85) at z.y.x.dashboard_files.dashboard_fragment.DashboardFragment$2$1.onPositiveButtonClick(DashboardFragment.java:144) at z.y.x.dashboard_files.dashboard_fragment.DashboardFragment$QuantityDialog$3.onClick(DashboardFragment.java:253) at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:172) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6692) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) ```
    Here is the custom dialog class:

    ```java

    public static class QuantityDialog { @Nullable private QuantityButtonModel currentData; private AlertDialog.Builder builder; public interface OnPositiveClickListener { void onPositiveButtonClick(QuantityButtonModel data); } public QuantityDialog(Context ctx) { currentData = QUANTITY_GLASS; View dialogView = createView(ctx); builder = new AlertDialog.Builder(ctx) .setView(dialogView) .setCancelable(false) .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { dialogInterface.dismiss(); } }); } 

    // public void show() { // show(null); // }

     @SuppressLint("InflateParams") private View createView(Context ctx) { View v = LayoutInflater.from(ctx) .inflate(R.layout.dialog_new_quantitiy_btn, null); //init ui SeekBar seekQty = v.findViewById(R.id.seekbar_qty); final TextView tvQty = v.findViewById(R.id.tv_qty_text_dialog); final ImageView ivQty = v.findViewById(R.id.iv_qty_icon_dialog); //init data and defaults if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { seekQty.setMin(0); } seekQty.setMax(QUANTITY_MAX); if (currentData != null) { seekQty.setProgress(currentData.getQty()); tvQty.setText(String.format(Locale.ROOT, "%d ml", currentData.getQty())); ivQty.setImageResource(currentData.getQtyImage()); } //init listener seekQty.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean b) { tvQty.setText(String.format(Locale.ROOT, "%d ml", progress)); int resID = getResForQty(progress); ivQty.setImageResource(resID); currentData = new QuantityButtonModel(resID, progress); } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onStopTrackingTouch(SeekBar seekBar) { } }); return v; } public void setOnPositiveClickListener(@Nullable final OnPositiveClickListener listener) { builder.setPositiveButton("Done", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { if (listener != null) { listener.onPositiveButtonClick(currentData); } dialogInterface.dismiss(); } }); } public void show() { builder.show(); } } 

    ```

    Here I am setting a listener to my recycler view's adapter. the listener is made in a way that if item is at any positon except last, it will show a toast, else it will show a dialog. The dialog is also not being reused(bad naming, i changed it later), but rather getting generated on every click and a click listener being attached at the same point, i.e on rv item's click. ```java adpButtons.setClickListener(new QuantityButtonClickListener() { @Override public void onItemClick(int qty) { Toast.makeText( fragView.getContext(), "add:" + qty + " to shared preferences", Toast.LENGTH_SHORT) .show(); }

     @Override public void onAddNewItemClick() { QuantityDialog reusableQuantityDialog; reusableQuantityDialog = new QuantityDialog(fragView.getContext()); reusableQuantityDialog.setOnPositiveClickListener( new OnPositiveClickListener() { @Override public void onPositiveButtonClick(QuantityButtonModel data) { adpButtons.addItemInCentre(data); } }); reusableQuantityDialog.show(); } }); 

    ``` I hope i tried to explain this clearly. I am guessing there is some kind of callback hell that is causing the problem? But i even tried reusing the dialogs which still caused the same error? Please help.

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

    Send data between 2 fragments in different activities

    Posted: 13 Aug 2019 06:04 AM PDT

    I am trying to send data from a fragment to another activity which contains fragments using intents, however when trying to receive the data of the intent in the fragment within the other activity I get a NullPointerException.

    I have looked online however have not been able to find a solution to it. Can anyone help me with this?

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

    No comments:

    Post a Comment

    Fashion

    Beauty

    Travel