What options exist to update Android app setting remotely? - android

I have an Android device that I'm using to monitor a couple of sensors with an app that I created. What useful ways are there to update the settings in my app (while it's running at a remote location) from my computer? I'm interested in sending a message to my app to tell it to email a screenshot, change sample rate, etc. Creative workarounds are encouraged.
I've already looked into C2DM and unfortunately have no experience with setting up the required third-party application server.

[EDIT] It just occurred to me that I may have grossly over simplified what you were trying to do. If this is the case my answer probably wont be of much if any help to you. The original answer follows though.
You could use TCP sockets to set up a client/server interface between your app and a command program on your computer. Then just send a set of predefined messages/commands. Two tutorials I used for learning this are Here and Here. This wont help with the computer side of the sockets code per se although if you write the computer program in Java it should effectively be the same. This is something we are doing at my company to create a custom command interface for a product we have in development.

Related

Is the API for exercise machines (like NordicTrack iFit) open? Can I write an app to control my bluetooth-enabled machine?

I've written standalone apps that construct workouts that I can build to vary time, resistance, etc., but they don't communicate with a dedicated exercise machine. I recently bought a NordicTrack elliptical machine which uses their iFit framework (using their iFit Bluetooth app) to control the machine's resistance and incline. Is this an open Bluetooth-accessible API that I can access to have my app connect to the machine and manipulate the resistance and incline myself? Anyone?
It's not open because the companies (ProForm, NordicTrack) want to earn extra money besides the one time purchase price through constantly flowing subscription money via the iFit service. They need to somehow make it an exclusive option to use iFit, otherwise they'd lose another cash cow, I'd even say maybe the constant subscription flow is more important than the MSRP.
On fitness forums (like slowtwitch forum https://forum.slowtwitch.com/forum/Slowtwitch_Forums_C1/Triathlon_Forum_F1/Treadmill_iFit_%22hack%22_/_tweak_P6851409/) people were figuring out how to get into admin mode and access the Android tablet as it is. Lately Nordictrack moved and tries to block the users from accessing privileged mode condescendingly in the name of safety: https://www.extremetech.com/extreme/329275-owners-resort-to-hacking-smart-treadmills-after-nordictrack-locks-them-out. This is similar what Peloton pulled: https://www.makeuseof.com/peloton-treadmills-lose-free-just-run/
However when communication happens with apps there always be a possibility to reverse engineer protocols, although that's tedious and sometimes result in fragile code, and condescending companies could always push updates which intentionally interfere with hack solutions.
According to forums the https://github.com/belden/iFitController web protocol based solution (mentioned by #papahouss, I found another repo which exists) only works with 2017 and earlier devices. The later models switched to Bluetooth (it sounds like you have such machine) so the HTTP project won't work for you most probably.
There are a few projects trying to integrate iFit devices with Zwift, and some other extra projects. This one particularly looks very promising, but I haven't got to study it in details yet: https://github.com/dawsontoth/zwifit/blob/master/src/ble/ifit/_request.js
Maybe you should have a look at this project : https://github.com/jamesdotcuff/iFitController
You can communicate with the machine via websock. It works for treadmill but not too sure about elliptical machine.
Good luck

Android - Porting C++ Socket Server to Android?

I'm newbie to Android development, but I am linux c/c++ background guy.
Now, I have linux c++ network proxy program, which is TCP Server and Client written in boost library. The function of this proxy program is
TCP server will receive Android app's request, and translate that
request to some specific format
then behave as client to send out translated thing to correct remote computer (like router)
My task is to porting this program on Android system. And hope the Android native application communicates with this proxy program through socket like in Linux.
I search the web, try to find the proper way to do this. But, it seems that most of existing things I found are java JNI library based solution.
I wonder if this could be done in daemon or service process way. The proxy program is a bit large, so, re-write is a real pain for me.
Any suggestion or solution would be highly appreciated. Thanks advance!
Jeff
Unless we are talking about rooted devices, there is no way around on having to deal with Java on Android, at some level in the stack.
You can wrap your code in a Native Activity, which basically means an existing Android Java class that knows how to load a set of predefined public symbols from an .so file.
https://developer.android.com/reference/android/app/NativeActivity
https://developer.android.com/ndk/guides/stable_apis#native-application-apis
The problem here would be when to launch the said activity, as there is no guarantee to keep it running.
Android doesn't have daemons on the UNIX sense, only services.
So as alternative you could create an Android service class, however starting with version 8, there are execution restrictions. Meaning you cannot have it run forever on the background.
https://developer.android.com/guide/components/services
Possibly by using a bound service, which the applications would need to connect to before talking via sockets might do what you need.
https://developer.android.com/guide/components/bound-services

How to create SIP server for my android?

I am developing an Android application, in which I want to make a calls using internet using SIP in android. So I need to maintain my own SIP sever for my app users, how can I create my own SIP server?
I would not advise creating your our sip server as it would take a large number of man years of development and there are a lot of pitfalls.
There are some open source implementations that you could install and setup yourself. Like FreeSwitch or Asterisk. Both are large and complete to setup as there is a lot of domain knowledge required to understand how to set them up correctly.
There are also free server that you could try out as well like Sip2Sip.
Then there is the job of creating a sip client on Android. Again it's not that simple either. I would look at using a open source library here as well, like pjsip. This gives you the advantage of being able to look at examples of full sip clients already developed for Android like csipsimple. pjsip also has the advantage of being cross-platform, so you could reuse it in IOS for example.
Good luck.
The Server
As a communication server, choose for example sip:providerCE v2.6. The easiest way to get started with it is to download the VMware or Virtualbox image and fire it up on a suitable machine. If you get more serious, you want to install the system from scratch on a dedicated server with a public static IP. If you’re new to VoIP and SIP, do NOT try to install it on an Amazon EC2 instance, as they’re using destination NAT, which is a big pain for SIP and needs some experience with the SPCE to tweak it properly for that scenario.
Note that the SPCE is a 64bit system, so in order to run the VM images, you need to turn on 64bit CPU virtualization in your BIOS if VMware or Virtualbox warns you about it.
...There is very good tutorial HERE! on how to set things up.
...Don't forget there is a technical advise concerning SIP check the accepted ANS!
...Least but not last check THIS! VOIP Wiki, It covers everything related to VOIP.
SIP RFC is very easy protocol to implement. Just create a socket listener and implement RFC-3261. Start with with a basic codec GSM, then move up to A-LAW (G.711), as needed.
The tricky parts with SIP are (A) ensuring your call flows are correct (RFC-3665) and (B) media encoding/compresion. Use Asterisk (FreeSwitch) and WireShark to test your call flow. If you need DTMF support you'll need RFC-2833. If you need advanced codecs, consider using open-source library like FFMPEG.
I used uSIPserver on android. It works well and support video call. If you use client app which supports video then you can video call eachother on wifi.
It is so simple to use.
Good luck :-)

