From 4bd4c47516f3fcc004b187b4e44cbdec30706695 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Sat, 19 May 2018 18:06:09 +0530 Subject: [PATCH 01/37] Send WiCard Activity Added! --- .../morasquad/wicard/SendWiCardActivity.java | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 app/src/main/java/me/morasquad/wicard/SendWiCardActivity.java diff --git a/app/src/main/java/me/morasquad/wicard/SendWiCardActivity.java b/app/src/main/java/me/morasquad/wicard/SendWiCardActivity.java new file mode 100644 index 0000000..8b14c15 --- /dev/null +++ b/app/src/main/java/me/morasquad/wicard/SendWiCardActivity.java @@ -0,0 +1,92 @@ +package me.morasquad.wicard; + +import android.content.Intent; +import android.database.Cursor; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.MenuItem; +import android.widget.Button; +import android.widget.TextView; + +public class SendWiCardActivity extends AppCompatActivity { + + String intentEmail; + TextView connectionStatus; + TextView fullNameText; + TextView emailText; + TextView addressText; + TextView mobileNumText; + Button wicardSendBtn; + SqliteHelper sqliteHelper; + String fullName, email, mobileNumber, address; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_send_wi_card); + + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayShowHomeEnabled(true); + getSupportActionBar().setTitle("WiCard : Send WiCard"); + + Intent intent = getIntent(); + intentEmail = intent.getStringExtra("email"); + + fullNameText = (TextView) findViewById(R.id.fullNameTxt); + emailText = (TextView) findViewById(R.id.emailTxt); + addressText = (TextView) findViewById(R.id.addressTxt); + mobileNumText = (TextView) findViewById(R.id.mobileNumTxt); + + wicardSendBtn = (Button) findViewById(R.id.sendWiCard); + + connectionStatus.setText(intentEmail); + + loadWiCard(); + + } + + private void loadWiCard() { + + sqliteHelper = new SqliteHelper(getApplicationContext()); + Cursor cursor = sqliteHelper.getUser(intentEmail); + if (cursor.getCount() != 0) { + cursor.moveToFirst(); + + fullName = cursor.getString(cursor.getColumnIndex("fullName")); + email = cursor.getString(cursor.getColumnIndex("email")); + mobileNumber = cursor.getString(cursor.getColumnIndex("mobileNumber")); + address = cursor.getString(cursor.getColumnIndex("address")); + + fullNameText.setText(fullName); + emailText.setText(email); + mobileNumText.setText(mobileNumber); + addressText.setText(address); + if (!cursor.isClosed()) { + cursor.close(); + } + }else { + fullNameText.setText(""); + emailText.setText(""); + mobileNumText.setText(""); + addressText.setText(""); + } + } + + + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + + if(id == android.R.id.home){ + SendUsertoMainActivity(); + } + return super.onOptionsItemSelected(item); + } + + private void SendUsertoMainActivity() { + + Intent home = new Intent(SendWiCardActivity.this, MainActivity.class); + home.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(home); + finish(); + } +} From 10adccd7b5e10f7ecfc47648040480825c2b0673 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Sat, 19 May 2018 19:34:38 +0530 Subject: [PATCH 02/37] Recieve WiCard Added! --- .../wicard/RecieveWiCardActivity.java | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 app/src/main/java/me/morasquad/wicard/RecieveWiCardActivity.java diff --git a/app/src/main/java/me/morasquad/wicard/RecieveWiCardActivity.java b/app/src/main/java/me/morasquad/wicard/RecieveWiCardActivity.java new file mode 100644 index 0000000..5c65ca5 --- /dev/null +++ b/app/src/main/java/me/morasquad/wicard/RecieveWiCardActivity.java @@ -0,0 +1,181 @@ +package me.morasquad.wicard; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.net.wifi.WifiManager; +import android.net.wifi.p2p.WifiP2pDevice; +import android.net.wifi.p2p.WifiP2pDeviceList; +import android.net.wifi.p2p.WifiP2pInfo; +import android.net.wifi.p2p.WifiP2pManager; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.MenuItem; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.ListView; +import android.widget.TextView; +import android.widget.Toast; + +import java.net.InetAddress; +import java.util.ArrayList; +import java.util.List; + +public class RecieveWiCardActivity extends AppCompatActivity { + + TextView connectionStatus; + TextView fullNameText; + TextView emailText; + TextView addressText; + TextView mobileNumText; + SqliteHelper sqliteHelper; + String fullName, email, mobileNumber, address; + + WifiManager wifiManager; + WifiP2pManager mManager; + WifiP2pManager.Channel mChannel; + + BroadcastReceiver mReciever; + IntentFilter mIntentFilter; + + List peers = new ArrayList(); + String[] deviceNameArray; + WifiP2pDevice[] deviceArray; + + static final int MESSAGE_READ = 1; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_recieve_wi_card); + + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayShowHomeEnabled(true); + getSupportActionBar().setTitle("WiCard : Receive WiCard"); + + fullNameText = (TextView) findViewById(R.id.fullNameTxtRec); + emailText = (TextView) findViewById(R.id.emailTxtRec); + addressText = (TextView) findViewById(R.id.addressTxtRec); + mobileNumText = (TextView) findViewById(R.id.mobileNumTxtRec); + connectionStatus = (TextView) findViewById(R.id.connectonStatusRec); + + + initialLoading(); + initialListner(); + discoverPeers(); + } + + + private void discoverPeers() { + + mManager.discoverPeers(mChannel, new WifiP2pManager.ActionListener() { + @Override + public void onSuccess() { + connectionStatus.setText("Discovery Started!"); + } + + @Override + public void onFailure(int i) { + connectionStatus.setText("Discovery Starting Failed!"); + } + }); + } + + private void initialListner() { + + if(wifiManager.isWifiEnabled()){ + return; + }else { + wifiManager.setWifiEnabled(true); + } + + + } + + private void initialLoading() { + + wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE); + mManager = (WifiP2pManager) getSystemService(Context.WIFI_P2P_SERVICE); + mChannel = mManager.initialize(this, getMainLooper(), null); + + mReciever = new WifiDirectBroadcastRecieverforReciever(mManager, mChannel, this); + mIntentFilter = new IntentFilter(); + + mIntentFilter.addAction(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION); + mIntentFilter.addAction(WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION); + mIntentFilter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION); + mIntentFilter.addAction(WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION); + } + + + + WifiP2pManager.PeerListListener peerListListener = new WifiP2pManager.PeerListListener() { + @Override + public void onPeersAvailable(WifiP2pDeviceList peerList) { + if(!peerList.getDeviceList().equals(peers)){ + peers.clear(); + peers.addAll(peerList.getDeviceList()); + + deviceNameArray = new String[peerList.getDeviceList().size()]; + deviceArray = new WifiP2pDevice[peerList.getDeviceList().size()]; + + int index = 0; + + for (WifiP2pDevice device : peerList.getDeviceList()){ + deviceNameArray[index] = device.deviceName; + deviceArray[index] = device; + index++; + } + + } + + if(peers.size() == 0){ + Toast.makeText(RecieveWiCardActivity.this, "No Devices Found!", Toast.LENGTH_SHORT).show(); + return; + } + } + }; + + WifiP2pManager.ConnectionInfoListener connectionInfoListener = new WifiP2pManager.ConnectionInfoListener() { + @Override + public void onConnectionInfoAvailable(WifiP2pInfo wifiP2pInfo) { + final InetAddress groupOwnerAddress = wifiP2pInfo.groupOwnerAddress; + + if(wifiP2pInfo.groupFormed && wifiP2pInfo.isGroupOwner){ + connectionStatus.setText("Sender"); + }else if (wifiP2pInfo.groupFormed){ + connectionStatus.setText("Receiver"); + } + } + }; + + + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + + if(id == android.R.id.home){ + SendUsertoMainActivity(); + } + return super.onOptionsItemSelected(item); + } + + private void SendUsertoMainActivity() { + + Intent home = new Intent(RecieveWiCardActivity.this, MainActivity.class); + home.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(home); + finish(); + } + + @Override + protected void onResume() { + super.onResume(); + registerReceiver(mReciever, mIntentFilter); + } + + @Override + protected void onPause() { + super.onPause(); + unregisterReceiver(mReciever); + } +} From 977dcb71bee4d1acdc869f6e0a046196a7de95a3 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Sun, 20 May 2018 08:38:00 +0530 Subject: [PATCH 03/37] Send Data Completed! --- .../wicard/RecieveWiCardActivity.java | 153 +++++++++++++++++- 1 file changed, 150 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/me/morasquad/wicard/RecieveWiCardActivity.java b/app/src/main/java/me/morasquad/wicard/RecieveWiCardActivity.java index 5c65ca5..2adb974 100644 --- a/app/src/main/java/me/morasquad/wicard/RecieveWiCardActivity.java +++ b/app/src/main/java/me/morasquad/wicard/RecieveWiCardActivity.java @@ -9,16 +9,23 @@ import android.net.wifi.p2p.WifiP2pDeviceList; import android.net.wifi.p2p.WifiP2pInfo; import android.net.wifi.p2p.WifiP2pManager; +import android.os.Handler; +import android.os.Message; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.MenuItem; -import android.widget.ArrayAdapter; +import android.view.View; import android.widget.Button; -import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; import java.util.ArrayList; import java.util.List; @@ -29,6 +36,7 @@ public class RecieveWiCardActivity extends AppCompatActivity { TextView emailText; TextView addressText; TextView mobileNumText; + Button saveWiCard, deleteWiCard; SqliteHelper sqliteHelper; String fullName, email, mobileNumber, address; @@ -44,6 +52,13 @@ public class RecieveWiCardActivity extends AppCompatActivity { WifiP2pDevice[] deviceArray; static final int MESSAGE_READ = 1; + + ServerClass serverClass; + ClientClass clientClass; + SendRecieve sendRecieve; + + + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -58,14 +73,53 @@ protected void onCreate(Bundle savedInstanceState) { addressText = (TextView) findViewById(R.id.addressTxtRec); mobileNumText = (TextView) findViewById(R.id.mobileNumTxtRec); connectionStatus = (TextView) findViewById(R.id.connectonStatusRec); + saveWiCard = (Button) findViewById(R.id.save_wicard); + deleteWiCard = (Button) findViewById(R.id.delete_wicard); + saveWiCard.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + boolean result = sqliteHelper.saveRecievedWiCard(email, address, mobileNumber, fullName); + + if(result){; + Toast.makeText(RecieveWiCardActivity.this, "Saved Successfully!", Toast.LENGTH_SHORT).show(); + }else { + Toast.makeText(RecieveWiCardActivity.this, "Failed to Saving!", Toast.LENGTH_SHORT).show(); + + } + } + }); initialLoading(); initialListner(); discoverPeers(); - } + + + } + Handler handler = new Handler(new Handler.Callback() { + @Override + public boolean handleMessage(Message msg) { + switch (msg.what){ + case MESSAGE_READ: + byte[] readBuff = (byte[]) msg.obj; + String tempMsg = new String(readBuff, 0,msg.arg1); + String[] parts = tempMsg.split("&"); + fullName = parts[0]; + email = parts[1]; + address = parts[2]; + mobileNumber = parts[3]; + fullNameText.setText(fullName); + emailText.setText(email); + addressText.setText(address); + mobileNumText.setText(mobileNumber); + break; + } + return true; + } + }); + private void discoverPeers() { mManager.discoverPeers(mChannel, new WifiP2pManager.ActionListener() { @@ -143,8 +197,12 @@ public void onConnectionInfoAvailable(WifiP2pInfo wifiP2pInfo) { if(wifiP2pInfo.groupFormed && wifiP2pInfo.isGroupOwner){ connectionStatus.setText("Sender"); + serverClass = new ServerClass(); + serverClass.start(); }else if (wifiP2pInfo.groupFormed){ connectionStatus.setText("Receiver"); + clientClass = new ClientClass(groupOwnerAddress); + clientClass.start(); } } }; @@ -178,4 +236,93 @@ protected void onPause() { super.onPause(); unregisterReceiver(mReciever); } + + public class ServerClass extends Thread{ + Socket socket; + ServerSocket serverSocket; + + @Override + public void run() { + try { + serverSocket = new ServerSocket(8888); + socket = serverSocket.accept(); + sendRecieve = new SendRecieve(socket); + sendRecieve.start(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + public class ClientClass extends Thread{ + + Socket socket; + String hostAdd; + + public ClientClass(InetAddress hostAddress){ + + hostAdd = hostAddress.getHostAddress(); + socket = new Socket(); + } + + @Override + public void run() { + + try { + socket.connect(new InetSocketAddress(hostAdd, 8888),500); + + sendRecieve = new SendRecieve(socket); + sendRecieve.start(); + + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + private class SendRecieve extends Thread{ + + private Socket socket; + private InputStream inputStream; + private OutputStream outputStream; + + public SendRecieve(Socket skt) throws IOException { + socket = skt; + inputStream = socket.getInputStream(); + outputStream = socket.getOutputStream(); + + + } + + @Override + public void run() { + + byte[] buffer = new byte[1024]; + int bytes; + + while (socket != null){ + try { + bytes = inputStream.read(buffer); + if(bytes > 0){ + handler.obtainMessage(MESSAGE_READ, bytes, -1,buffer).sendToTarget(); + + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + + public void write(byte[] bytes){ + try { + outputStream.write(bytes); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + + } From 7357151462d6b1765ddec424ce23ca6c58230715 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Sun, 20 May 2018 12:11:39 +0530 Subject: [PATCH 04/37] Recieved WiCard Activity Added --- .../wicard/RecievedWiCardActivity.java | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 app/src/main/java/me/morasquad/wicard/RecievedWiCardActivity.java diff --git a/app/src/main/java/me/morasquad/wicard/RecievedWiCardActivity.java b/app/src/main/java/me/morasquad/wicard/RecievedWiCardActivity.java new file mode 100644 index 0000000..8aa7df8 --- /dev/null +++ b/app/src/main/java/me/morasquad/wicard/RecievedWiCardActivity.java @@ -0,0 +1,90 @@ +package me.morasquad.wicard; + +import android.content.Context; +import android.content.Intent; +import android.os.AsyncTask; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.support.v7.widget.DefaultItemAnimator; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.view.MenuItem; + +import java.util.ArrayList; + +import me.morasquad.wicard.models.RecievedWiCards; + +public class RecievedWiCardActivity extends AppCompatActivity { + + private AppCompatActivity activity = RecievedWiCardActivity.this; + private Context context = RecievedWiCardActivity.this; + private RecyclerView recyclerView; + private ArrayList recievedWiCards; + private RecievedWiCardRecyclerAdapter recievedWiCardRecyclerAdapter; + private SqliteHelper sqliteHelper; + private ArrayList filteredList; + + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_recieved_wi_card); + + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayShowHomeEnabled(true); + getSupportActionBar().setTitle("WiCard : Received WiCards"); + + recyclerView = (RecyclerView) findViewById(R.id.rec_wicard_recycler); + recievedWiCards = new ArrayList<>(); + recievedWiCardRecyclerAdapter = new RecievedWiCardRecyclerAdapter(recievedWiCards, this); + + RecyclerView.LayoutManager mlayoutManager = new LinearLayoutManager(getApplicationContext()); + recyclerView.setLayoutManager(mlayoutManager); + recyclerView.setItemAnimator(new DefaultItemAnimator()); + recyclerView.setHasFixedSize(true); + recyclerView.setAdapter(recievedWiCardRecyclerAdapter); + + sqliteHelper = new SqliteHelper(this); + + getDataFromSqlite(); + } + + private void getDataFromSqlite() { + + new AsyncTask(){ + + @Override + protected Void doInBackground(Void... params) { + recievedWiCards.clear(); + recievedWiCards.addAll(sqliteHelper.getRecievedWiCards()); + return null; + } + + @Override + protected void onPostExecute(Void aVoid) { + super.onPostExecute(aVoid); + recievedWiCardRecyclerAdapter.notifyDataSetChanged(); + } + }.execute(); + } + + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + + if(id == android.R.id.home){ + SendUsertoMainActivity(); + } + return super.onOptionsItemSelected(item); + } + + private void SendUsertoMainActivity() { + + Intent home = new Intent(RecievedWiCardActivity.this, MainActivity.class); + home.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(home); + finish(); + } +} From 845a53d168d1ff2cc1293e487dd9ef8e5177d26f Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Sun, 20 May 2018 16:29:47 +0530 Subject: [PATCH 05/37] Received WiCards Completed, Send WiCard Removed! --- .../main/java/me/morasquad/wicard/MainActivity.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/me/morasquad/wicard/MainActivity.java b/app/src/main/java/me/morasquad/wicard/MainActivity.java index b3a2957..d7493b3 100644 --- a/app/src/main/java/me/morasquad/wicard/MainActivity.java +++ b/app/src/main/java/me/morasquad/wicard/MainActivity.java @@ -1,6 +1,7 @@ package me.morasquad.wicard; import android.content.Intent; +import android.content.IntentFilter; import android.support.annotation.NonNull; import android.support.design.widget.NavigationView; import android.support.v4.widget.DrawerLayout; @@ -60,16 +61,14 @@ private void UserMenuSelector(MenuItem item) { startActivity(create); break; - case R.id.send_wicard: - Toast.makeText(this, "Send WiCard", Toast.LENGTH_SHORT).show(); - break; - case R.id.get_wicard: - Toast.makeText(this, "Get WiCard", Toast.LENGTH_SHORT).show(); + Intent recieve = new Intent(MainActivity.this, RecieveWiCardActivity.class); + startActivity(recieve); break; case R.id.saved_wicards: - Toast.makeText(this, "Save WiCards", Toast.LENGTH_SHORT).show(); + Intent recieved = new Intent(MainActivity.this, RecievedWiCardActivity.class); + startActivity(recieved); break; From aecdeac19533e1245e813eb4494a23a26ed08647 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Sun, 20 May 2018 16:45:14 +0530 Subject: [PATCH 06/37] Update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 076967f..414310d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ -# WiCard -sandun.isuru@gmail.com Sandun Isuru Niraj Sandun-Isuru-Niraj IA7 +# WiCard - Share Your Attitude + +With this application You can __Easily__ create your Virtual Name Card and Share them with your Business persons and others through the ==WiFi==. +It can save your WiCard, Without Internet Connection and Share them Without Internet. +And Also Easily connect them with On Phone, SMS or Email. +You can save them in to your contacts not remembering them. No need to re enter like traditional Business Cards. From 4352d12c4c678f8ba95756c713a62a4c6d789a7d Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Sun, 20 May 2018 16:47:15 +0530 Subject: [PATCH 07/37] Update Readme --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 414310d..2a8c80b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # WiCard - Share Your Attitude -With this application You can __Easily__ create your Virtual Name Card and Share them with your Business persons and others through the ==WiFi==. -It can save your WiCard, Without Internet Connection and Share them Without Internet. -And Also Easily connect them with On Phone, SMS or Email. -You can save them in to your contacts not remembering them. No need to re enter like traditional Business Cards. +With this application You can __Easily__ create your Virtual Name Card and Share them with your Business persons and others through the __WiFi__. +- It can save your WiCard, Without Internet Connection and Share them Without Internet. +- And Also Easily connect them with On Phone, SMS or Email. +- You can save them in to your contacts not remembering them. No need to re enter like traditional Business Cards. From 2dc27949c40af0bd64fdcab85bd70764c26c0647 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Sun, 20 May 2018 16:49:10 +0530 Subject: [PATCH 08/37] Updated Readme.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 2a8c80b..b32ecb4 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,5 @@ With this application You can __Easily__ create your Virtual Name Card and Share - It can save your WiCard, Without Internet Connection and Share them Without Internet. - And Also Easily connect them with On Phone, SMS or Email. - You can save them in to your contacts not remembering them. No need to re enter like traditional Business Cards. + +sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 From 7b95c27f67f6e3f2c35588eeef433527e1d8a8c6 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Mon, 21 May 2018 21:50:33 +0530 Subject: [PATCH 09/37] Main Activity Completed, UI Improved --- .../me/morasquad/wicard/MainActivity.java | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/me/morasquad/wicard/MainActivity.java b/app/src/main/java/me/morasquad/wicard/MainActivity.java index d7493b3..015c9e9 100644 --- a/app/src/main/java/me/morasquad/wicard/MainActivity.java +++ b/app/src/main/java/me/morasquad/wicard/MainActivity.java @@ -1,7 +1,6 @@ package me.morasquad.wicard; import android.content.Intent; -import android.content.IntentFilter; import android.support.annotation.NonNull; import android.support.design.widget.NavigationView; import android.support.v4.widget.DrawerLayout; @@ -9,7 +8,8 @@ import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.MenuItem; -import android.widget.Toast; +import android.view.View; +import android.widget.Button; public class MainActivity extends AppCompatActivity { @@ -17,12 +17,15 @@ public class MainActivity extends AppCompatActivity { private DrawerLayout mDrawerLayout; private ActionBarDrawerToggle mToggle; private NavigationView navigationView; + private Button createWicard, recieveWiCard, savedWicard; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + + navigationView = (NavigationView) findViewById(R.id.nav_view); mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer); mToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.open, R.string.close); @@ -30,7 +33,37 @@ protected void onCreate(Bundle savedInstanceState) { mToggle.syncState(); getSupportActionBar().setDisplayHomeAsUpEnabled(true); + createWicard = (Button) findViewById(R.id.create_main); + recieveWiCard = (Button) findViewById(R.id.recieve_main); + savedWicard = (Button) findViewById(R.id.saved_main); + + + createWicard.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent create = new Intent(MainActivity.this, CreateWiCardActivity.class); + startActivity(create); + } + }); + + recieveWiCard.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent recieve = new Intent(MainActivity.this, RecieveWiCardActivity.class); + startActivity(recieve); + } + }); + + savedWicard.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent saved = new Intent(MainActivity.this, RecievedWiCardActivity.class); + startActivity(saved); + } + }); + navigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() { + @Override public boolean onNavigationItemSelected(@NonNull MenuItem item) { UserMenuSelector(item); @@ -39,8 +72,6 @@ public boolean onNavigationItemSelected(@NonNull MenuItem item) { }); - - } private void UserMenuSelector(MenuItem item) { From 80bfe1a01ee56fb91f935a297ad94548f49112c3 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Mon, 21 May 2018 22:29:38 +0530 Subject: [PATCH 10/37] Launcher Icon Updated! --- app/src/main/AndroidManifest.xml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a372ec7..8269b65 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,9 +2,19 @@ + + + + + + + + + + - + + + + \ No newline at end of file From 4ddae3fbd1d2d43f95c192e06efe0956a1cf3545 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Mon, 21 May 2018 22:39:50 +0530 Subject: [PATCH 11/37] Introducing Launcher Icon --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b32ecb4..ef104cb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ + +sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 + +![launcher icon](http://i67.tinypic.com/2hfo2g6.jpg =150x150) # WiCard - Share Your Attitude With this application You can __Easily__ create your Virtual Name Card and Share them with your Business persons and others through the __WiFi__. @@ -5,4 +9,3 @@ With this application You can __Easily__ create your Virtual Name Card and Share - And Also Easily connect them with On Phone, SMS or Email. - You can save them in to your contacts not remembering them. No need to re enter like traditional Business Cards. -sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 From a77db9eef6ada586caaf19e27d8f87be33f8dd9a Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Mon, 21 May 2018 22:40:15 +0530 Subject: [PATCH 12/37] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ef104cb..256e633 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 -![launcher icon](http://i67.tinypic.com/2hfo2g6.jpg =150x150) +![launcher icon](http://i67.tinypic.com/2hfo2g6.jpg) # WiCard - Share Your Attitude With this application You can __Easily__ create your Virtual Name Card and Share them with your Business persons and others through the __WiFi__. From c077e2e4eb9b34494cab4cd7a498cf5671137639 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Mon, 21 May 2018 22:46:26 +0530 Subject: [PATCH 13/37] Starting Documentation --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 256e633..0bd47cd 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 -![launcher icon](http://i67.tinypic.com/2hfo2g6.jpg) +![launcher icon](http://i66.tinypic.com/29479nd.jpg) # WiCard - Share Your Attitude With this application You can __Easily__ create your Virtual Name Card and Share them with your Business persons and others through the __WiFi__. @@ -9,3 +9,6 @@ With this application You can __Easily__ create your Virtual Name Card and Share - And Also Easily connect them with On Phone, SMS or Email. - You can save them in to your contacts not remembering them. No need to re enter like traditional Business Cards. +## How it Works + +### Creating a new WiCard From 2f188b1894f37f18014b302dd9e80be448e9c00a Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Mon, 21 May 2018 23:02:13 +0530 Subject: [PATCH 14/37] Finishing Creating WiCard in Documentation --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0bd47cd..d82340d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 - -![launcher icon](http://i66.tinypic.com/29479nd.jpg) +![launcher icon](http://i65.tinypic.com/25flje0.jpg) # WiCard - Share Your Attitude With this application You can __Easily__ create your Virtual Name Card and Share them with your Business persons and others through the __WiFi__. @@ -12,3 +11,10 @@ With this application You can __Easily__ create your Virtual Name Card and Share ## How it Works ### Creating a new WiCard + +You can simply click the __Create a WiCard__ button on main page or, __Create a WiCard__ on Drawer to enter the New WiCard Creation Wizard. +![main page](http://i68.tinypic.com/2qvcltj.jpg) +![main page](http://i68.tinypic.com/ehdtp0.jpg) + +Then You can enter your WiCard Details and Click __Save__ Button. It will be create Your WiCard. +![main page](http://i65.tinypic.com/282448o.jpg) From abf30d88b2537e2399638db71f1a2081831bcc58 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Mon, 21 May 2018 23:02:48 +0530 Subject: [PATCH 15/37] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index d82340d..b559192 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 + ![launcher icon](http://i65.tinypic.com/25flje0.jpg) # WiCard - Share Your Attitude @@ -13,8 +14,10 @@ With this application You can __Easily__ create your Virtual Name Card and Share ### Creating a new WiCard You can simply click the __Create a WiCard__ button on main page or, __Create a WiCard__ on Drawer to enter the New WiCard Creation Wizard. + ![main page](http://i68.tinypic.com/2qvcltj.jpg) ![main page](http://i68.tinypic.com/ehdtp0.jpg) Then You can enter your WiCard Details and Click __Save__ Button. It will be create Your WiCard. + ![main page](http://i65.tinypic.com/282448o.jpg) From 5d3dead005f896bf6f0e74a0b37f8007b74e0444 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Tue, 22 May 2018 17:37:41 +0530 Subject: [PATCH 16/37] Update README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index b559192..f5f1edc 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,18 @@ You can simply click the __Create a WiCard__ button on main page or, __Create a Then You can enter your WiCard Details and Click __Save__ Button. It will be create Your WiCard. ![main page](http://i65.tinypic.com/282448o.jpg) + +### Viewing Created WiCards + +If you need to see or send or delete your WiCard. You Can easily click on the drawer and select __My WiCard__. Then You can see your created WiCards. + +![my wicards](http://i64.tinypic.com/ux3zk.jpg) + +If you need to delete on this. You can tap and hold on the WiCard and popup menu will appear. +![my wicards](http://i64.tinypic.com/p3ybq.jpg) + +Then Click on Delete. + +![my wicards](http://i67.tinypic.com/se7xu0.jpg) + +Then Click Yes. And It will be deleted your WiCard. From deaf5f5154666724752f0c23ad5933b844f2e00b Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Tue, 22 May 2018 17:38:17 +0530 Subject: [PATCH 17/37] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f5f1edc..e729b91 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ If you need to see or send or delete your WiCard. You Can easily click on the dr ![my wicards](http://i64.tinypic.com/ux3zk.jpg) If you need to delete on this. You can tap and hold on the WiCard and popup menu will appear. + ![my wicards](http://i64.tinypic.com/p3ybq.jpg) Then Click on Delete. From c763421048a35228e9ff2b75a2c5c5300a8b98c8 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Tue, 22 May 2018 17:45:43 +0530 Subject: [PATCH 18/37] Update README.md --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index e729b91..c43c940 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,22 @@ Then Click on Delete. ![my wicards](http://i67.tinypic.com/se7xu0.jpg) Then Click Yes. And It will be deleted your WiCard. + +### Sending Your WiCard + +To Sending the WiCard. The Receiver also need to install WiCard App in his Mobile Phone. +In the senders phone he can click and hold on the WiCard that he needs to send and select Send option. +It will go to Sending Wizard. + +![my wicards](http://i65.tinypic.com/nye2rl.jpg) + +It will automatically search for nearby devices. If not click the Search Devices Button. If the device show on the List Click on the device and It will be connected. + +![my wicards](http://i64.tinypic.com/11bk8ip.jpg) + +Then Wait until the status Changed to the __Receiver__. + +![my wicards](http://i68.tinypic.com/14c8d3b.jpg) + +Now Click the send Button. + From c081940094d1d6588e37de247c637a254e7dafae Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Tue, 22 May 2018 17:54:42 +0530 Subject: [PATCH 19/37] Update README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index c43c940..2ebd3d9 100644 --- a/README.md +++ b/README.md @@ -56,3 +56,16 @@ Then Wait until the status Changed to the __Receiver__. Now Click the send Button. +### Receiving WiCards. + +If you need to receive a WiCard from another person. Simply Click on __Receive WiCard__ Button on Home Screen or Drawer. +Then you will be redirect to the Receiving Wizard. + +![my wicards](http://i66.tinypic.com/6fz7sz.jpg) + +Then Wait for the other device discover you. Then Connected other Device will send the WiCard and it shows on your mobile. + +![my wicards](http://i64.tinypic.com/2w4mgkx.jpg) + +Then You Can Save or Delete it clicking on the action buttons. + From f1e71c5cd8977b4ee92e426f94192b8cd93594fd Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Tue, 22 May 2018 18:01:40 +0530 Subject: [PATCH 20/37] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 2ebd3d9..b8f2903 100644 --- a/README.md +++ b/README.md @@ -69,3 +69,12 @@ Then Wait for the other device discover you. Then Connected other Device will se Then You Can Save or Delete it clicking on the action buttons. +### Viewing Received WiCards + +Clicking on the __Saved WiCards__ on the Drawer or Home Page. You can access the your received and saved WiCards. + +![my wicards](http://i63.tinypic.com/23rpf6u.jpg) + +Then Click and holding on the WiCards you can get calls to the Numbers, Send Messages to the Number, Send Emails to the Email address, Save the WiCard as Mobile Contact and Delete the received WiCard. + +![my wicards](http://i67.tinypic.com/vhutd.jpg) From 6e8ce2314d0bfc501aa783248fa0516b9b522eab Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Tue, 22 May 2018 18:02:48 +0530 Subject: [PATCH 21/37] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b8f2903..89087a9 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Now Click the send Button. ### Receiving WiCards. -If you need to receive a WiCard from another person. Simply Click on __Receive WiCard__ Button on Home Screen or Drawer. +If you need to receive a WiCard from another person. Simply Click on __Receive WiCard__ Button on Home Screen or __Get a WiCard__ option on Drawer. Then you will be redirect to the Receiving Wizard. ![my wicards](http://i66.tinypic.com/6fz7sz.jpg) From de40e8f660c9e8abd4e294afb75f42d459ed59c3 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 10:27:42 +0530 Subject: [PATCH 22/37] Update README.md --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 89087a9..3051480 100644 --- a/README.md +++ b/README.md @@ -78,3 +78,29 @@ Clicking on the __Saved WiCards__ on the Drawer or Home Page. You can access the Then Click and holding on the WiCards you can get calls to the Numbers, Send Messages to the Number, Send Emails to the Email address, Save the WiCard as Mobile Contact and Delete the received WiCard. ![my wicards](http://i67.tinypic.com/vhutd.jpg) + +### Error Handling + ++ __If Recievers mode Device is still disconnected__ - + Please simply click on the back button of your mobile and again click on the Get WiCard Option. + ++ __If Automatically Not Turn on WiFi__ - + Check Your permissions on Mobile Phone. Below the Android API 17 devices has some issues with WIFI connectivity. + +### Tested Profile + + + Android API Level 16 / 17 + + 1GB Ram and 512MB Ram + +### Used Libraries + +All are the Google Standard Libraries Only no Third party libraries used. + +### Used Services + +All the services are Free and Open Source + +### References + ++ Official Android Doumentation ++ P Joby, Abby. (2016). Socket Programming WIFI Chat APP For Android Smartphone. 10.13140/RG.2.1.3692.2483. From c1ec5a39d2f20554b9d5daeaeb91c941d9dbfee3 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 10:28:47 +0530 Subject: [PATCH 23/37] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3051480..70a38c9 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Then Click and holding on the WiCards you can get calls to the Numbers, Send Mes ![my wicards](http://i67.tinypic.com/vhutd.jpg) -### Error Handling +## Error Handling + __If Recievers mode Device is still disconnected__ - Please simply click on the back button of your mobile and again click on the Get WiCard Option. @@ -87,20 +87,20 @@ Then Click and holding on the WiCards you can get calls to the Numbers, Send Mes + __If Automatically Not Turn on WiFi__ - Check Your permissions on Mobile Phone. Below the Android API 17 devices has some issues with WIFI connectivity. -### Tested Profile +## Tested Profile + Android API Level 16 / 17 + 1GB Ram and 512MB Ram -### Used Libraries +## Used Libraries All are the Google Standard Libraries Only no Third party libraries used. -### Used Services +## Used Services All the services are Free and Open Source -### References +## References + Official Android Doumentation + P Joby, Abby. (2016). Socket Programming WIFI Chat APP For Android Smartphone. 10.13140/RG.2.1.3692.2483. From 8a3866baf7e6a35baed6e3ddb2fdcd664dc38e1a Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 10:30:33 +0530 Subject: [PATCH 24/37] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 70a38c9..7e5eff7 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 ![launcher icon](http://i65.tinypic.com/25flje0.jpg) # WiCard - Share Your Attitude + 1. [Introduction] + +## Introduction With this application You can __Easily__ create your Virtual Name Card and Share them with your Business persons and others through the __WiFi__. - It can save your WiCard, Without Internet Connection and Share them Without Internet. - And Also Easily connect them with On Phone, SMS or Email. From 445c4c29bfe121ca4b647c5c6b05be06de339802 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 10:31:17 +0530 Subject: [PATCH 25/37] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7e5eff7..ebd590a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 ![launcher icon](http://i65.tinypic.com/25flje0.jpg) # WiCard - Share Your Attitude - 1. [Introduction] + 1. [Introduction](#references) ## Introduction With this application You can __Easily__ create your Virtual Name Card and Share them with your Business persons and others through the __WiFi__. From a1d4398e696e7311342ac831749123c686e3a119 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 10:32:01 +0530 Subject: [PATCH 26/37] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ebd590a..293a7d0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 ![launcher icon](http://i65.tinypic.com/25flje0.jpg) # WiCard - Share Your Attitude - 1. [Introduction](#references) + 1. [Introduction](https://github.com/codezilla2018/WiCard/blob/master/README.md#introduction) ## Introduction With this application You can __Easily__ create your Virtual Name Card and Share them with your Business persons and others through the __WiFi__. From 6abefd49693d3a666497675f531c9a4bcc095ed8 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 10:35:19 +0530 Subject: [PATCH 27/37] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 293a7d0..24fcaef 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 ![launcher icon](http://i65.tinypic.com/25flje0.jpg) # WiCard - Share Your Attitude - 1. [Introduction](https://github.com/codezilla2018/WiCard/blob/master/README.md#introduction) +[link](#introduction) ## Introduction With this application You can __Easily__ create your Virtual Name Card and Share them with your Business persons and others through the __WiFi__. From ae1667af3af66d32e0c2e9ea9084a8d7d989bdb9 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 10:39:58 +0530 Subject: [PATCH 28/37] Update README.md --- README.md | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 24fcaef..95bdbd3 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,23 @@ sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 ![launcher icon](http://i65.tinypic.com/25flje0.jpg) # WiCard - Share Your Attitude -[link](#introduction) - -## Introduction +1. [Introduction](#introduction) +2. [How it Works](#how-it-works) + 2.1 [Creating a new WiCard](#creating-a-new-wicard) + 2.2 [Viewing Created WiCards](#viewing-created-wicards) + 2.3 [Sending Your WiCard](#sending-your-wicard) + 2.4 [Receiving WiCards](#receiving-wicards) + 2.5 [Viewing Received WiCards](#viewing-received-wicards) +3. +## 1. Introduction With this application You can __Easily__ create your Virtual Name Card and Share them with your Business persons and others through the __WiFi__. - It can save your WiCard, Without Internet Connection and Share them Without Internet. - And Also Easily connect them with On Phone, SMS or Email. - You can save them in to your contacts not remembering them. No need to re enter like traditional Business Cards. -## How it Works +## 2. How it Works -### Creating a new WiCard +### 2.1 Creating a new WiCard You can simply click the __Create a WiCard__ button on main page or, __Create a WiCard__ on Drawer to enter the New WiCard Creation Wizard. @@ -25,7 +31,7 @@ Then You can enter your WiCard Details and Click __Save__ Button. It will be cre ![main page](http://i65.tinypic.com/282448o.jpg) -### Viewing Created WiCards +### 2.2 Viewing Created WiCards If you need to see or send or delete your WiCard. You Can easily click on the drawer and select __My WiCard__. Then You can see your created WiCards. @@ -41,7 +47,7 @@ Then Click on Delete. Then Click Yes. And It will be deleted your WiCard. -### Sending Your WiCard +### 2.3 Sending Your WiCard To Sending the WiCard. The Receiver also need to install WiCard App in his Mobile Phone. In the senders phone he can click and hold on the WiCard that he needs to send and select Send option. @@ -59,7 +65,7 @@ Then Wait until the status Changed to the __Receiver__. Now Click the send Button. -### Receiving WiCards. +### 2.4 Receiving WiCards. If you need to receive a WiCard from another person. Simply Click on __Receive WiCard__ Button on Home Screen or __Get a WiCard__ option on Drawer. Then you will be redirect to the Receiving Wizard. @@ -72,7 +78,7 @@ Then Wait for the other device discover you. Then Connected other Device will se Then You Can Save or Delete it clicking on the action buttons. -### Viewing Received WiCards +### 2.5 Viewing Received WiCards Clicking on the __Saved WiCards__ on the Drawer or Home Page. You can access the your received and saved WiCards. @@ -82,7 +88,7 @@ Then Click and holding on the WiCards you can get calls to the Numbers, Send Mes ![my wicards](http://i67.tinypic.com/vhutd.jpg) -## Error Handling +## 3. Error Handling + __If Recievers mode Device is still disconnected__ - Please simply click on the back button of your mobile and again click on the Get WiCard Option. @@ -90,20 +96,20 @@ Then Click and holding on the WiCards you can get calls to the Numbers, Send Mes + __If Automatically Not Turn on WiFi__ - Check Your permissions on Mobile Phone. Below the Android API 17 devices has some issues with WIFI connectivity. -## Tested Profile +## 4. Tested Profile + Android API Level 16 / 17 + 1GB Ram and 512MB Ram -## Used Libraries +## 5. Used Libraries All are the Google Standard Libraries Only no Third party libraries used. -## Used Services +## 6. Used Services All the services are Free and Open Source -## References +## 7. References + Official Android Doumentation + P Joby, Abby. (2016). Socket Programming WIFI Chat APP For Android Smartphone. 10.13140/RG.2.1.3692.2483. From 5f1d75a2bdf13c6e1d8a64526994de9459b50487 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 10:45:09 +0530 Subject: [PATCH 29/37] Update README.md --- README.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 95bdbd3..a178538 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,30 @@ sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 ![launcher icon](http://i65.tinypic.com/25flje0.jpg) # WiCard - Share Your Attitude -1. [Introduction](#introduction) -2. [How it Works](#how-it-works) - 2.1 [Creating a new WiCard](#creating-a-new-wicard) - 2.2 [Viewing Created WiCards](#viewing-created-wicards) - 2.3 [Sending Your WiCard](#sending-your-wicard) - 2.4 [Receiving WiCards](#receiving-wicards) - 2.5 [Viewing Received WiCards](#viewing-received-wicards) -3. +1. [Introduction](#1-introduction) +2. [How it Works](#2-how-it-works) + + 2.1 [Creating a new WiCard](#21-creating-a-new-wicard) + + 2.2 [Viewing Created WiCards](#22-viewing-created-wicards) + + 2.3 [Sending Your WiCard](#23-sending-your-wicard) + + 2.4 [Receiving WiCards](#24-receiving-wicards) + + 2.5 [Viewing Received WiCards](#25-viewing-received-wicards) + +3. [Error Handling](#3-error-handling) + +4. [Tested Profile](#4-tested-profile) + +5. [Used Libraries](#5-used-libraries) + +6. [Used Services](#6-used-services) + +7. [References](#7-references) + + ## 1. Introduction With this application You can __Easily__ create your Virtual Name Card and Share them with your Business persons and others through the __WiFi__. - It can save your WiCard, Without Internet Connection and Share them Without Internet. From 457dac99b8a330b170cf90e445e9b94df5da546b Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 20:16:55 +0530 Subject: [PATCH 30/37] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index a178538..d5a5219 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,15 @@ All are the Google Standard Libraries Only no Third party libraries used. All the services are Free and Open Source +## 7. Future Developments + ++ Develop the Application upto sending Photo ID Profile through the WIFI. ++ Share WiCard through the Internet. ++ Share WiCards to the Social Media. + ## 7. References + Official Android Doumentation + P Joby, Abby. (2016). Socket Programming WIFI Chat APP For Android Smartphone. 10.13140/RG.2.1.3692.2483. + + From 8dc689cd8a4ad653ea7447c6de42b4ba4ab0662d Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 20:20:41 +0530 Subject: [PATCH 31/37] Update README.md --- README.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d5a5219..d94cd83 100644 --- a/README.md +++ b/README.md @@ -4,28 +4,30 @@ sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 ![launcher icon](http://i65.tinypic.com/25flje0.jpg) # WiCard - Share Your Attitude -1. [Introduction](#1-introduction) -2. [How it Works](#2-how-it-works) +[1. Introduction](#1-introduction) +[2. How it Works](#2-how-it-works) - 2.1 [Creating a new WiCard](#21-creating-a-new-wicard) + [2.1 Creating a new WiCard](#21-creating-a-new-wicard) - 2.2 [Viewing Created WiCards](#22-viewing-created-wicards) + [2.2 Viewing Created WiCards](#22-viewing-created-wicards) - 2.3 [Sending Your WiCard](#23-sending-your-wicard) + [2.3 Sending Your WiCard](#23-sending-your-wicard) - 2.4 [Receiving WiCards](#24-receiving-wicards) + [2.4 Receiving WiCards](#24-receiving-wicards) - 2.5 [Viewing Received WiCards](#25-viewing-received-wicards) + [2.5 Viewing Received WiCards](#25-viewing-received-wicards) -3. [Error Handling](#3-error-handling) +[3. Error Handling](#3-error-handling) -4. [Tested Profile](#4-tested-profile) +[4. Tested Profile](#4-tested-profile) -5. [Used Libraries](#5-used-libraries) +[5. Used Libraries](#5-used-libraries) -6. [Used Services](#6-used-services) +[6. Used Services](#6-used-services) -7. [References](#7-references) +[7. Future Developments](#7-future-developments) + +[8. References](#8-references) ## 1. Introduction @@ -131,7 +133,7 @@ All the services are Free and Open Source + Share WiCard through the Internet. + Share WiCards to the Social Media. -## 7. References +## 8. References + Official Android Doumentation + P Joby, Abby. (2016). Socket Programming WIFI Chat APP For Android Smartphone. 10.13140/RG.2.1.3692.2483. From f4a757a6fd0eed56c6e4f1029291ae7ea68c0cb0 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 20:21:11 +0530 Subject: [PATCH 32/37] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d94cd83..23d2951 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 # WiCard - Share Your Attitude [1. Introduction](#1-introduction) + [2. How it Works](#2-how-it-works) [2.1 Creating a new WiCard](#21-creating-a-new-wicard) From 1043e98a9d008d41b487e59b37eb034c73525d62 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 20:23:35 +0530 Subject: [PATCH 33/37] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 23d2951..b19e86b 100644 --- a/README.md +++ b/README.md @@ -8,15 +8,15 @@ sandun.isuru@gmail.com | Sandun Isuru Niraj | IA7 [2. How it Works](#2-how-it-works) - [2.1 Creating a new WiCard](#21-creating-a-new-wicard) + [2.1 Creating a new WiCard](#21-creating-a-new-wicard) - [2.2 Viewing Created WiCards](#22-viewing-created-wicards) + [2.2 Viewing Created WiCards](#22-viewing-created-wicards) - [2.3 Sending Your WiCard](#23-sending-your-wicard) + [2.3 Sending Your WiCard](#23-sending-your-wicard) - [2.4 Receiving WiCards](#24-receiving-wicards) + [2.4 Receiving WiCards](#24-receiving-wicards) - [2.5 Viewing Received WiCards](#25-viewing-received-wicards) + [2.5 Viewing Received WiCards](#25-viewing-received-wicards) [3. Error Handling](#3-error-handling) From 75b3019d0fcf834dc7bf32808bbd4972908c422d Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 20:43:19 +0530 Subject: [PATCH 34/37] Edit WiCard Activity Added! --- .../wicard/EditMyWiCardActivity.java | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 app/src/main/java/me/morasquad/wicard/EditMyWiCardActivity.java diff --git a/app/src/main/java/me/morasquad/wicard/EditMyWiCardActivity.java b/app/src/main/java/me/morasquad/wicard/EditMyWiCardActivity.java new file mode 100644 index 0000000..c2f5c52 --- /dev/null +++ b/app/src/main/java/me/morasquad/wicard/EditMyWiCardActivity.java @@ -0,0 +1,85 @@ +package me.morasquad.wicard; + +import android.content.Intent; +import android.database.Cursor; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.MenuItem; +import android.widget.Button; +import android.widget.EditText; + +public class EditMyWiCardActivity extends AppCompatActivity { + + EditText email,address,mobileNo,fullName; + Button upadateBtn; + String intentEmail; + SqliteHelper sqliteHelper; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_edit_my_wi_card); + + email = (EditText) findViewById(R.id.email_edit); + address = (EditText) findViewById(R.id.address_edit); + mobileNo = (EditText) findViewById(R.id.mobileNumber_edit); + fullName = (EditText) findViewById(R.id.fullName_edit); + upadateBtn = (Button) findViewById(R.id.update_data); + + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayShowHomeEnabled(true); + getSupportActionBar().setTitle("WiCard : Edit My WiCard"); + + Intent intent = getIntent(); + intentEmail = intent.getStringExtra("email"); + + loadWiCard(); + + + } + + private void loadWiCard() { + sqliteHelper = new SqliteHelper(getApplicationContext()); + Cursor cursor = sqliteHelper.getUser(intentEmail); + if (cursor.getCount() != 0) { + cursor.moveToFirst(); + + String full_Name = cursor.getString(cursor.getColumnIndex("fullName")); + String emailAdrress = cursor.getString(cursor.getColumnIndex("email")); + String mobileNumber = cursor.getString(cursor.getColumnIndex("mobileNumber")); + String Address = cursor.getString(cursor.getColumnIndex("address")); + + fullName.setText(full_Name); + email.setText(emailAdrress); + mobileNo.setText(mobileNumber); + address.setText(Address); + if (!cursor.isClosed()) { + cursor.close(); + } + }else { + fullName.setText(""); + email.setText(""); + mobileNo.setText(""); + address.setText(""); + } + + } + + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + + if(id == android.R.id.home){ + SendUsertoMainActivity(); + } + return super.onOptionsItemSelected(item); + } + + private void SendUsertoMainActivity() { + + Intent home = new Intent(EditMyWiCardActivity.this, MainActivity.class); + home.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(home); + finish(); + + } +} From 24150ea9d3b18ccd77210078d5957f92d7704a3a Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 20:51:10 +0530 Subject: [PATCH 35/37] Edit WiCard Completed! --- .../wicard/EditMyWiCardActivity.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/app/src/main/java/me/morasquad/wicard/EditMyWiCardActivity.java b/app/src/main/java/me/morasquad/wicard/EditMyWiCardActivity.java index c2f5c52..56d1c86 100644 --- a/app/src/main/java/me/morasquad/wicard/EditMyWiCardActivity.java +++ b/app/src/main/java/me/morasquad/wicard/EditMyWiCardActivity.java @@ -4,9 +4,12 @@ import android.database.Cursor; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.text.TextUtils; import android.view.MenuItem; +import android.view.View; import android.widget.Button; import android.widget.EditText; +import android.widget.Toast; public class EditMyWiCardActivity extends AppCompatActivity { @@ -35,6 +38,35 @@ protected void onCreate(Bundle savedInstanceState) { loadWiCard(); + upadateBtn.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + String full_Name = fullName.getText().toString(); + String emailAdrress = email.getText().toString(); + String mobileNumber = mobileNo.getText().toString(); + String Address = address.getText().toString(); + + if(TextUtils.isEmpty(full_Name)){ + Toast.makeText(EditMyWiCardActivity.this, "You Need to Enter Full Name", Toast.LENGTH_SHORT).show(); + }else if(TextUtils.isEmpty(emailAdrress)){ + Toast.makeText(EditMyWiCardActivity.this, "You Need to Enter Email Address", Toast.LENGTH_SHORT).show(); + }else { + + boolean result = sqliteHelper.saveWiCard(emailAdrress, Address, mobileNumber, full_Name); + + if(result){ + Intent back = new Intent(EditMyWiCardActivity.this, ViewMyWiCardActivity.class); + back.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(back); + Toast.makeText(getApplicationContext(), "Your WiCard is Successfully Created!", Toast.LENGTH_SHORT).show(); + }else { + Toast.makeText(getApplicationContext(), "Failed Creating WiCard!", Toast.LENGTH_SHORT).show(); + + } + } + } + }); + } From fd097bcde5740446b2af5de0008ca3d4146f89f4 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 21:22:48 +0530 Subject: [PATCH 36/37] Create LICENSE --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..42653ef --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Sandun Isuru Niraj | CodeZilla 2018 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 2d00f397202c56cfc6721cb33a20596a076a6a98 Mon Sep 17 00:00:00 2001 From: Sandun Isuru Niraj Date: Thu, 24 May 2018 21:57:43 +0530 Subject: [PATCH 37/37] Final Commit! Thank You... --- .../me/morasquad/wicard/AboutActivity.java | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 app/src/main/java/me/morasquad/wicard/AboutActivity.java diff --git a/app/src/main/java/me/morasquad/wicard/AboutActivity.java b/app/src/main/java/me/morasquad/wicard/AboutActivity.java new file mode 100644 index 0000000..7407cde --- /dev/null +++ b/app/src/main/java/me/morasquad/wicard/AboutActivity.java @@ -0,0 +1,52 @@ +package me.morasquad.wicard; + +import android.content.Intent; +import android.net.Uri; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.MenuItem; +import android.view.View; +import android.widget.Button; + +public class AboutActivity extends AppCompatActivity { + + Button github; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_about); + + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setDisplayShowHomeEnabled(true); + getSupportActionBar().setTitle("WiCard : About"); + + github = (Button) findViewById(R.id.githubbtn); + + github.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/codezilla2018/WiCard")); + startActivity(browserIntent); + } + }); + } + + public boolean onOptionsItemSelected(MenuItem item) { + int id = item.getItemId(); + + if(id == android.R.id.home){ + SendUsertoMainActivity(); + } + return super.onOptionsItemSelected(item); + } + + private void SendUsertoMainActivity() { + + Intent home = new Intent(AboutActivity.this, MainActivity.class); + home.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + startActivity(home); + finish(); + + } +}