Page 1 of 1

Smart Lock

Posted: Mon Mar 28, 2016 5:32 pm
by tomlepham2010
Hello I am very new to programming with a pi. My goal is to create a smart lock door and control it with an android app through a raspberry pi 3 and the wifi. There will be lots of different functionality in the design, nfc access, wifi access, camera control and picture/video database and we are are still brainstorming more features.

I am beginning to write the app using Android Studio, which is written in Java on a Mac, and I want to figure out the best way to control the raspberry with the app. The research I have came up with is setting up a web server on the pi, and then using the server to control it. Meaning I would have buttons and other functionality within the app linked to a web address that is linked to the pi.

Let me know what you think, and if you have any advice. Thanks.

Re: Smart Lock

Posted: Tue Mar 29, 2016 9:11 am
by topguy
If you are using a web-server on the Pi, why not just make a web-page and skip (or postpone) the whole Android part for now.

It depends a bit on which parts you want to start with, but it seems you have a lot of Raspberry Pi things to do (and learn) so why muck about with android phones.

Alternatives to making a pure web-server (and probably PHP) is to use something like node-red ( Javascript ) or look into MQTT as possible way of communicating between phone and RPi.

Re: Smart Lock

Posted: Tue Mar 29, 2016 5:31 pm
by tomlepham2010
Yeah I guess I was looking for alternatives of communicating both the hardware and the phone. Yes I saw something about skipping the app and just writing a webpage but I really would like to make a app, also this will be my first app. I see it as an opportunity to improve my programming skills which I needed. Up for the challenge.

Will definitely look into nodes and open to different approaches. I am just researching at this point. Since I am using android studio for my app which is written in Java and I believe the raspberry pi 3 comes with python, will this cause problems? I understand most projects will require multiple types of languages interacting with one another for the different functionalities desired but is there recommended or avoid preferences?

For the app activity interface I want to start out with a unlock toggle button, a notification log and custom alerts, a camera database of snapshots, and creating some sort of cloud storage. Thoughts?

Re: Smart Lock

Posted: Wed Mar 30, 2016 1:06 pm
by topguy
The solution to deal with different architectures and languages is to use protocols that is well supported in different languages.
So using HTTP and/or Websockets or MQTT should be mostly language independent.

But Raspberry Pi comes with a whole lot of programming languages already installed, you are not limited to Python in any way.