Beruflich Dokumente
Kultur Dokumente
Project Members
M. Akshay - 2013506060
K. Ashok - 2013506065
1|Page
TABLE OF CONTENTS:
ABSTRACT 3
1. INTRODUCTION 3
2. EXISTING WORK 4
3. PROPOSED WORK 5
4. IMPLEMENTATION 6
REQUIREMENTS
5. IMPLEMENTATION 7
STEPS
6. CONCLUSION 17
7. REFERENCES 18
2|Page
Abstract:
The objective of the project is to allow people to chat with many people at once
and share important documents. This application can be developed based on Android
operating system. The programming language is Java. The project can be tested on an
Android Emulator which is a tool that allow developers to easily test an application
without having to install the application on a real device. The Android-based instant
message application uses the client/server architecture. The client can add a registered
user to be his/her friend and send or receive a text message while the friend is on-line.
Currently, the communication in this application can be implemented using TCP. A
SQL database can be used as a backbone to store the user information. This app allows
the user to share file in any format and a wide range of data exchange is made possible.
It allow you to share documents with your friends. Ex. PDF, text files and multimedia.
Without downloading the documents the user can open the documents and view them
within the app.
1. Introduction:
Today, roughly 10% of all people in the world use Wi-Fi to stay connected.
Everyone needs information in faster access and easy way. Now technologies are
developing in such a way, everything become wireless. People can connect to one
another without joining a traditional home, office or hotspot network. Mobile phones
and other devices can able to make a one-to-one connection, or several devices can
connect simultaneously. The technology greatly enhances the portability of content
and applications across all of a user’s devices using a single industry-wide technology.
3|Page
2. EXISTING WORK:
Ideas:
Ideas:
This paper deals with the overview of the novel functionalities defined in Wi-
Fi direct, and present an experimental evaluation that portrays the performance to be
expected in real scenarios.
Ideas:
4|Page
3.PROPOSED WORK:
5|Page
4. IMPLEMENTATION REQUIREMENTS:
-signing capabilities.
6|Page
-in support for Google Cloud Platform, enabling integration with Google Cloud
Messaging and App Engine.
4.2. PLATFORM:
o Mobile Phones
5. IMPLEMENTATION STEPS:
7|Page
<uses-permission android:required="true"
android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:required="true"
android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:required="true"
android:name="android.permission.INTERNET"/> ...
To use Wi-Fi P2P, you need to listen for broadcast intents that tell your
application when certain events have occurred. In your application, instantiate an
IntentFilter and set it to listen for the following:
WIFI_P2P_STATE_CHANGED_ACTION
WIFI_P2P_PEERS_CHANGED_ACTION
WIFI_P2P_CONNECTION_CHANGED_ACTION
WIFI_P2P_THIS_DEVICE_CHANGED_ACTION
EXAMPLE:
intentFilter.addAction(WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTI
ON);
... }
At the end of the onCreate() method, get an instance of the WifiP2pManager, and call its
initialize()method. This method returns a WifiP2pManager.Channel object, which
you'll use later to connect your app to the Wi-Fi P2P framework. EXAMPLE:
@Override
Channel mChannel;
9|Page
Now create a new BroadcastReceiver class that you'll use to listen for changes
to the System's Wi-Fi P2P state. In the onReceive() method, add a condition to handle
each P2P state change listed above.
EXAMPLE:
@Override
if (WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION.equals(action)) {
// Determine if Wifi P2P mode is enabled or not, alert // the Activity.
if (state == WifiP2pManager.WIFI_P2P_STATE_ENABLED) {
activity.setIsWifiP2pEnabled(true); } else {
activity.setIsWifiP2pEnabled(false); } } else if
(WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION.equals(action)) {
} else if
(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION.equals(acti
on)) {
} else if
(WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION.equals(acti
10 | P a g e
on)) { DeviceListFragment fragment = (DeviceListFragment)
activity.getFragmentManager() .findFragmentById(R.id.frag_list);
fragment.updateThisDevice((WifiP2pDevice) intent.getParcelableExtra(
WifiP2pManager.EXTRA_WIFI_P2P_DEVICE));
}}
Finally, add code to register the intent filter and broadcast receiver when
your main activity is active, and unregister them when the activity is paused. The best
place to do this is the onResume() and onPause()methods.
@Override
@Override
To start searching for nearby devices with Wi-Fi P2P, call discoverPeers().
This method takes the following arguments:
-to-
peer mManager.
11 | P a g e
EXAMPLE:
@Override
// No services have actually been discovered yet, so this method // can often be
left blank. Code for peer discovery goes in the
@Override
Keep in mind that this only initiates peer discovery. The discoverPeers()
method starts the discovery process and then immediately returns. The system notifies
you if the peer discovery process is successfully initiated by calling methods in the
provided action listener. Also, discovery will remain active until a connection is
initiated or a P2P group is formed.
12 | P a g e
EXAMPLE:
@Override
public void connect() { // Picking the first device found on the network.
WifiP2pDevice device = peers.get(0);
@Override
@Override
} });
Its onConnectionInfoAvailable() callback will notify you when the state of the
connection changes. In cases where multiple devices are going to be connected to a
13 | P a g e
single device (like a game with 3 or more players, or a chat app), one device will be
designated the "group owner".
EXAMPLE:
@Override
Now go back to the onReceive() method of the broadcast receiver, and modify
the section that listens for aWIFI_P2P_CONNECTION_CHANGED_ACTION intent.
When this intent is received, call requestConnectionInfo(). This is an asynchronous call,
so results will be received by the connection info listener you provide as a parameter.
EXAMPLE:
if (WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION.equals(acti
on)) {
14 | P a g e
if (networkInfo.isConnected()) {
mManager.requestConnectionInfo(mChannel, connectionListener); }
To access the Wi-Fi state, we have to add the following permissions inside
the AndroidManifest.xml file:
To enable and disable Wi-Fi, we have to add the following code to the java
file.
After establishing connection between the two Android Devices, there should
be an option for chatting. Chatting operation is similar to transferring files. A textbox
should be provided for two users. Whatever is entered in the box, that is displayed inside
the bubble. One bubble is in Red Color while the other is in Green Color.
15 | P a g e
5.8 Using Swipe operation to Switch between images in Help Section:
A View Pager is created in layout file. An Image Adapter can be used to swipe
between images. Finally set the adapter of View Pager to Image Adapter.
imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
imageView.setImageResource(GalImages[position]);
return imageView;
16 | P a g e
6. CONCLUSION:
17 | P a g e
7. REFERENCES:
[1] http://stackoverflow.com/questions/14207392/android-button-click-go-to-
another-xml-page
[2] http://stackoverflow.com/questions/14229342/navigate-from-one-page-to-
another
[3] http://www.mkyong.com/android/android-activity-from-one-screen-to-another-
screen/
[4] http://developer.android.com/training/basics/firstapp/starting-activity.html
[5] http://stackoverflow.com/questions/25638335/how-to-transfer-files-between-
android-devices-using-wifi-direct
18 | P a g e