how to get sip2peer work in Android

I'm trying to use the sip2peer example from http://code.google.com/p/sip2peer, downloaded the android code, ran the example, nothing happens.
I read some questions and answers, it seems like I need to install server for this to work?
Sorry for the basic question, I'm stuck here.
I want to get the example working on my local machine and emulator
did you download the sip2peer tutorials (s2p-Tutorial.pdf, s2p-Tutorial-Android.pdf, s2p-Tutorial-Bootstrap-FullPeer-SBC.pdf) from http://code.google.com/p/sip2peer/downloads/list?
They describe the main framework concepts and a complete example with a Full Peer implementations. The example is based on a FullPeer and a Bootstrap node that allows to discover the initial peer list. The library has been designed to build p2p networks and generally distributed systems I suggest to test it using multiple Java Nodes to better understand the approach and the architecture and then include an Android node in your network.
Given that you were talking about an Android Emulator I would like to suggest to properly check emulator network interfaces (and its addressing) since you need to be able to contact other nodes on your local machine. I always use a real device to easily manage this problem.
Regards

how do I run torrents on android?

I am not aware of any application on android that is capable of downloading torrents. So in-case I would like to port an Ubuntu application like transmission or another similar light weight application would it be that easy. How much of socket programming would I actually require to do in such a case.
Also if anyone is aware of a project of this nature which is ongoing, I would love to have a look at it. I specifically intend to do this for android 1.6 and 1.5, so I think that makes any new API's which might have been released for this purpose pretty redundant.
dTor is a fairly new but very nice torrent client for Android devices. Despite its poor reviews on the Market, I have found it to be much better than all of the competitors. The developers are very active and there has been updates to it every week for the past month which have been making it much more stable.
You can check it out here: http://www.androlib.com/android.application.com-dtor-jwttw.aspx
Some programs exist under Androïd, but they usually only activate a remote bittorrent client from your computer for a specific file.
However I've heard of two real bittorrent clients projects, but didn't have a look at them :
aBTC : http://www.androlib.com/android.application.org-ale-abtc-qmzp.aspx
Marvin : helloandroid.com/apps/marvin-bittorrent-client
Well, such things exist:
http://www.androlib.com/android.application.org-ale-abtc-qmzp.aspx
http://www.androidzoom.com/android_applications/tools/andtorrent-bittorrent-client_fywo.html
EDIT: however, they are not for free...
To download a torrent application, download utorrent from playstore and torrentsearch app. Torrent search is like a search engine for torrent and when you get the file you want after searching just click on the file and it will automatically download on your utorrent/bittorrent app. This is a substitute for searching on the web browser

Categories

Resources