Presenter: Tyler Newsome

Slides:



Advertisements
Similar presentations
UBIQUITY V3 An extensible platform for creating dynamic, customized, and geocentric native mobile applications.
Advertisements

Android Application Development Tutorial. Topics Lecture 6 Overview Programming Tutorial 3: Sending/Receiving SMS Messages.
Application Fundamentals Android Development. Announcements Posting in D2L Tutorials.
Android Security. N-Degree of Separation Applications can be thought as composed by Main Functionality Several Non-functional Concerns Security is a non-functional.
Android Application Development. Agenda  Android Business Model  Why Android  Android application market space  Market Segments & Target customers.
Boyu Chen Yulin Xia Haoyu Xu Viterbi School of Engineering University of Southern California P2P file sharing system with a central server.
Building Apps with Connectivity & the Cloud. Connecting Devices Wirelessly Performing Network Operations Transferring Data Without Draining the Battery.
Getting Started with Android Development Rohit Ghatol.
Bluetooth. Bluetooth is an open, wireless protocol for exchanging data between devices over a short distance. –managed by the Bluetooth Special Interest.
NFC.  Near Filed Communication  Is a short range high frequency wireless communication technology  Low speed (106 to 424 kbps)  Low friction setup.
CS378 - Mobile Computing Connecting Devices. How to pass data between devices? – Chat – Games – Driving Options: – Use the cloud and a service such as.
CS378 - Mobile Computing What's Next?. Fragments Added in Android 3.0, a release aimed at tablets A fragment is a portion of the UI in an Activity multiple.
FILE100% FILE 25%. FILE100% Downloadin g Strategy FILE 40% FILE 10%
Software Architecture of Android Yaodong Bi, Ph.D. Department of Computing Sciences University of Scranton.
Data Storage: Part 4 (Content Providers). Content Providers Content providers allow the sharing of data between applications. Inter-process communication.
Rajab Davudov. Agenda Eclipse, ADT and Android SDK APK file Fundamentals – Activity – Service – Content Provider – Broadcast Receiver – Intent Hello World.
Using Intents to Broadcast Events Intents Can be used to broadcast messages anonymously Between components via the sendBroadcast method As a result Broadcast.
Cosc 5/4730 Broadcast Receiver. Broadcast receiver A broadcast receiver (short receiver) – is an Android component which allows you to register for system.
DUE Hello World on the Android Platform.
CS378 - Mobile Computing Intents.
16 Services and Broadcast Receivers CSNB544 Mobile Application Development Thanks to Utexas Austin.
NEARBY: HYBRID NETWORK MOBILE APPLICATION Shuai Zhang, Ziwen Zhang, Jikai Yin.
Alex Layton, Purdue University
CS378 - Mobile Computing Intents. Allow us to use applications and components that are part of Android System – start activities – start services – deliver.
COMP 365 Android Development.  Every android application has a manifest file called AndroidManifest.xml  Found in the Project folder  Contains critical.
Hybrid Cellular-Ad hoc Data Network Shuai Zhang, Ziwen Zhang, Jikai Yin.
Network Components By Kagan Strayer. Network Components This presentation will cover various network components and their functions. The components that.
Multimedia Capture & storage. Introduction A rich set of API for recording of audio & video. A developer has two choices  launch the built-in app using.
Peer to peer networks. Peer to peer is when digital devices communicate wirelessly with each others without the need for a transmitter. Wi-Fi Direct 1-
Wireless Mesh Networking or Peer to Peer Technology Andre Lukito – Johnsonsu – Wednesday, 9.
Nguyen Thi Thanh Nha HMCL by Roelof Kemp, Nicholas Palmer, Thilo Kielmann, and Henri Bal MOBICASE 2010, LNICST 2012 Cuckoo: A Computation Offloading Framework.
If you are thinking about developing mobile application for your customer, this is an important aspect to consider the platform.
Sockets A popular API for client-server interaction.
Services. What is a Service? A Service is not a separate process. A Service is not a thread. A Service itself is actually very simple, providing two main.
Java for android Development Nasrullah Khan. Using instanceof in Android Development the classes such as Button, TextView, and CheckBox, which represent.
KVM Verification KVM uses StackMaps generated by the preverifier to verify the trustworthiness of unknown classes. Relatively easy to process on the device,
1. 2 Android location services Determining a device’s current location Tracking device movements Proximity alerts.
Cross-functional team who negotiates and implements changes in the FRAG Framework Responsible for finding common solutions that should be added to the.
CS371m - Mobile Computing Intents 1. Allow us to use applications and components that are already part of Android System – start activities – start services.
NETWORK AND COMMUNICATIONS
Android Application -Architecture.
Mobile Applications (Android Programming)
A SEMINAR ON ROVER TECHNOLOGY
WELCOME Mobile Applications Testing
IoT Integration Patterns, REST, and CoAP
REST APIs and Android Presented by: James Simshaw
Bluetooth.
Bluetooth connection & GAIA protocol
Always Connected introduces Tigo SMART 3.0 This guide is interactive!
Broadcast receivers.
Instructor: Mazhar Hussain
Android System Security
Mobile Application Development
MAD.
Introduction to Wireless Technology
Activities and Intents
Android Mobile Application Development
Creation of an Android App By Keith Lynn
Content Providers.
Telecommunications, the Internet, and Wireless Technology
Reactive Android Development
Understanding Wi-Fi Direct in Windows 8
Wireless Communication between Android Application and Sensors
Azure Event Grid with Custom Events
Telecommunications, the Internet, and Wireless Technology
Android Developer Fundamentals V2 Lesson 5
Device Access Tomas Lukša.
Mobile Programming Dr. Mohsin Ali Memon.
Mobile Programming Broadcast Receivers.
A Billion Open Interfaces for Eve and Mallory: MitM, DoS, and Tracking Attacks on iOS and macOS Through AppleWireless Direct Link (AWDL) Milan Stute1,
Presentation transcript:

