Questions tagged [android-guava]

Android-guava is a project to bring the best parts of guava to Android. The Optional class should make the process of handling errors in loaders or AsyncTasks that make http requests a little better. By requiring a check for an empty state, indicating an error occurred, your code will be less buggy and easier to follow.

About

Android-guava is a project to bring the best parts of guava to Android. The Optional class should make the process of handling errors in loaders or AsyncTasks that make http requests a little better. By requiring a check for an empty state, indicating an error occurred, your code will be less buggy and easier to follow.

License

Apache License Version 2

Links

Github

34 questions
1
vote
1 answer

Build conflict in Firebase ver 11.0.0 and guava (Duplicate zip entry [classes.jar:com/google/common/base/FinalizableReference.class])

I have upgraded my project to latest version of Google Play Services, including Firebase (version 11.0.0) and I am not able to build the project anymore due to conflict between Guava's and Firebase's version of the class…
Roman
  • 13
  • 3
1
vote
1 answer

No SortedMultiMap in Guava?

I am trying to find a way to get a sorted multimap. I checked Guava which offers two separate collection data structures that combined could answer my problem. What's striking is that SortedSetMultimap can not contain identical keys because it's a…
John Difool
  • 5,572
  • 5
  • 45
  • 80
1
vote
1 answer

How to include the guava libraries to my output jar?

I have the following dependencies in my build.gradle: dependencies { compile 'com.google.guava:guava:18.0' } It works during compile time and the output jar is generated for my source code (which uses classes like com.google.common.collect.Maps…
April C.
  • 21
  • 1
1
vote
0 answers

Best way to filter List every 'x' items

I have a listView and I'm trying to display every 10 seconds like a new 'page' of data in this listview. To do that, I use a kind of filter on my list of data every 5 items: List> pages = new ArrayList>(); for…
Alex DG
  • 1,859
  • 2
  • 22
  • 34
1
vote
2 answers

Android 2.2 : java.lang.NoClassDefFoundError for Guava classes

I'm getting java.lang.NoClassDefFoundError: com.google.common.collect.SortedMultisets$NavigableElementSet on Android 2.2 devices. I'm getting the same crash on Android 2.2 emulator I'm not getting that error on Android 4.x devices though. My…
0
votes
1 answer

Paging 3, Guava/LiveData: liveData onChanged gets called before data is fetched from server

I'm developing an android app for showing a list of products stored in a server. I'm using Paging 3 lib with Guava/LiveData. When debugging, i found that the method onChanged from LiveData is always called before the PagingSource fetch data from…
0
votes
0 answers

WorkManager: FutureCallback always returns success no matter what result

I am doing this: val fileUploadRequest = OneTimeWorkRequestBuilder().build() Futures.addCallback(workManager.enqueueUniqueWork(this::class.simpleName!!, ExistingWorkPolicy.KEEP, fileUploadRequest).result, object :…
JohnyTex
  • 3,323
  • 5
  • 29
  • 52
0
votes
3 answers

Problem in adding Room for data storage in android using java

I was trying to implement Room for persistent data storage in java. But I ran into problems with it. In first try: MyDao.java @Dao public interface MyDao { @Insert(onConflict = OnConflictStrategy.REPLACE) void addUser(UserDetails…
0
votes
1 answer

Android Room Unsure what to do with methods return type

I'm following Android Developers documentation and from this I have the following in my DAO: @Insert(onConflictStrategy = OnConflictStrategy.REPLACE) ListenableFuture insertProjects(Project... projects); When I was using type void I'm able…
JamieRhys
  • 206
  • 6
  • 24
0
votes
1 answer

Preconditions checknotnull annotations produce null warnings

The following line final ProgramObject data = Preconditions.checkNotNull(datas.get(name), TEMPLATE, name); gives a warning in android studio Warning:(291, 44) Argument 'data.get(name)' might be null When looking at the source code of…
David Michael Gang
  • 7,107
  • 8
  • 53
  • 98
0
votes
1 answer

java.lang.NoSuchMethodError: com.google.common.base.CharMatcher.whitespace()

I'm writing android unit tests with Robolectric. When I run my tests currently, I keep getting the above error. I have looked at and tried tons of suggested solutions from here, but none of them have resolved this error. So far I have looked at the…
naffie
  • 679
  • 1
  • 12
  • 29
0
votes
1 answer

How does Guava com.google.common.net.InetAddresses get hostname without reversing DNS?

I do not understand how does it work. Can anyone explain me that from jni level? Does it call getnameinfo? https://github.com/google/guava/blob/master/guava/src/com/google/common/net/InetAddresses.java ok. How can i get name from an udp…
cqwrteur
  • 89
  • 8
0
votes
1 answer

How to find the index of an arraylist item, using a property in a list item?

//what is the best way to find out the index of a particular event using the Offer Id? using core java or using a third-party library like (Guava/Commons Collection)? public class Event{ private String title; //other…
Sam
  • 6,215
  • 9
  • 71
  • 90
0
votes
2 answers

Java | Get column keys from a row key

I have Table like Table distributions = HashBasedTable.create(); |----------------------------------------------| | Row | Column | Value | |----------------------------------------------| | aaa …
Sapnesh Naik
  • 11,011
  • 7
  • 63
  • 98
0
votes
1 answer

Error:Conflict with dependency 'com.google.guava:guava' in project ':app'. Resolved versions for app (18.0) and test app (16.0.1) differ

I am getting below error, Error:Conflict with dependency 'com.google.guava:guava' in project ':app'. Resolved versions for app (18.0) and test app (16.0.1) differ after adding the below line.. compile…
kumar
  • 708
  • 4
  • 15
  • 39