gdogaru

1

votes
1

answer
260

views

Configure react native workers for circle CI

I am trying to run a react native android build on circle ci these are the react versions in package.json 'react': '^16.2.0', 'react-native': '0.50.0', I am setting these environment variables: _JAVA_OPTIONS: '-Xmx2000m' JVM_OPTS: '-Xmx2000m -XX:ParallelGCThreads=1 -XX:ConcGCThreads=1 -Djava.util.c...
gdogaru
1

votes
1

answer
1.5k

views

Android flash camera turns off just before taking the picture

I am trying to build a custom camera. I have a button that starts/stops the flash. I set it to flash mode TORCH when it is on. On some devices I was told that the flash stops just before the picture is taken. This happens on some android 2.3 devices. Did anyone else run into this problem? Any ideas...
gdogaru
1

votes
1

answer
374

views

Set custom invalidValue in Jersey ConstraintValidator error message

I have a Jersey Validator implemented like below, which I use on the request object. When I get the error response I get the whole object in the 'invalidValue' field. I want to be able to set the invalid value to a single field from MyRequest, not the whole object. This is because I want my validati...
gdogaru
1

votes
1

answer
1.2k

views

How to mock a java.util.Map in groovy using map coercion?

I am trying to mock Map using groovy map coercion. I have tried various variations of the code bellow but the result was always null. Map map = [get: {String k -> 'echo'}] as Map println map.get('a') If I use map = {'echo'} as Map it works. Any ideas on how to make the first version work? thanks
gdogaru
1

votes
1

answer
2k

views

Android Fragment support , java.lang.NoSuchMethodException: Fragment(Context,AttributeSet)

I try to use fragments with AndroidAnnotations and maven. It worked with Android 4.0+ , but then I tried to make it work with Android 2.3.3 and I had to use the support-v4 maven library: com.google.android support-v4 r7 My fragment is defined as: and My Activity extends FragmentActivity I get this...
gdogaru
1

votes
1

answer
62

views

Gradle use a class from sources as part of the package phase

I am using this with Android, but I think it can apply to any gradle project. I have some files I want packaged in the final archive. I want this files to be encrypted, and then the app will decrypt them when reading. What I use: gradle.projectsEvaluated { dexDebug.dependsOn(encryptFiles) } task enc...
gdogaru
1

votes
1

answer
1.5k

views

RxJava2 create Flowable from listener and remove listener at the end

My use case is related to using RxJava2 with Firebase Database. I have a DatabaseReference and I can register value listeners to it. I can transform it into a flowable like this: disposable = Flowable.create({ s -> dbRef.addValueEventListener(object : ValueEventListener { override fun onCancelled(p0...
gdogaru
2

votes
2

answer
718

views

Jackson: ignore the @JsonIgnoreProperties annotation

I have a class that I serialize and I use the @JsonIgnoreProperties at the class level to exclude some fields from it. Lately I have an use case where I need those fields serialized. Is there a way to make a writer/reader that ignores the annotation? I was looking into @JsonView but it seems @JsonI...
gdogaru
5

votes
3

answer
831

views

RxJava2 passing data through flatMap on a Single

In rxjava 1 there Observable had this flatmap method public final Observable flatMap(Func1 collectionSelector, Func2 resultSelector) That allowed you to pass/combine the initial result to the flatmap subscriber. How can I achieve the same result with RxJava2? I have a Single that emits A, I need t...
gdogaru
3

votes
2

answer
1.3k

views

How to manually set access tokens on OAuthRestTemplate, spring-security-oauth?

I am trying to call an api that uses Oauth 1a using OAuthRestTemplate from spring-security-oauth. I saw that most of the examples set the consumer key and secret and then let the library get the access tokens. I have the token and the token secret (which do not expire) and I want to set them on the...
gdogaru
1

votes
2

answer
67

views

Mobile app clones from same codebase

I have an android app that I want customized for different clients, usually changed colors. I could use flavors, but The problem is that every app should have 2 stages (so, 2 apps for every client), 1 for QA and 1 for Prod and they use different rest-api urls, custom for each client. What would be...
gdogaru