Shared info of IoT & Cloud, Banking, Angular Wicket, Spring Microservices, BigData, flutter, E-comm, Java Telecomm and More

Showing posts with label FE-Android Java. Show all posts
Showing posts with label FE-Android Java. Show all posts

Wednesday, February 22, 2017

Tuesday, February 21, 2017

Consuming a RESTful Web Service with Spring for Android

This Getting Started guide walks you through the process of building an application that uses Spring for Android's RestTemplate to consume a Spring MVC-based RESTful web service.

Compile và chạy ứng dụng rest server

You will build an Android client that consumes a Spring-based RESTful web service. Specifically, the client will consume the service created in Building a RESTful Web Servce.
Chạy spring boot rest: java -jar gs-rest-service-0.1.0.jar
The Android client will be accessed through an Android emulator, and will consume the service accepting requests at:
http://192.168.1.3:8080/greeting
The service will respond with a JSON representation of a greeting:
{"id":1,"content":"Hello, World!"}
The Android client will render the ID and content into a view.

Monday, February 20, 2017

Spring for Android Showcase

Introduction

This showcase includes an Android client and a Spring MVC server. Together these illustrate the interaction of the client and server when using Spring for Android. This Android project requires set up of the Android SDK. See the main README at the root of this repository for more information about configuring your environment.

Saturday, April 16, 2016

Install Android Studio & Java8

Install Java JDK 1.8

  • Download jdk-8uversion-linux-x64.tar.gz file from http://www.oracle.com/technetwork/java/javase/downloads/index.html
  • Unpack the tarball and install the JDK.
    % tar zxvf jdk-8uversion-linux-x64.tar.gz
  • Set up the JAVA_HOME and ANDROID_HOME
    For example, ANDROID_HOME=/home/demo/java/exo-dependencies/Android/AndroidStudio_Latest/SDK
    JAVA_HOME=/home/demo/java/jdk1.8.0_77
    PATH=/usr/local/bin:$PATH:$JAVA_HOME/bin:$M2_HOME/bin:$GRADLE_HOME/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools
Install Android Studio on Ubuntu
Setting up Android Studio takes just a few clicks.
While the Android Studio download completes, verify which version of the JDK you have: open a command line and type javac -version. If the JDK is not available or the version is lower than 1.8, download the Java SE Development Kit 8.
To install Android Studio on Linux, proceed as follows:
  1. Unpack the .zip file you downloaded to an appropriate location for your applications, such as within /usr/local/for your user profile, or /opt/ for shared users.
  2. To launch Android Studio, open a terminal, navigate to the android-studio/bin/ directory, and executestudio.sh.
    Tip: Add android-studio/bin/ to your PATH environment variable so you can start Android Studio from any directory.
  3. Select whether you want to import previous Android Studio settings or not, then click OK.
  4. The Android Studio Setup Wizard guides you though the rest of the setup, which includes downloading Android SDK components that are required for development.
Note: If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
If you are running 64-bit Fedora, the command is:
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
That's it! The following video shows each step of the recommended setup procedure.


Thursday, April 14, 2016

Selendroid's Architecture


Overview about the selendroid

Selendroid is based on the Android instrumentation framework, and therefore only testing one app is supported. Selendroid contains four major components:
  • Selendroid-Client - the java client library (based on the selenium java client).
  • Selendroid-Server - that is running beside your app on the Android device.
  • AndroidDriver-App - a built in Android driver webview app to test the mobile web.
  • Selendroid-Standalone - manages different Android devices by installing the selendroid-server and the app under test.

Sunday, April 3, 2016

Unit and UI Testing in Android Studio

1Overview

In this codelab, you'll learn how to set up your project in Android Studio for testing, write a Unit Test and run it locally on your development machine and also how to do functional UI testing on the device.

What you’ll learn

  • Updating the Gradle build files to include JUnit and the Android Testing Support Library
  • Writing Unit Tests which run on the Java VM on your local machine
  • Writing Espresso tests which run on the device or emulator

Saturday, April 2, 2016

Unit tests with Mockito - Starter

1. Unit Testing & test doubles

1.1. Target & challenge of unit testing

A unit test is a test related to a single responsibility of a single class, often referred to as the System Under Test (SUT). A unit test should test a class in isolation. Side effects from other classes or the system should be eliminated if possible. The achievement of this desired goal is typical complicated by the fact that Java classes usually depend on other classes. Test doubles will solve this.

Thursday, March 24, 2016

Android Testing Concepts and Types

Test Structure


Android testing is based on JUnit. In general, a JUnit test is a method whose statements test a part of the application. You organize test methods into classes called test cases. You can further organize these classes into test suites.
In JUnit, you build one or more test classes and use a test runner to execute them. In Android, you use Android Studio (or the Android Plugin for Gradle) to build one or more test source files into an Android test app.
From your testing environment, you can run your test in one of the following ways:
  • On your local machine: Compile the test classes and execute them locally on the Java Virtual Machine (JVM) using the JUnit test runner.
  • On a device or emulator: Install the test app and the app under test to a physical device or emulator, and then execute your tests using an Android-specific test runner (such as AndroidJUnitRunner).

Wednesday, March 23, 2016

Android Testing Framework

Overview

Google provides an Android Testing framework that is part of the Android SDK and is built on top of standard JUnit testing extended with a instrumentation framework and Android-specific testing classes.
Note: You must be running at least version 1.1.0 of the Android plug-in for Gradle, since unit testing with Android Studio was only recently supported. More information can be found here.

Popular Posts

Blog Archive