Skip to main content

Posts

Showing posts from May, 2014

Groovy Grails POST/GET Requests

Just a snippet of how to do GET/POST request in Groovy Grails. try{       HttpBuilder http = new HTTPBuilder('your URL here')       def postBody = [name: 'bob', title: 'construction worker']       http.post(body: postBody,                         requestContentType: ContentType.JSON) { resp, json ->                     //This is to assume everything is successful within this                         //closure                     println "response status " + resp.statusLine                     println "json response " + json                                      } }catch(HttpResponseException ex){         //handle your errors here }

How To Generate Signed APK using Gradle in Android Studio

So Android Studio doesn't encourage you to sign your APK the UI way using Android Studio, instead they're directing you to use Gradle to generate it (or in complex cases, there'll be a lot of APKs generated according to different build types and flavors) 1. Declare these inside the android bracket within the gradle file within your main Android project as shown below (while putting your keystore files in your project root directory): signingConfigs{         debug {             storeFile file("example.keystore")             storePassword "example"             keyAlias "example"             keyPassword "example"         }         release {             storeFile file("example-release.keystore")             storePassword "example"             keyAlias "example"             keyPassword "example"         } } buildTypes {         debug {            signingCo