Since Android 4.1 Network service discovery (NSD) is available. However, how would one find an android device that exposes an NSD-Service from a computer or from some other device that does not run android. Building an android app as shown in the examples will find the other device just fine, however, one does not always have Android as a platform.
I am running UPnP discovery on my PC and the phone does not show up.
You can find my NSD-Service implemented here on github.
The Discovery app is simple from the android example.
The UPnP example is using Cling and is from their tutorial it finds my router and the windows media player so I assume it works.
It may be that the issue is based on a mismatch of service discovery protocols, I relay am confused as to the differences between NSD, UPnP, Bonjour, Zeroconf and all the other possibilities...
The protocol you are after is http://www.dns-sd.org/ - DNS Service Discovery (DNS-SD)
That seems to be the only protocolType in the current Android framework.
Related
I'm completely clueless on how to use BLE. I need to create an application for Android devices that sends a small string from one Android device to the other. I am NOT using any sensor type devices. I only need to send a string from one phone to another phone using a BLE connection. From what I understand, I need to create a custom service and implement a GATT server on a central device and have a peripheral device access it as a client but I'm not even sure if that's what I need for my situation. I have scoured the internet and nothing I have found deals with this topic specifically. I have no idea how to create a GATT server for this purpose and what I need to include in order to create a service. Can someone please explain to me what I need to do or point me towards some resources that are useful for A COMPLETE NOVICE? Thanks.
You are right so far. You need to create two applications on two different Android devices as follows:-
Android App A on Device #1: An app to act as a GATT Server to host your data that you want to send. For that, you will need GATT Server API.
Android App B on Device #2: An app to act as a GATT Client to connect to Device #1 and read the string data from the GATT Server using GATT Client API.
BLE is a relatively complex technology but luckily there are so many resources to help you get started. I recommend that you first understand how BLE technology works and for that I the following links are useful:-
Introduction to BLE Video Series
The Basics of Bluetooth Low Energy
Introduction to BLE GATT
Getting Started with Bluetooth Low Energy
Getting Started with BLE GATT
Once you have a better understanding of the protocol, the following links are useful for understanding Android BLE development (in addition to the video posted in the comment):-
The Ultimate Guide to Android Bluetooth Low Energy
Getting Started with Bluetooth Low Energy in Android
How to use Android BLE to Communicate between Devices (With Examples)
However, before going through any of these, it's always a good idea to get a feel and practical understanding of how the technology works. For that I recommend using the nRF Connect Android app to connect and read data off devices. This way, you'll be able to relate to the new information and hopefully understand the new concepts easier.
Since my app runs on the emulator and crashes on my device. I would like to see log report of my app directly from the device. So that it might lead to better way of debugging. But I have following problems
My device is connected to the PC via LAN.
My device doesn't have USB connection (no slave port).
I am using android studio as IDE. I have seen couple of examples which could be used if the device is connected to same wifi network like Debugging over wifi network but this doesn't help.
There is an official documentation with wifi official documentation for wifi still it needs USB connection in step 3.
Does Android Studio provide any type of solution?
if your app is firebase configured maybe you can use DebugView from firebase site.
To get the crash reports from any android device you can use crashlytics..
This is very nice library which provides you very details logs of crash along with many other details like android device name, ram size, memory, orientation etc..
Good thing is that this crashlytics was different library previously, which is now part of Firebase .
To get started you can know about crashlytics from here you can follow the documentation from here
Actually, firebase helps you get the crashlytics. The error message will be stated in the dashboard once the app crashes. This is a life saver but I found out that, we can simply connect the device to IDE without USB. Just the PC and your device should be connected via LAN
Using ADB tool. Run the adb.exe file as admin. Connect using tcp. Just address and Port is necessary.
You can simply debug from the IDE, In my case android studio.
How i can make my own push notification server for my android & ios application?
m not wanna to use GCM.
GCM and APN are the client side part of the infrastructure. You should still set up your own messaging server. That event-based server will then push messages to the clients via the proprietary infrastructure. I think applications should be respectful of their enironment, and using the push facilities of the platform is indeed a good thing for your users. Also, it should be even easier for you to implement, thanks to the standard setup and the working documentation.
Otherwise, just pick your favourite message queue middleware (Active, Zero, you name it) and integrate it directly with the native client for the supported platforms, without using GCM (or Apple push). But be warned that this will make your application less efficient, and you may face higher development costs to set up the background notification service.
Node.JS provide a module called SOCKET.IO. I use this in my android apps for live messaging. You can configure it on AWS, Digitalocean Or you can use Heroku.
Here is the good example of Socket.io with android http://nkzawa.tumblr.com/post/46850605422/connecting-to-a-socketio-server-from-android
Android chat app wit socketio
https://github.com/nkzawa/socket.io-android-chat
I have an old android phone (2.2) and I need to use it to transfer a (.tok) file to Basic Stamp micro RS232 using a USB-Serial converter in between. So bluetooth is out of question. My only option is to write to the USB port of my android and make the BS2 micro receive it.
I`ve never programmed Android so need some guidance as to how I do this, specially when my api level is 8. I need a simple program that reads a downloaded (from the processing local linux PC) file from sdcard and then send it to USB port without any processing. That file is then received by the RS232 port of bot.
Android 2.2 API does not have USB host capabilities.
Host capabilities was not made available until Android 3.1.
This means you can't write an android program on your v2.2 phone that will control the USB communication.
I'm also guessing that even if you did update your OS, the phone doesn't have a USB-A port necessary to power the bus.
no need "usb host", work an older android devices like 2.2 http://code.google.com/p/android-serialport-api/
I have a have been doing my research on a program in which an android application makes a communication with a Desktop computer through a USB connection. I did find out that Android 3.1 allows USB communication, but I have no idea how to proceed on it. I'd be very helpful if someone could tell me how this is done.
Thanks
Nik
You can use this API.
Accessory Development Kit
More detailed information can be had from this link as well.
Android apps, communicating with a device plugged in the USB port
I am not sure you can test this using an emulator.So develop an application and deploy it in a real device and connect that device to your PC via USB port for testing.