Apollo-Android experience / rant / question

Developing Android Apps - Thu, 01/17/2019 - 11:32

Is anyone here using apollo-andorid in a real-world project? I tried (and failed) to use it in an existing project recently, and I wanted to share my experience. Imagine the following example app:

You have a list of TODOs on the server and a GraphQL query to fetch them all. There are mutations to favorite/unfavorite a list of selected TODOs. There is a mutation to remove selected TODOs. Pretty trivial stuff, right?. This is not exactly the kind of data I used it with, but it showcases all of my issues.

I wanted to have the following features:

  • manual pull-to-refresh support (refetch all TODOs from server)
  • manual cache invalidation when some other action is performed elsewhere in the app (so it would refetch everything the next time the fragment is visited)
  • avoid refetch of all TODOs after the favorite/unfavorite mutations (the mutation returns changed data already, and Apollo can just write those into the cache)
  • show loading indicator when data is being fetched from network
  • the rest of the application already uses RxJava2, so naturally I wanted to use apollo-rx2-support as well

And I just wasn't able to do it.

I created a watcher from the "all TODOs" query and observed that in the fragment - seems obvious - I'm not going to manually call query every time I think something has changed (e.g. after a mutation) - that's what the watchers are there for, right?

I tried using watcher.refetch() as the pull-to-refresh action, but that only refetched the data from cache, as it had the CACHE_FIRST fetcher set. If I used the NETWORK_FIRST or NETWORK_ONLY fetchers, this caused the full query to be fetched from the server every time anything changed, e.g even after a favorite/unfavorite mutation completed.

With CACHE_FIRST on the watcher, I was also completely unable to implement deleting of the TODOs - the mutation completed and deleted them on the server, but I wasn't able to show this change on the client. Trying to remove them via apolloStore().remove() did nothing, even though I'm pretty sure I used the correct cache keys (simple __typename + id combo, configured with apollo client), and had refetchQueries manually set on the mutation.

