• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Can an application turn an Adroïd device into a WIFI access point?

Hello,

I am fairly new in the Androïd's world.

I've seen that it is possible to turn an Androïd mobile phone into a WIFI access point. This is done through the general configuration interface of the phone. But I am wondering:

Is to possible to turn an Androïd mobile phone into a WIFI access point programmatically?

Note that by using the term "programmatically", I mean: "by an application". In other words: Does an application have access to the configuration that is used to turn the phone into a WIFI access point?

Assuming that the application has turned the phone into a WIFI access point, can it bind a socket (or whatever is the Androïd equivalent of a socket) to the WIFI interface and start acting as a server?

In short: can an application turn an Androïd device into a WIFI access point and then act as a server listing to, and answering from, the WIFI interface?

If the response is "no, it can not", then I assume that it is a restriction from Google.

Thanks to everyone,

Denis
 
Hi Denis, welcome to the forums! :)

I've moved your post to the Applications area from Development so you can get the responses you're needing, and I'll begin.

Android is simply a compact, real-time Linux, so yes, it uses sockets and most everything else you may know about Linux networking will apply.

Your question about server availability for tethered devices is a matter of routing and no different from the same situation on Linux, OS X, or Windows - except you get more tools with Linux and Android in general, so let's take it pieces.

Can you get programmatic access to the wifi hotspot?

Yes. Here's a free and simple example, use the direct download link -

https://code.google.com/p/android-wifi-tether/

You're effecting a bridging router between the cell network and a wifi subnet, just like doing it between ethernet and a wifi network - and the networks will be segregated here, just as they would on a desktop.

How then would you try to access the server from the tethered devices?

I would first modify the wifi tether DNS specification and point it at the ip address of the phone.

Then put together a DNS server for the phone and launch it along with the server you have in mind. You need to know how to set up DNS configuration files but that's not terribly difficult. You can launch the servers from a single app.

Check out "Servers Ultimate"

https://play.google.com/store/apps/details?id=com.icecoldapps.serversultimate

You may be able to skip the DNS part and use a direct IP. I wouldn't because that's a dynamic value, however that's up to you. But it's easy to query for that value and then edit your DNS configuration base files on the fly using a simple bash script and sed - no big deal.

Then all you'd need would be a simple way to run the script when needed rather than having to bother with going to a command line interface to run it. Also no big deal.

Check out "Script Manager - SManager"

https://play.google.com/store/apps/details?id=os.tools.scriptmanager

The only thing left is network routing within the phone - you may need to ensure or change your routing table so that everything works correctly. I haven't done that for this application class for years, so I've forgotten how to do that from memory, but that's no big deal, Google is our friend and almost an exact certainty you'll find Linux help to do it already posted in multiple times on stackexchange.

You'll need to root the phone to access the routing table, no different than needing an su session or sudo on desktop Linux to do that.

Hope this helps!
 
@EarlyMon,

Thank you very much for this information.

Although I am accustomed to networking concepts, I have some difficulties to follow you.

What bothers me is that I'll need to "break jail" the device.

Most users don't "break jail" their device. They simply download the application from the store, and start to use it. If we explain to the users they'll need to "break jail" their device, they probably won't install the application... and the application could not be available on the store anyway.

My idea is to develop an Open Source application, that could be used by the "general public". This application will allow "local users" to exchange IDs or messages directly.

Note 1:

Please note that by using the expression "local users" I mean: users that are nearby. Typpically, users that are located within WIFI range.​

Note 2:

Please note that I want it to be Open Source because my goal is to create an application that targets social issues. And I want to encourage other developers to do so. The idea behind my action is: most applications address technical problems or focus on entertainment (games...). In other words, the new technologies don't address today's most important issues: the social issues. We are facing a revolution that is comparable to the printer's revolution. However, it seems that the tools (the new technologies) behind this revolution are not targeted to the really big issues.

