# Native Android App calling The Internet Computer

**URL:** <https://forum.dfinity.org/t/native-android-app-calling-the-internet-computer/8368>\
**Category:** Language Support\
**Created:** [November 5, 2021, 4:05am UTC](https://forum.dfinity.org/t/native-android-app-calling-the-internet-computer/8368 "2021-11-05T04:05:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdobrik](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/rdobrik/32/3848_2.png) [@rdobrik](https://forum.dfinity.org/u/rdobrik)\
**Post date:** [November 5, 2021, 4:05am UTC](https://forum.dfinity.org/t/native-android-app-calling-the-internet-computer/8368/1 "2021-11-05T04:05:10Z")

</div>

**Android Native App connecting to the Internet Computer**

> **[GitHub - rdobrik/DfinityAndroidSample: Native Android Application calling the IC](https://github.com/rdobrik/DfinityAndroidSample)**
>
> Native Android Application calling the IC . Contribute to rdobrik/DfinityAndroidSample development by creating an account on GitHub.

Nothing fancy, just HelloWorld native Android (Kotlin) application calling query and update on the Internet Computer. This application is using The Internet Computer Java Agent open source package

> **[GitHub - rdobrik/dfinity-agent: Dfinity Agent Project](https://github.com/rdobrik/dfinity-agent)**
>
> Dfinity Agent Project. Contribute to rdobrik/dfinity-agent development by creating an account on GitHub.

(more in this discussion thread [Open source Beta version of Java Dfinity Agent](https://forum.dfinity.org/t/open-source-beta-version-of-java-dfinity-agent/6565))

The code is in MainActivity.kt file, demonstrates how to create HTTP Transport, set arguments, call both query and update operations. Canister Motoko code is in main.mo file, to test it just copy and paste to Motoko Playground and deploy it. Then use canister id and url in strings.xml, modify canister and values. I tested this app on Android 8.1, so it should be compatible with any newer versions, probably older as well. This app is using OkHttp client in ReplicaTransport, so we can exclude Apache 5 HTTP client. (Apache client transport version should work too, but it requires some additional modifications in the gradle build file)

This is how you add Java Agent modules to your Gradle build (from Maven Central)

```auto
    implementation 'commons-codec:commons-codec:1.15'
    implementation('com.scaleton.dfinity:dfinity-agent:0.5.5') {
        exclude group: 'org.apache.httpcomponents.client5', module: 'httpclient5'
    }

```
