square

Android-Studio-1.2.RC Proguard warnings on Square's Okio library reference

放肆的年华 提交于 2019-12-06 22:40:13
问题 WIth Android Studio: 1.2.RC I enabled proguard in .gradle: ``` minifyEnabled=true and added these rules to my proguard-rules.pro: -dontwarn com.squareup.** -dontwarn okio.** and added these lint rules to my .gradle file: warningsAsErrors false abortOnError false disable 'InvalidPackage' ``` But I still get these warning when I try to run the app in debug mode: ``` Warning: okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement Warning: okio.Okio:

Android-Studio-1.2.RC Proguard warnings on Square's Okio library reference

試著忘記壹切 提交于 2019-12-05 03:31:59
WIth Android Studio: 1.2.RC I enabled proguard in .gradle: ``` minifyEnabled=true and added these rules to my proguard-rules.pro: -dontwarn com.squareup.** -dontwarn okio.** and added these lint rules to my .gradle file: warningsAsErrors false abortOnError false disable 'InvalidPackage' ``` But I still get these warning when I try to run the app in debug mode: ``` Warning: okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement Warning: okio.Okio: can't find referenced class java.nio.file.Files Warning: okio.Okio: can't find referenced class java

How to specify a default user agent for okhttp 2.x requests

时光怂恿深爱的人放手 提交于 2019-12-03 03:01:02
问题 I am using okhttp 2.0 in my Android app and didn't find a way to set some common User Agent for all outgoing requests. I thought I could do something like OkHttpClient client = new OkHttpClient(); client.setDefaultUserAgent(...) ...but there's no such method or similar. Of course I could provide some extension utility method which would wrap a RequestBuilder to attach .header("UserAgent") and then I would use it for building all my requests, but I thought maybe I missed some existing and

How to specify a default user agent for okhttp 2.x requests

喜你入骨 提交于 2019-12-02 17:02:12
I am using okhttp 2.0 in my Android app and didn't find a way to set some common User Agent for all outgoing requests. I thought I could do something like OkHttpClient client = new OkHttpClient(); client.setDefaultUserAgent(...) ...but there's no such method or similar. Of course I could provide some extension utility method which would wrap a RequestBuilder to attach .header("UserAgent") and then I would use it for building all my requests, but I thought maybe I missed some existing and simpler way? You can use an interceptor to add the User-Agent header to all your requests. For more

Android Retrofit Base64 @Body

我怕爱的太早我们不能终老 提交于 2019-11-29 07:56:00
Hi all i have this code in android 4.3 and i am using retrofit just now but server thrown me an error message "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters." When i am using retrofit //Normal HttpClient //Base64 String photo = new String(b); // Creating HTTP client HttpClient httpClient = new DefaultHttpClient(); // Creating HTTP Post HttpPut httpPut = new HttpPut("http://beta2.irealtor.api.iproperty.com.my.ipga.local/PhotoService/" + mPropertyId + "/testWatermark" );

Android Retrofit Base64 @Body

£可爱£侵袭症+ 提交于 2019-11-28 01:36:27
问题 Hi all i have this code in android 4.3 and i am using retrofit just now but server thrown me an error message "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters." When i am using retrofit //Normal HttpClient //Base64 String photo = new String(b); // Creating HTTP client HttpClient httpClient = new DefaultHttpClient(); // Creating HTTP Post HttpPut httpPut = new HttpPut("http:/

How can I handle empty response body with Retrofit 2?

浪子不回头ぞ 提交于 2019-11-27 17:33:37
Recently I started using Retrofit 2 and I faced an issue with parsing empty response body. I have a server which responds only with http code without any content inside the response body. How can I handle only meta information about server response (headers, status code etc)? Thanks in advance! Edit: As Jake Wharton points out, @GET("/path/to/get") Call<Void> getMyData(/* your args here */); is the best way to go versus my original response -- You can just return a ResponseBody , which will bypass parsing the response. @GET("/path/to/get") Call<ResponseBody> getMyData(/* your args here */);

How does Square's CardCase app automatically populate the user's details from the address book?

て烟熏妆下的殇ゞ 提交于 2019-11-27 02:56:21
Square's new card case iOS app has a "Create Account" feature. Tap it and it shows a form PREPOPULATED with the user's entry from the Address book. How is this possible? Anyone know? I thought this was unpossible, to get the user's info this way. It's not an iOS 5.0 thing, afaict. the only solution I could come up with was using the device name and then searching the addressbook for a match. this assumes someone would use a particular naming convention. I for example use 'Nik's iPhone' as my device name. I am also the only Nik in my addressbook, so for my scenario is works well to use the text

How does Square&#39;s CardCase app automatically populate the user&#39;s details from the address book?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 12:37:08
问题 Square\'s new card case iOS app has a \"Create Account\" feature. Tap it and it shows a form PREPOPULATED with the user\'s entry from the Address book. How is this possible? Anyone know? I thought this was unpossible, to get the user\'s info this way. It\'s not an iOS 5.0 thing, afaict. 回答1: the only solution I could come up with was using the device name and then searching the addressbook for a match. this assumes someone would use a particular naming convention. I for example use 'Nik's