While we were working for a big ISP in France, we had the idea to include within our boxes the necessary software that would have allowed our customer to create an ad-hoc (WIFI) network using their boxes as peers. The government told us to stop this project. Although this was not told, the reason behind this injunction was that an ad hoc network is impossible to spy. In other words: peaple can talk to each other, but we want to be able to collect data. This implies that all exchanges pass through "monitored tubes". We can not allow people to exchange directly from one to another.​

Although I am not expert in mobile phone's development, I have the impression that it is possible to create such application. However, it seems that, in order to do that, you have to "jail break" the device... which, basically, restricts this application to a very low number of users.

Do you see what I am looking for? I am looking for a way to make two mobile phones nearby exchange data. As I expected, the Bluetooth API does not provide the required profile... as if by chance.

Any idea?

Thanks,

Denis
 
Last edited:
OK, that's pretty clear, let me summarize -

You began this project.

The French government shut it down as illegal (injunction=illegal), for whatever reason.

You have an explanation as to why they did that, but they didn't say it.

And you want help because of social issues and freedom of information.

Here's what I think I know -

France doesn't seem to have a lot of trouble with freedom of speech - je suis Charlie.

Neither the United States government nor Androidforums.com is presently at war with France.

I don't feel compelled to cross a foreign government that we're not at war with.
 
@EarlyMon

Hello,

No, the issue is not the freedom of (public) speech.

By the way, freedom of (public) speech is really not an issue, at least in France.

Note:

If there is an issue somewhere around the idea is speech, it is about "private speech" - not freedom of speech.

Do you like the idea that someone, or something, is intercepting your conversation with your mother or your brother? This is a private conversation, isn't it? Freedom of speech has nothing to do with this kind of exchange. The concept of "freedom of speech" is out of the way in the scenario. You may live naked in your house if you want, this is a private place. Similarly, you can tell whatever you want in private as well... Unless somebody, like Google (a U.S company), is intercepting and analyzing, every email you send and receive. Well, as long as the only player is Google, this is not critical. However, the fact is: the technology required to intercept private data, to analyze it, and build models from it, exists...

Therefore, if there is an issue, this is not the issue of freedom of speech. This is just the issue of privacy.​

However, by the way, my idea is not about privacy as well. If you want to protect your privacy, you have the tools to do so.

My idea is targeted to something totally legal and 100% politically correct. Otherwise, I would not leave my identity and my IP address on this forum ;) It is too easy to hide ;)

And, by the way, talking about war is a bit exaggerated... particularly when it comes to the subject of privacy. Google spyes European citizens... and the NSA intercepts communications from some European presidents. So it is needless to say that European states have secured their communications so that the United States cannot intercept it anymore. This is not a war, of course. However, it looks like that we don't trust each other :cool:

Well, I am concentrating on two issues:
  • How to make people meet? How to develop social links?
  • How to create a local community around a common goal?
As you can see, these issues are 100% politically correct... There are no ways to declare wars based on these issues.

Regards,

Denis

PS:

The truth is: you can develop a tool for a very loadable goal. However, any tool can be diverted from its original goal. Please not that this is true for any tool.

Allowing direct peer-to-peer communication between devices can provide the required tool to achieve very loadable goals. It can also be used to develop really bad things... Just like a gun may be a truly good tool to protect yourself, it can be used to do highly bad things. Why do we authorize guns - at least in the U.S.A - and not direct peer-to-peer communication between devices?

Forbidding direct peer-to-peer communication between devices on the pretext that it could be used by terrorists is just really stupid. If so, then let's forbid guns and any other tools that can be deviated from a loadable goal. That is: all the tools in earth, because any tool can be used by terrorists. By the way, forbidding is really not a good solution since it is just a matter of time for technologies to become wide spread.​
 
Last edited:
Android can do peer to peer easily.

I understood the difference between privacy and freedom of speech before I posted - I was trying to make a point, it was lost on your reading. Likewise on the war comment.

I've never met a developer take the approach - "If I talk forever about why I need it, then a programmer will help. I'm not getting help because they don't get it."

I've heard others use that approach - most developers have.

Anyway, Android does peer to peer connections easily.

That's about as far as I'm able to go, best luck.
 
Back
Top Bottom