Presenter: Tyler Newsome Android Wi-Fi P2P Presenter: Tyler Newsome

Overview Wi-fi P2P lets android devices communicate with other without an access point in the middle Trades cost and energy for speed and range with respect to Bluetooth Wi-Fi API consists of three components Methods that interact with or discover peers WifiP2PManager class Listeners that respond to the results of WifiP2PManager method calls Can send listeners as parameter to method calls Intents that are broadcast when certain events happen Can capture the intent and act on it

References Study – all code comes from one of these resources https://developer.android.com/guide/topics/connectivity/wifip2p.html https://developer.android.com/reference/android/net/wifi/p2p/WifiP2pManager.html https://developer.android.com/reference/android/net/wifi/p2p/package-summary.html https://developer.android.com/reference/android/os/Looper.html Guides https://developer.android.com/training/connect-devices-wirelessly/wifi-direct.html https://developer.android.com/training/connect-devices-wirelessly/nsd-wifi-direct.html

What is Wi-Fi P2P? Well….what is Wi-Fi? That thing that lets you go on the internet? Wi-Fi is a standard technology to provide wireless communication between any two conforming devices So not just for internet access, but general communication Wi-Fi P2P = direct communication between two endpoints (called peers, in our case these are phones).

Why use Wi-Fi P2P? Can support multiple unique apps (messaging, multiplayer games etc.) Can communicate without an intermediary access point Faster and wider range than Bluetooth At the cost of higher energy usage and cost API is relatively simple, sending and receiving messages is similar to sending/receiving requests https://sites.google.com/site/androidmultiplayergames/home

Wi-FI P2P API Consists of three components Methods that interact with or discover peers WifiP2PManager class Asynchronous method calls Listeners that respond to the results of WifiP2PManager method calls Can send listeners as parameter to method calls Intents that are broadcast when certain events happen Can capture the intent and act on it All of these pieces are needed for most applications that need P2P. Make sure you know how to make use of all three!

WifiP2PManager Class Useful methods This class contains many methods for P2P interaction Get using getSystemService(Context.WIFI_P2P_SERVICE); Useful methods initialize() – registers the application connect() – connect to another device with P2P discoverPeers() – initiates peer discovery Will broadcast a WIFI_P2P_PEERS_CHANGED_ACTION intent if peer list has changed requestPeers() – returns the current list of peers

Example Peer discovery Wi-Fi P2P Framework 1. discoverPeers() 2. WIFI_P2P_PEERS_CHANGED_ACTION 3. requestPeers() 4. List of Peers (Phone 2) Phone 1 Phone 2

Listeners and Receivers WifiP2PManager has several listener interfaces to respond to various events You implement your own and send them as parameters to the relevant WifiP2PManager methods Also need to implement a Broadcast Receiver to capture Intents generated by the Wi-Fi P2P framework

Creating a Broadcast Receiver okokok

Full Wi-Fi Capable App Following along withhttps://developer.android.com/guide/topics/connectivity/wifip2p.html This shows how to fully initiate and setup a Wi-Fi connection to a peer There can be a lot of moving parts but remember the three components: WifiP2PManager, Listeners, and a Broadcast Receiver

1. Check the minAPI level and request permissions in the android manifest file 2. Check to see if Wi-Fi is on/supported. Do this by waiting for the WIFI_P2P_STATE_CHANGED_ACTION in your Broadcast Receiver’s onReceive method

3. In your app’s onCreate(), get the WifiP2PManager and initialize your device and Broadcast Receiver. Note: The Receiver given here is a custom class, *not* a built in class

4. Setup an Intent Filter with the Intents your Broadcast Receiver needs 5. Register/unregister your receiver on resume/pause

6. Discover peers, using a custom ActionListener al mManager.discoverPeers(channel, al); 7. Catch the appropriate intent with your Broadcast Listener and request the list of peers, using a custom PeerListListener

8. requestPeers() will produce a callback with your PeerListListener’s onPeersAvailable() method, providing a list of peers as an argument to the method. From here, you can examine the list and choose a device. In the following code, device would be a device obtained from the list.

9. You are now connected to a peer 9. You are now connected to a peer! All relevant information can retrieved from the peer list, and you can now use normal socket I/O to communicate between the devices. For more info https://developer.android.com/reference/java/net/ServerSocket.html https://developer.android.com/reference/java/net/Socket.html It took a some work, but with this setup you can leverage all the features of sockets to communicate between devices.

You now know Wi-Fi P2P

Image References Doge - http://i3.kym-cdn.com/photos/images/original/000/362/056/c0a.jpg All other images not self-made are from android wifip2p tutorial