I wonder if anyone else here has a similar experience, or if you just have very different requirements (i.e. you don't need the features mentioned above). Am I missing something here, or is apollo-android just not very flexible? It seems super easy to use if you adapt your app exactly to its capabilities, but as soon as you need anything outside of those, I just can't figure it out.

I'm currently considering just using something like retrofit-graphql, or even writing a custom lightweight code generation gradle plugin, and doing all the caching manually.

submitted by /u/DoListening
[link] [comments]
Categories: Android, Linux

Anyone here using Avocarrot/Glispa as an ad network?

Developing Android Apps - Thu, 01/17/2019 - 11:21

I'm curious whether you've gotten paid (November, December), they've missed two payments for me and another developer I'm in contact with. I have had some small amount of communication from them but only after several weeks of waiting for a reply and I still haven't been given a good reason. Last reply I was told it might be weeks before they can resolve the issue.

Something else that is really bothering me is that now they have merged with Mobfox and I happened to be in conversations with Mobfox about using them as an ad network when they announced they merged. Because of this I told Mobfox I can't use them. Mobfox then offered to pay the Avocarrot/Glispa debt in small amounts as I earn money with Mobfox. That seems really odd, right?

Anyone else having this issue?

submitted by /u/instantbitsapps
[link] [comments]
Categories: Android, Linux

Methods accepting inline classes as parameters - why can't they be called from Java? I need that!!!

Developing Android Apps - Thu, 01/17/2019 - 10:48

Let's say I have:

inline class Email(value: String)


fun something(email: Email)

now if I want to call something() from Java I can't. Because any method that is accepting an inline class as a parameter is "mangled" (more about this here: As far as I understood mangling renames the method name to include a "-" that's an invalid character in Java, so the method is practically invisible from Java perspective. That's intentional probably because of strong type safety. But I really need to make the method callable from both Java and Kotlin. Do you know some workaround?

submitted by /u/BacillusBulgaricus
[link] [comments]
Categories: Android, Linux

Campaigners get go-ahead to challenge exemption UK gave itself over immigrants' data

The Register - Thu, 01/17/2019 - 10:40
Sueball lobbed at Brit government over Data Protection Act

The High Court has agreed to hear a campaign group's case against the UK's Data Protection Act, which they say leaves immigrants with fewer rights over their data.…

Linux Kernel 5.0* seems to be incompatible with my dual GTX 1080s

Linux - Thu, 01/17/2019 - 10:37

I can get 4.20 to work just fine with the 415.27 driver, but anything <= 5.0* seems to leave me with that dreaded UNCLAIMED display issue.

Im currently testing out which module is breaking the driver. I suspect its the one I really want -- PCI Peer2Peer support. I will update this as I narrow down the package(s) causing the issue.

And yes, I purge the nvidia driver before updating the kernel -- otherwise 4.20 doesn't work either.

submitted by /u/aaronely
[link] [comments]
Categories: Linux

Is there a tool out there for cycling through aliases that are in your .bashrc?

Linux - Thu, 01/17/2019 - 10:30

I am looking for a way to cycle through what aliases I have in my bashrc file within my terminal. Is there something like that available?

submitted by /u/thisadamis
[link] [comments]
Categories: Linux

What is the best way to learn SQLite?

Developing Android Apps - Thu, 01/17/2019 - 10:23

Hi guys, where did you learn SQLite? I need it only for the database structure of android app.

submitted by /u/Manfrop
[link] [comments]
Categories: Android, Linux

Kernel module log file

Linux - Thu, 01/17/2019 - 10:02

I've been trying to print log from a kernel module in Linux to a device file, but I found no example of anyone implementing it. Every example I found was of a user space program writing to a device file created inside a kernel module, and I'm searching for a way to print to a custom file (like how printk writes to ring buffer, and dmesg

reads it and writes to a device file). Got any ideas?

submitted by /u/nowtilous
[link] [comments]
Categories: Linux

Which IDE you used for Android development.

Developing Android Apps - Thu, 01/17/2019 - 09:54

Eclipse or Android Studio or something else.

Also which is best ?

Android Studio Vs Eclipse

submitted by /u/all_knowledge
[link] [comments]
Categories: Android, Linux

How to serve .sh files that remain executable after being downloaded?


I am serving installer files (.sh self-executable) and the permissions on my server are +x.

Whenever I download these files in my Firefox I find them without executable permissions in the ~/Downloads folder.

Now I thought this would be a browser thing (due to security reasons) but I've found that when I download e.g. installer files from GOG they end up in the same place and are marked as executable?

What do I have to take into consideration wrt my apache config to provide users with executable installers? To me it means a big difference usability-wise especially for non-experienced users.

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

I find Tasker tough to figure out, but, there are two things I think Tasker and some support could help me with....

Tasker: Total Automation for Android - Thu, 01/17/2019 - 09:44

I am looking to reset the google advertising ID on a regular basis (daily), and only have apps that use location have access to location services when in use.

Thanks in advance for any help that might be provided. I have an s9+ on pie.

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

I'm looking for a program to control USB inputs

Linux - Thu, 01/17/2019 - 09:37

I'm looking for some kind of program or command line utility to do one or more of the following:

  1. Enable/disable USB ports at will
  2. Sandbox the USB ports so that a drive can be opened without giving it access to the machine's files.
  3. Monitor the upload/download speed when moving files to the USB. I know this is already a thing baked into most distros, I'm really only interested in this as a feature for a program that also does 1 and/or 2.

Does such a program exist, and is it even possible? I am fully aware of the safety protocols regarding USBs. I'm not interested in opening strange USBs found on the ground, and my laptop is not in an environment where I'm at an increased risk of being hacked. I have full drive encryption already and I follow common sense security measures. This is really just another tool I'd like to have available. If such a program does not exist but is possible, I may look into creating it myself (no promises).

submitted by /u/utan
[link] [comments]
Categories: Linux

Slack to fend off the collaboration competition with... a new logo

The Register - Thu, 01/17/2019 - 09:36
Hipsters choke on pumpkin spice latte as the beloved original is tipped into a dumpster

Hipster laptop lids are in for a scraping as messaging-for-millennials platform, Slack, has taken a beating with the rebranding stick.…