Content Provider for Network Storage - android-contentprovider

With most Android devices, mounting CIFS or NFS is only possible when the devices is rooted.
The question is, if it is possible to create a Android Content Provider which offers Pictures and Videos from the Network Storage (Samba) with the URIs as the internal storage does (i.e. MediaStore.Images.Thumbnails.EXTERNAL_CONTENT_URI which is usually used for SD Cards).
Couldn't find any solution to this topic - maybe I've overseen a show stopper?!
Thanks for your opinion.

Yes, most existing file manager are doing it through local http. They open the stream of interest, then listen for a http connection on a specific port to feed it with that stream.

Related

How to securely upload a file (csv) file through an iPhone app into a secure storage space? (xcode, secure)

Thanks for reading this.
I've been searching for an easy way to upload a csv file generated in the users iPhone app to a secure storage drive.
For a research project, we are looking to ask participants to answer a couple of questions that will be compiled into a csv file.
All those files need to be uploaded anonymised to one secure storage location for further processing of the results.
I have looked into Google Drive (didn't work for iOS), Softlayer Object Storage but there doesn't seem to be an easy out of the box solution.
I have been jumping through customer support for two weeks.
In an ideal world:
CSV file created in the iPhone app
User agrees to share the file
CSV file uploaded through the iPhone app into a secure storage
Ideal solution:
HIIPA complaint or secure solution
ready wrappers for implementing in xCode
Half a day of work max
Thanks again,
Best,
Joseph
maybe this can help you:
http://blog.softlayer.com/2014/softlayer-security-questions-and-answers
"5: How is my data kept private? How can I confirm that SoftLayer can’t read my confidential data?
A: This question is common customers who deal with sensitive workloads such as HIPAA-protected documentation, employee records, case files, and so on.
SoftLayer customers are encouraged to deploy a gateway device (e.g. Vyatta appliance) on which they can configure encryption protocols. Because the gateway device is the first hop into SoftLayer’s network, it provides an encrypted tunnel to traverse the VLANs that reside on SoftLayer. When securing compute and storage resources, customers can deploy single tenant dedicated storage devices to establish isolated workloads, and they can even encrypt their hard drives from the OS level to protect data at rest. Encrypting the hard drive helps safeguard data even if SoftLayer were to replace a drive or something similar."
It seems that you will need to create your server to store your data and deploy a gateway device as well.
In another hand about object storage I did not find any information if it supports HIIPA, but as the softlayer object storage is based on Open Stack I think that if Open Stack supports HIIPA Softlayer's object storage should support it as well. Just in case here some documentation about how to work with object storage using REST:
https://sldn.softlayer.com/blog/waelriac/managing-softlayer-object-storage-through-rest-apis
Regards
We finally settled of Google Firebase iOS SDK. The Firebase Storage function is fantastic.
It was very easy to integrate and the support was excellent.
We used a file upload function to the firebase storage.
Highly recommended!

Building iOS Native App using WebRTC

I'm searching for 4 days, but can't get it. I built all libraries and integrated it in my custom project, but I don't know what steps should I do to make it work. The only thing that i found with code example\explanation is tech.appear.in/2015/05/25/Getting-started-with-WebRTC-on-iOS , but it is poor and unclear for me, AppRTCDemo source code too. I read about WebRTC for browsers but still can't reproduce it on iOS.
Can anybody explain or provide links to explanation on how to completely build iOS native app using WebRTC API for example p2p ios chat?
Besides the fact that I do not understand code logic provided in demo, I can't understand:
1) What is ICE servers for my iOS app? Should I take care of it? Is it something server side? Should I code and run it myself, or I can use existing Parse background?
2) What is signaling mechanism in iOS app? Is it client side only, or it must be implemented on server side too?
3) And maybe someone can explain step-by-step guide, maybe with some code, how to implement simple iOS p2p chat using WebRTC? For example:
"You have to:
Create ICE/STUN/TURN server on parse core using this =source= and this tutorial =tutorial=.
Create RTCPeerConnection using created ICEServer:
RTCPeerConnectionFactory *pcFactory = [[RTCPeerConnectionFactory alloc] init];
RTCPeerConnection *peerConnection = [pcFactory peerConnectionWithICEServers:kICEServerURL constraints:nil delegate:self];
Create DataChannel using ...
Send signal using ... explained here =link=
Set local and remote descriptions ...
Send Data ... using ...
... " or something similar.
I'm sorry for asking this, but I'm losing my mind trying to figure it out. Thank you!
I am not an expert in webrtc but i will try to explain some of your questions.
1.ICE servers-- NATs and firewalls impose significant problem in setting up IP endpoints. so IETF standards STUN, TURN and ICE were developed to address the NAT traversal problem.
STUN helps connect IP end-points:
discover whether they are behind a NAT/firewall, and if so,
to determine the public IP address and type of the firewall. STUN then uses this information to assist in establishing peer-to-peer IP connectivity.
TURN, which stands for Traversal Using Relay NAT, provides a fallback NAT traversal technique using a media relay server to facilitate media transport between end-points.
ICE is a framework that leverages both STUN and TURN to provide reliable IP set-up and media transport, through a SIP offer/answer model for end-points to exchange multiple candidate IP addresses and ports (such as private addresses and TURN server addresses).
2.Signaling is the process of coordinating communication. This signalling part needs to be implemented by you according to your needs(for ex. if you have sip structure in place then you will have to implement sip signalling). In order for a WebRTC application to set up a 'call', its clients need to exchange information:
Session control messages used to open or close communication.
Error messages.
Media metadata such as codecs and codec settings, bandwidth and media types.
Key data, used to establish secure connections.
Network data, such as a host's IP address and port as seen by the outside world.
Steps
for offerer:
first create the peer connection and pass the ice candidates into it
as parameters.
set event handlers for three events:
onicecandidate-- onicecandidate returns locally generated ICE candidates so you can pass them over other peer(s) i.e. list of ice candidates that are returned by STUN/TURN servers; these ice candidates contains your public ipv4/ipv6 addresses as well as UDP random addresses
onaddstream--onaddstream returns remote stream (microphone and camera of your friend!).
addStream` attaches your local microphone and camera for other peer.
Now create SDP offer by calling setLocalDescription function and set remote SDP by calling setRemoteDescription.
For Answerer:
setRemoteDescription
createAnswer
setLocalDescription
oniceCandidate--On getting locally generated ICE
addiceCandidate--On getting ICE sent by other peer
onaddstream--for remote stream to add
I hope this will make some of your doubts clear.
I came through the process of implementing it few month ago. What I've found was the library was not stable - sometimes it was working sometimes not.
Additionally my iPhone was always becoming hot when I was using it.
I would not suggest using this library and overall WebRTC technology for commercial projects.
This is my implementation, which was working few months ago:
https://github.com/aolszak/WebRTC-iOS
Good luck!

can we connect storage server to application server as an external hard disk

I am new to storage domain .can Some one please help me in understanding the below things
Can a storage sever be connected to Application server?
1.How storage servers are different from applications servers
2.Can multiple application servers connect to storage serves over the network
3.what kind of files will be served by NAS and SAN severs
Firstly this question belongs on server-fault stack exchange still it is a good conceptual question...
So the answers are~~
Yes storage servers can connect to application server (app servers are in fact software frameworks or specific portion of a server program implementation). Application servers communicate with storage server to store / retrieve / process data.
Apart from high disk space, what else is different about storage servers you may ask ? In many cases, they come with a host of specialized services. This can include storage management software, extra hardware for higher resilience, a range of RAID (redundant array of independent disks) configurations and extra network connections to enable more users to be desktops to be connected to it.
Where as, application server is a software program that handles all application operations between users and an organization's backend business applications or databases. An application server is typically used for complex transaction-based applications. To support high-end needs, an application server has to have built-in redundancy, monitor for high-availability, high-performance distributed application services and support for complex database access. For mobile computing, mobile app server is mobile middleware that makes back-end systems accessible to mobile applications to support Mobile application development. Frankly speaking, application servers lie in the territory between database servers and the end user, and they often connect the two.
Multiple application servers CAN and in reality DOES connect to storage serves over the network or even directly. but for concurrent access to data there must be guaranteed reliability of data between transactions. Something like ACID properties.
Cming to the third one, NAS, it turns out, is NOT really storage networking. Actual network-attached storage would be storage attached to a storage-area network (SAN). NAS, on the other hand, is just a specialized server attached to a local-area network. All it does is make its files available to users and applications connected to that NAS box — much the same as a storage server. To further conceptualize the difference between a NAS and a SAN, NAS appears to the client OS (operating system) as a file server (the client can map network drives to shares on that server) whereas a disk available through a SAN still appears to the client OS as a disk, visible in disk and volume management utilities (along with client's local disks), and available to be formatted with a file system and mounted.

Azure IoT Communication

I have an embedded device that can be controlled by JSON over UDP. I am currently performing this via an iOS App, and everything works great.
I am now wanting to be able to also control my device from a remote location. And am wanting to use Azure to perform this task. I envision that I will set up an Azure Website which will enable me to select options which then send the JSON to my device, which is behind a firewall.
My question is which of the Azure Services should I be looking into? Also, what is the best way to get the JSON packet to the device behind the firewall (I do not want to use port forwarding).
In general, to avoid an attack surface from outside your LAN (where you have your embedded device), the better solution is to open and output connection from embedded device to the cloud and to leave it open so that it can send and receive data/command.
In this case, on Azure you can use the Service Bus (queue, topic/subscription or event hub) to send/receive with AMQP protocol but it is strictly related to your device and capabilities.
Can you share more information on it ? How much it is a constrained device or a more power device with an high level OS (Linux, Windows, ...) ?
Paolo Patierno
About using Amqp on devices running android is very tedious. The java implementation in dalvik is missing a lot of required apis to be there.
By the way, do you know where we can find information about related path segments to use in amqp pure syntax in Azure, to interact with IoT-Hub end-points. Like for queue for example, we can have :
amqps://:#.servicebus.windows.net/
Thanks

UDP file transferring in Delphi

I am writing a program to transfer files through a lan computers, it's been a while I'm searching for file transferring methods in Delphi. I found UDP is a good solution, but there is a problem: in every example or article I found there was a client program beside a server program, but my program have to send and receive to/from every computer in network, there is no specific server or client, something like p2p, I don't want to make a computer Server and another one Client, what should I do? I searched Indy articles too, it's working in Server/Client mode too (as far as I found).
UDP can work in broadcast mode, which is what you need. But such UDP broadcasts are not routable outside the current network (i.e. they are blocked by routers), so you have to implement something more complex if your project needs to be accessible outside the primary physical network.
Do not reinvent the wheel! If you want to see some working source implementing this concept, see Ares Galaxy:
"Delphi self-organizing p2p network project featuring high scale
capability and fast broadcast-type search system. Client supports
multi-source file transfers, partial file sharing, built-in
audio/video player and decentralized chat rooms".
The source code files are available from SourceForge. You could re-use/adapt the P2P network layer for your needs - but take attention to the license terms of Ares source code, if you use it in your projects.
Have a look at Indy's TIdTrivialFTP and TIdTrivialFTPServer components. TFTP is a UDP-based file transfer protocol.

Resources