Implement internet gateway in android - java

For my research I need to implement an internet gateway in Android. similarly to what Open Garden does to make android utilize facility provided by its own to use its provided stream etc as an internet connection. This app does not require any root access.
So my question is very narrow: how to create such a facility. and how to instruct Android to use it instead of an already existent LTE connection for example. I am not asking about protocols etc. just how to integrate something like that into the android without the use of root access; what APIs etc.

Well; after some short research the actual solution is to implement a VpnService; make localhost the server and from there route your pakcets anywhere you wish:) there seems to be trouble bugs not fixed yet (people actually waiting for yeara for google to fix) in cases like when other apps do not handle detect the vpn connection properly. Anyway:) here's the answer. I'll be on my way now.

Related

Android ProviderInstaller and custom caches

TL;DR - The classes I need to use to allow my server to remain secure prevent my client remaining secure - I can't find a happy balance.
I am using HttpsUrlConnection on android devices which are not readily accessible to humans. They run for long periods of time without being rebooted - long enough that sometimes they need to adapt slightly to a changing server. In this scenario, a security flaw shows up in the wild and the server is reconfigured to reject the vulnerable protocol.
As far as I can make out, the android device is caching the connections in some way that means once it has decided on a protocol for a server it sticks with it, even if the server starts rejecting connections. I would like it to go through the handshake again, get a new protocol, and keep working.
I think I can see how to do that using a custom socket factory.
However, I am also aware of security flaws showing up in the SSL implementation on the device. I can fix these using ProviderInstaller, which updates whatever it is that needs updating using the google play store. Ignoring for now the dialog I have to deal with when I do that, I also hit on this little warning:
Caution: Updating a device's security Provider does not update android.net.SSLCertificateSocketFactory. Rather than using this class, we encourage app developers to use high-level methods for interacting with cryptography. Most apps can use APIs like HttpsURLConnection, HttpClient, and AndroidHttpClient without needing to set a custom TrustManager or create an SSLCertificateSocketFactory.
I might be misreading this, but I get the feeling that the only way I can deal with a server changing protocols to protect itself from a vulnerability is to use things which make the client unsafe instead?
Can anyone confirm, clarify or offer suggestions?

Android app need help connecting to a JAVA localhost server

I've had a look around and could not find what I'm looking for, so please feel free to redirect me.
I'm writing a card game that uses a Java server that stores the card information. I want to develop an Android app that connects to this server (via TCP/IP is my initial thought) and issues the commands i.e. pick up cards, play cards etc. (as the cards are stored in arraylists within the server app.)
My knowledge of Android is extremely limited and I cant find any good sources that could possibly help me, or explain how android networking works.
You need tcp server socket communication >
http://developer.android.com/reference/java/net/Socket.html
I would recommend to use a REST service and communicate via JSON. You can use for example Robospice in combination with Jackson2 which also brings you async communication and caching out of the box.
https://github.com/stephanenicolas/robospice/wiki/Starter-guide
Socket communication is really old school ;-)

Device Communication Servers for use with OpenGTS

I want to write 2 Device Communication Servers for use with OpenGTS (Enterprise). Devices are Teltonika FM4200 and WirlessLinks Piccolo STX. can u give me a some tutorial or something useful. I still don't have idea on it.
Instead of DCS you can use Traccar server which already supports FM4200, the second device might already be supported as well, I just need some message examples to verify that. Configuration file to integrate two systems can be found here.

Integrate IM/chatting functionality in my Java application

I am interested in putting a chatting functionality as part of an application.
What I am interested in:
I would like to keep my application instances acting as peers, i.e.
I would prefer not to write also some server module to handle
message communications
I would like it to be able to use it with exising IM accounts. E.g.
someone can use it using his MSN account or any other client
account he may have, same way he would use MSN Messenger or Tor client etc
I googled and found that there are some Java MSN libraries available and also some other libraries that support IM e.g. SMACK for JABBER etc (not sure what that is) but I am not sure if the latter could be used for option 2 I mention.
My preference on 2 is because I assume that this way a user could do chat no matter where he is while in other solution I assume that some network infrastructure e.g. with routable IPs etc would be required. Am I wrong here?
Does anyone have expererience with Java IM libraries? Are for example any issues e.g. with different MSN versions or something?(Don't know if the protocol has been changing often to matter for me).
What would be the best path/option for my requirements?
I would go with a Jabber based approach. Jabber (also called XMPP) is an open protocol with lots of implementations and supports connecting to other IM services via transports. That way you would not have to deal with changes to the Windows Live protocols. You can rely on the open source community to provide that functionality for you.
Edit: It seems, that Windows Live even allows native XMPP access.
If you like, you can always set up your own Jabber server to provide a tighter integration with existing user accounts. In that case you wouldn't need to write the whole server.

Is it possible to block an IP address on smartphone?

Is it possible to block a website/ IP address in a smartphone by way of an app that people can download? I want to sell an app that blocks certain websites from being able to pull up on your phone.
There is not really any such option in the SDK. You won't be able to do it in an app. You can only do it if you plan to distribute your own android ROM (You probably don't).
What you CAN do however is to sell a configurable proxy service and let people to connect toy your service by setting up your server as a proxy. This is also not such a trivial task by itself.
There is a dedicated blog to a android proxy settings:
http://android-proxy.blogspot.com/
Good luck
Are you trying to create an adblocking app?
There's already one, but like Variant said, it uses proxies.
http://www.androlib.com/android.application.ub0r-android-adblock-zmmF.aspx

Categories