Скачать презентацию Android client-server applications Motivation Data loading Скачать презентацию Android client-server applications Motivation Data loading

Basics.pptx

  • Количество слайдов: 51

Android client-server applications Android client-server applications

Motivation: § Data loading; § Data sharing; § Communication; Motivation: § Data loading; § Data sharing; § Communication;

We should have: § Server side; § Client side; § Communication between server side We should have: § Server side; § Client side; § Communication between server side and client side (RESTful API);

Server side: § Database; § API; Server side: § Database; § API;

Client side: § § Server module (process all the data); UI module – uses Client side: § § Server module (process all the data); UI module – uses server module to get, update and send data and interact with the user;

Server module: § § § § Send requests to server and read answers; Provides Server module: § § § § Send requests to server and read answers; Provides API for UI module; Take care about all the data; Take care about asynchronously processing requests; Cashes all data; Stable; Scalable;

UI module: § § § Uses server module to get data; Communicate with server UI module: § § § Uses server module to get data; Communicate with server module with callbacks mechanism; Should always be responsive;

Server module Server module

Send requests to server and read answers Send requests to server and read answers

Standard way Standard way

Deprecated way – Apache Http classes – deprecated since API 22 Deprecated way – Apache Http classes – deprecated since API 22

Now let’s start creating some good architecture Now let’s start creating some good architecture

Server side example Server side example

Store and cache all data, providing API Store and cache all data, providing API

UI module UI module

Processing requests asynchronously: § § § Threads + Runnables + Handler; Async. Task + Processing requests asynchronously: § § § Threads + Runnables + Handler; Async. Task + Callbacks; Loaders; Services + Broadcast. Receivers; Volley framework; Rx. Java;

Async. Task Async. Task

Using API Using API

Sending requests and getting answers Sending requests and getting answers

Security Security

APK files are easy as any jar files are easy to decomplie. So, you APK files are easy as any jar files are easy to decomplie. So, you just because of it cannot achieve perfect secrecy and even enough secrecy. Any key, any password for you API you should provide as a string in your. apk file. So, it easy to get it.

Tools to decompile your app: § § Show. Java – simple android application, which Tools to decompile your app: § § Show. Java – simple android application, which can decompile any installed or given apk and show only the java code; Apktool – powerful tool, which allows you to get a Java code, resources files and etc. ;

§ § § How to protect: Use some existing API for authorization and etc. § § § How to protect: Use some existing API for authorization and etc. , such as Google+ Auth. Use confirmation for sensitive actions (later); Store sensitive data with cryptography tools. Use public-key cryptography for exchanging. Use Pro. Guard – obfuscation.

Pro. Guard Pro. Guard