An Easy Android App GET and POST Content From URL Example

December 18, 2016

** This post is a work in progress ** 


It took me a while (much longer than it should have) to be able to start playing around with getting and posting data to a url. I think part of the problem was that many of the tutorials out there try to add unecessary complication -- they'll add an interface where a user has to put in data, etc... and I'm just purely interested in the specific and lone action, without the extra fluff. 


So here is my little tutorial on this. For reference, my project is named: 'com.ctitch.birch'. Where relevant in the code below, you'll need to replace that.


1. Create a new project in android studio
2. Add "<uses-permission android:name="android.permission.INTERNET"/>" to your AndroidManifext.xml file.  That code should look like:






3. Add "compile ''" to the dependencies section of your build.gradle (Module:app) file.  It should look like:

build.gradle (Module:app):

apply plugin: ''

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "com.androidtest.cedar"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner ""
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), ''

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('', {
        exclude group: '', module: 'support-annotations'
    compile ''
    testCompile 'junit:junit:4.12'
    compile ''


More coming....