Is it possible to make mobile p2p app without a server? - flutter

What I want is to make a web/mobile app (I've chosen Flutter) that acts both as a host and as a client, so multiple instances of this app can share data without actual back-end (let's say the addresses of the devices are hardcoded into the app for the simplicity).
I can't use Firebase or Backendless, my app has to be the only host.
I've looked into socket.io, websockets, WebRTC and didn't find a solution.
So, is it even possible? With or without Flutter.

It is in theory possible, if you are planning to only use android you can use this library Flutter p2p which use wifi-direct (Android documentation) to discover devices and connect to them. It has some problems with newer environments but there is lots of forks from the git project that you can import. I've read that it should be possible to allow devices that doesn't support wifi-direct to connect if you create a group so maybe it could work for iOS if there is a hosting android device.

Related

USB connectivity in multiple platforms

I am trying to make a cross platform IoT device that uses USB Serial protocol (RS232). For that, I am using the native library that is only meant for Android along with serial (web library for supporting Mac, Linux and Windows).
I have created two separate files where the drivers work well with my device independently, but I don't want to keep the codebases separate. But when I combine them and use them, it won't compile for Android and Web saying that you cannot use html on flutter without web and cannot use a dependency for Flutter not meant for web.
Any clue on how to solve this? I'm using provider for state management and passing callbacks for the UI to access device data (might shift to Riverpod in the coming future).

How to exchange data and files between two devices by NFC using Flutter?

I am a flutter developer, I want to make an application to exchange messages and files by using NFC technique
I used nfc_in_flutter plugin for reading and writing NFC tags but I don't know how to send and receive data and files between devices by using NFC in flutter.
Could any one help me, please?
Generally you don't try and send data between 2 devices using NFC, there is a standard for it, but most devices don't support it (it has never been supported on iOS and Android has dropped support for it as it was unreliable)
Use Bluetooth or Wifi Direct instead.
Update:
If you have to use NFC then the nfc_in_flutter plugin is no use, you are going to have to call native code for each platform yourself / write your own plugin.
And for 2 iOS devices, then forget it, just not possible because of what the OS supports.
When one device is an Android there is a complicated method that some people have had some success with but it still has it's issue.
The Android device does Host Card Emulation (HCE) and pretends to be a really Type 4 NFC tag, then other devices can read/write to it as if it were a real Tag which both iOS and Android Support. BUT on older Android devices then the deprecated Android Beam might get in the way and you would need to use enableReaderMode to do the read/write on Android.
You will need to put in a lot of error handle in the read/write App as NFC comms is very slow and very prone to loosing the connection, so it would have to handle loosing the connection and restarting where it last successful read from/written to.
All these problems make this extremely difficult to achieve a workable solution and was the main reason Google removed Android Beam for Android to Android sharing (which does use a NFC peer to peer protocol)

Push notification mechanism used by other apps in Windows Phone

I want to know what push mechanism does gmail, facebook or other common apps use in Windows Phone? Are they using MPNS only or something else (like MQTT). For example, Facebook is available for all platforms so whether they are using different protocols for different platforms or using a common approach.
I want to implement push notification for my app. The same app is being developed for other platforms like Android and iPhone also. So I want to use a mechanism which can be used across platforms.
You can use Urban Airship, it provides support for Microsoft Windows Phone 8 and Windows 8 push through MPNS and WNS, but doesn't support MPNS push to Windows Phone 7 devices
Docs for .net http://docs.urbanairship.com/build/build_push.html#windows
Docs for iOS http://docs.urbanairship.com/build/build_push.html#ios
Docs for Android http://docs.urbanairship.com/build/build_push.html#android
Or Amazon SNS which requires more work
API for .net http://aws.amazon.com/sdkfornet/
API for iOS http://aws.amazon.com/sdkforios/
API for Android http://aws.amazon.com/sdkforandroid/
You should think of Push Notifications as a transport channel, not more. Each mobile platform (Apple, Google, Microsoft) uses it's own cloud to reach your device, and that's could be enough. Once reached, your mobbile app may do whatever it need (for example, to grab extra details about the notification as size of Push message is usually limited).
Given that in mind, it's not a big deal to create one server app communicating to 3 different clouds if sending notifications.

Phonegap for iphone development on Windows questino re native api

I've spent the day googling all the leads on developing iphone apps on Windows and apart from buying a mac the most suitable route seems to be Phonegap. I cannot find out whether Phonegap gives access to all the native functionality. For example I want to access and manipulate the address book contents. I also want to be able to send text messages programatically and intercept and examine incoming text messages. It would be helpful if someone could confirm whether this can be done with Phonegap.
My understanding is that Phonegap is based on webapps but I am assuming that an app developed with it can run offline for operations that dont require internet access.
Even using Phonegap you will still need access to a mac to actually build your iOS application. This is a restriction that Apple has in place, and to my knowledge there is no way around it.
Phonegap uses a UIWebView to display your application built using HTML, CSS, Javascript etc, but this does not mean that an Internet connection is required for the app to run (so offline apps are definitely possible).
With regards to Phonegap's functionality, details of the Phonegap API can be found on their website. Specific to your needs, I believe phonegap provides access to the device's address book through the contacts API:
http://docs.phonegap.com/en/2.3.0/cordova_contacts_contacts.md.html#Contacts
I don't think Phonegap provides the ability to send SMS messages itself, but many people have developed extensions to add extra functionality to their applications through plugins. The majority of Phonegap iOS plugins can found at the following GitHub repo. The plugin I think you require is the SMSComposer:
https://github.com/phonegap/phonegap-plugins/tree/master/iOS/SMSComposer

Phonegap: Can iPhone web app access/check for wifi connections

I have tried looking for some answers but could not get anything concrete from the other questions in here.
I am looking for an answer to these two questions:
Using PhoneGap, if I create an iPhone web app, can I use it as
plain web app (i.e. without using iTunes to deploy it)? Just via a
web url?
Using PhoneGap, can an iPhone web app check for wifi
connectivity? i.e. If wifi/3g is available, if wifi is available,
can it scan for ssids.
Thanks for any help in advance.
You can create host the web app on your own server (or local). Then it is accessible via web url. If you want to use it as a normal app (there are differences - phonegap uses few native plugins for better experience), then you must have a developer license from apple and then deploy it to your device. Otherwise you can only use the simulator. You can also use Safari + USB to debug your app using the browser.
It is possible but limited. Only certain functionalities are available. Check out the following plugin for cordova (phonegap):
cordova-plugin-wifi
Good luck!