BREAL
  • Home
  • Project
  • About Me
  • Blog
  • Contact
  • Home
  • Project
  • About Me
  • Blog
  • Contact
Search

More great news!

4/18/2019

0 Comments

 
Today I got my form to manipulate my phone to answer a call and make a call! The only issue is getting the audio stream from the phone to the form. Right now you have to pick up the physical phone to talk into it and hear audio. This is fine for the user if the phone is right next them. It's not a part of the general requirements, but I want to get that audio stream on the computer for the best user experience! I'll update you this weekend with my progress!!! Extremely excited to make this an amazing app with great user experience.
0 Comments

So good news?

4/15/2019

0 Comments

 
I created a small test program to act as a client and connect to a phone acting as a server in order to dial numbers and make calls. The good news is that it worked!!!! But the bad news is that it doesn't work with my android phone... it works with my iPhone. I'm looking into possible solutions, but at least I got a number to dial!
0 Comments

I FINALLY DID IT

4/8/2019

0 Comments

 
Okay, I'm sorry for the obnoxious title. I can't help but be excited because I have finally connected my android app to my windows form via bluetooth. Below I'm going to go into an extensive explanation of how bluetooth connections work for an android applications to give you a better understanding of how I did everything. Okay here we go.

Bluetooth overview

The Android platform provides support for bluetooth network stack, which allows a device to wirelessly exchange data with other bluetooth devices.

Using bluetooth APIs in an Android application can do the following:
  • Scan for other Bluetooth devices
  • Query the local Bluetooth adapter for paired Bluetooth devices
  • Establish RFCOMM channels
  • Connect to other devices through service discovery
  • Transfer data to and from other devices
  • Manage multiple connections
I'm going to skip over all of the boring stuff on how to scan for local devices and get to how I actually established a connection and how I will transfer data.

Connecting devices

One implementation technique is to prepare each device as a server so that each device has a socket open and listening for connections. If you were to do this then either device can initiate a connection with the other and become the client. Another way would be to host a connection and open a server socket on demand while the other device initiates a connection. (I prepared both devices as servers.
​

Connect as a server

When you want to connect two devices, you must make a device act as a server by holding a BluetoothServerSocket open. The purpose of this server socket is to listen for incoming connection requests and provide a BluetoothSocket after a request is accepted. When the BluetoothSocket is acquired by the BluetoothServerSocket, the server socket must be discarded unless you want more than one device connected.

Here is some sample code of what that looks like: 
Picture

Connect as a client

To initiate a connection with a remote device that is accepting connections on an open server socket, you obtain a BluetoothDevice object that represents a device. You then use the BluetoothDevice to acquire a BluetoothSocket and initiate a connection.

Here is how that generally looks:
Picture

Manage a connection

After a connection has been established between devices, each device has a connected BluetoothSocket. This is where all the magic happens because you get to share information between the devices. I won't give code for this example because there is a lot of it. But by using the BluetoothSocket, the general procedure to transfer data looks like this:
  1. Get the InputStream and OutputStream that handle transmissions through the socket by using getInputStream() and getOutputStream().
  2. Read and write the data to the streams using read(byte[]) and write(byte[]).
There are different implementation details to consider, like using a dedicated thread for reading from the stream and writing to it. I'll spare you from the other details on here.

That's a crash course in connections and how to manage them using JAVA. The next step for me is transfering calls via Input/Output streams.

That's all I got for now!

Signing off,
​Bryan
0 Comments

Finally an update

4/3/2019

0 Comments

 
I have finally gotten a phone with a high enough API level to test bluetooth connections. No luck actually connecting my devices. I think it has to do with the sockets I'm trying to create, or the bluetooth on my computer. I'm going to email Dr. Pankratz to ask him if he has any bluetooth connectors I can use. I'm very very close to finally having a connection and making calls.
0 Comments

Week 7

3/12/2019

0 Comments

 
I made a lot of progress this week. My application can now act as a "slave/server" which means I can send a bluetooth signal out to other bluetooth devices. All I need now is an android phone so I can set up a class to make a real connection. The class on the phone will also help redirect calls to my windows form. Below is a screenshot of what the UI for connecting to a device looks like. By clicking the "Go!!!" button, it sends a bluetooth signal to other devices. Below my code behind the bluetooth signal can also be found.
Picture
Picture
Picture
0 Comments

Week 6

3/5/2019

0 Comments

 
Not much has gotten done in terms of connecting two devices since other responsibilities took over. I've been doing a lot of research recently in terms of connecting my windows form application to a phone and have only found documentation via bluetooth. I believe that bluetooth is the path I'm going to take in regards to connecting a device to my application. I'm currently writing this blog post in week 7 of the project and I believe I have figured out how to connect my windows form application to my phone via bluetooth. Stay tuned to the next update to see if I made the connection.
0 Comments

Week 5

2/24/2019

0 Comments

 
Finally have a basic UI designed. I'm not happy with how it looks aesthetically, but it works. I'll continue to make the template look better as time goes on but for now it will have to do. Week 6 will consist of trying to get a connection between my windows form application and a phone. I'm conflicted on pursuing a few different routes. I realized that connecting a phone to my application via router is not possible due to constraints for mobile devices. To elaborate, smart phones lack session initiation protocol (SIP). SIP is used as a communication protocol that is meant for managing communication sessions such as video and voice calls. Smart phones don't have the capability to use sip, so I could end up using a non mobile device like a shoretel phone. I'll have to meet with either Dr. Pankratz or Dr. McVey to discuss the possibility of using a non mobile device. With that being said I have done some research on bluetooth connectivity. From what I gather bluetooth can be done and it is a possibility that I go that route. Another idea I had was connecting a mobile device via lightning cable. That would require using an iPhone, but lightning cables can transmit voice and sound.
0 Comments

Week 4

2/17/2019

0 Comments

 
So after some discussion with my professors I decided to take a different route on the project. I'll be making a windows form in C# with the intent of connecting a windows surface to a phone. I'm currently putting the final touches on the UI and will begin research on how to communicate between my windows form and a cellular device.
0 Comments

Week 3

2/7/2019

0 Comments

 
Here we are in week 3. A lot of research has been done and my environment is set up and ready to be coded in! But wait... I met with Dr. Pankratz and we discussed the possibility of not having it be an app for a mobile device. I'm currently on hold and waiting to decide whether I want to put the app on a phone, tablet, or the computer. I'll try and sway him to let me use an android device whether it is a tablet or a smartphone. 
0 Comments

Week 1 & 2

2/3/2019

0 Comments

 
Well here we are the first two weeks of the big project. Nothing has really been done except for finally choosing a platform in which to write my app in. I've decided to make it an android application. I have to decide on a compiler to use. I'm leaning toward android studio, but i'm also looking into visual studio as well. In week 3 I hope to get a lot more done on this project and get a great foundation for it!
0 Comments

    Archives

    April 2019
    March 2019
    February 2019

    Categories

    All

    RSS Feed

Create a free web site with Weebly
  • Home
  • Project
  • About Me
  • Blog
  • Contact