Using TLS in Android - android

I'm developing an Android application that communicates with my device(ARM based device with bluetooth module) via bluetooth using TLS(TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256).
What I considered:
javax.net.ssl from Android. Problem is that ephemeral(ECDHE) encryption keys are starting from API 20 but I need API 11. I didn't find a way to add suite. It seems that this library is strongly related to android version. API versions and overview
Bouncycastle(spongycastle) I didn't find a way to use it without creating a socket. I need something like in/out streams so I could use it not with the network connection. Also I didn't find TLS/SSL at all.
Implementing everything by myself. I could take all algorithms from selected suite and implement protocol by myself but I don't know what I don't know and I'm afraid to screw up security. I don't know if it's a good practice to do such a thing(may be it's high level enough so it's not very dangerous to implement it by myself)
My question is: which libraries could you recommend for TLS? Is it a good way to implement the protocol(not algorithms) by myself?

Related

Android ParcelFileDescriptor.createPipe() for Froyo?

I have a need to use ParcelFileDescriptor.createPipe(), but I would still like to target API 8/Froyo. This function requires API 9/Gingerbread.
I have read that there are compatibility kits that allow newer API functions to be used on the older OS versions, but know nothing about them. Is that an option here?
If not, what would be the cleanest method for going about duplicating this functionality? I have considered using fromSocket() and making a simple network connection over the loopback interface, but that seems like more overhead than is needed, if there were a simpler way.
Any thoughts or advice would be much appreciated. I should also point out that I am using Monodroid, but a simple Java-based example that uses the Android API would be fine. I can translate it to C#.

how can we implement CAN Application Layer(CAL) protocol in iphone/android

I need to interface a device which is supporting CANBus ,So for communication with that I need to follow CAL,So can any one help that ho can I implement
CAN Application Layer(CAL) protocol in iphone/android .
Please help i am not getting any way to solve it
"I need to interface a device which is supporting CANBus ,So for
communication with that I need to follow CAL"
The second part of that statement doesn't follow necessarily from the first. There are plenty of devices and systems that communicate via a CAN bus that don't use a formal higher level application framework.
First, you need to be able to communicate with the can bus from your application. Your mentioning iphones suggests you'll be targeting consumer handsets, none of which will have a CAN interface. So you need to incorporate some adapter hardware (there are usb adapters, and android at least has usb hardware access baked into the SDK).
If you do then also need to communicate with components that implement a higher level application framework like CANopen on top of the CAN layer, your options are:
Get your hands on the specification from whatever group maintains
it, and implement it in your language and framework of choice. This is likely a substantial effort.
Purchase or find an open source implementation. If you purchase the source code for a C implementation, you can compile it into a shared library for your target architecture, and, using android as an example, write a native wrapper for that shared library using the Android NDK to expose it to your java code. If you could purchase the source code for a java implementation, you might be able to port it so that it works natively on android.
Then you need to glue the data layer together with the application layer, and this will likely be custom development no matter what.
You need the hardware to support it. I've found Gwentech's GT1026 to work well for can bus to android, but it only works on Android using USB.

controling network communication

I need to develop an Android application that sets up connection via WiFi with computer and then sends packets with data. Jowever, I need to control send packets, not only theirs data but also headers, there should be possible to modify any field in their header as well. In windows in it is possible with use of winpcap and jpcap, and I wonder if sth similar I may find on Android. Is there any ready API that will help with my problem?
There's no API available to a Java/Dalvik app on Android which would allow you to do that.
Android is a Linux system, though. So you could try to find/write one or two Linux applications to support your effort - or use JNI.
Bottomline: Native code will definitely be necessary to achieve what you want, no way to do this in Java alone.

SipManager.isApiSupported() and SipManager.isVoipSupported() returning false

Is there any configuration to enable VOIP on device? Or these methods really show that my device does not support VOIP?
I think this is a little late to answer, but after a lot of searching, I reached the fact that you are supposed to use any SipStack, because as explained here:
Fusion SIP source code is specifically designed for use in embedded
devices, has a small footprint and is completely ROMable and
re-entrant. The Fusion SIP stack provides a simplified API for easy
integration with the application and transport stack (TCP/IP/UDP).
and when talking about android specifically, as explained in the answer of this question:
All Android devices, which can connect to the Internet, support SIP.
After all SIP is just a protocol which requires connection to the
Internet, and it's very similar to HTTP.
In order to work with SIP, you need SIPStack implementation - doesn't
matter if it's 3rd party or it comes from Android API.
and about examples of SipStacks that can be used, you will find a punch of them like PJSIP and Doubango, and all exists in this question.

How does android.net.sip bypass firewalls?

I'm planning to implement a simple VOIP feature, using the new android.net.sip in Android 2.3, as an extra feature of an existing Android application. Earlier, i.e. before 2.3, I tried to do a naive solution but I could not connect the other mobile phone because of the carrier network operator's firewalls!
So, I wonder, how does this new SIP package in Gingerbread bypass those firewalls, allowing mobile phones to connect directly to each other? Or will there be problems anyway? (I scanned Googles Android documentation but could not find any information on this topic.)
Thanks in advance!
/Steve
You're making an unwarranted assumption that there's a (hidden) mechanism for bypassing/traversing firewalls. Maybe there is, but quite possibly there isn't. The overall SIP documentation looks thin; this feature may well not be ready for general use, or you may well need to implement such things outside of it (STUN, TURN, UPnP, etc).

Categories

Resources