Can i save automatically GPRS setting when i am installing the Java ME application.
Any one have any experience please share.
No, You can't have this.
What you can do is, Try making connection if it fails prompt user to make active connection available to application.
Unfortunately, you can't change the GPRS settings programmatically. We don't have the permission for accessing those things. So you have to change manually the GPRS settings before starting your application.
Related
I made android app that uses firebase, but as the users live in Syria they should use a VPN to use my app because firebase is blocked in that country.
Is it possible to use a script or a JSON file in my app to workaround this problem?
You should try setting up your own vpn connection inside the app you're developing.
Try using this source to ease out your work.
another solution is that at runtime when your app attempts to connect with internet you can programatically reroute it's root default base connection route to your preferred IP address thus eventually solving your problem without using any external app.
Lastly,You can't try creating a service which will be installed in the backend and when the app is launched the service is automatically triggered with it and hence it will automatically route your connection to preferred vpn IP address.
When developing a Java EE 7 webapp (Win8, eclipse Kepler, JBoss Tools 4.1.1, wildfly8.0CR) I can use the application at localhost:8080/app/
But I wonder what to do, if I want an extern access to that app, e.g. from my other PC. What configuration is needed, or do you need a "real" server for such a purpose?
Thanks in advance
How public to you want your website to be?
If you want to access it from another computer on the same network(for example your home network) you need to adjust your network and firewall settings so that that you would have access from one computer to anoher on the same network. Then if on the computer that contains the app you would access it for example http://localhost:8080/myapp then on another network you would access it http://ip-of-the-comuter-that-contains-the-app:8080/.
If you would like to access it from outside the local network then the process is same, but a static IP would be recommended to the computer that contains the app.
If you would like the general public to use the app, then hosting it from your PC may not be such a good idea and somekind of server solution is adviseable. There are lots of different cloud solutions like http://aws.amazon.com/ec2/ or https://developers.google.com/appengine/ that would provide enough flexibility for majority of apps. Or you could ofcourse have your own server hardware, but this can turn out to be much more expensive to keep stable and secure.
For a quick-and-dirty solution you can choose the "Enable remote access" option on the server (double click the server, and you should see a check box in the server editor).
This will tell the server to start listening on all network interfaces and not just the local one.
btw. we only listen on local network interface by default for security reasons since we don't want you to unintentionally get hacked if a vulnerability is found and used by someone malicious.
How can I create whitelist with root-granted apps? Other apps must be denied whithout any prompt.
I'm looking for existing solution or some advice how to write app with this features.
You should checkout Superuser on the market. This app can manage what apps have root access to the device.
use
Download Magisk Manager
solutions 1
its have feature for app selection for pregranted and for other apps
solutions 2
first manually grant permission from Magisk app
set default Aotometic Response -> Deny
be free to ask for more help :)
Again stuck on the same problem.
I have found around that we can set static system settings like this:
System.putString(getContentResolver(), android.provider.Settings.System.WIFI_USE_STATIC_IP, "1"); // to define it use static ip's
System.putString(getContentResolver(), android.provider.Settings.System.WIFI_STATIC_IP,"192.168.1.15");
System.putString(getContentResolver(), android.provider.Settings.System.WIFI_STATIC_NETMASK,"255.255.255.0");
System.putString(getContentResolver(), android.provider.Settings.System.WIFI_STATIC_DNS1,"192.168.1.1");
System.putString(getContentResolver(), android.provider.Settings.System.WIFI_STATIC_GATEWAY,"192.168.1.1");
But No Success!
I don't understand that when to set these settings?
Should I do it before the wifi configuration creation or after saving the wifi configuration or even before activating it or after it?
However, I have tried the all possible cases from my side and when I check Android WiFi settings, I see it's still on DHCP.
A previous question i.e. How to configue a static IP address, netmask, gateway programmatically on Android 3.x or 4.x has completely ruined my android device and now it can't switch
ON its WiFi anymore.
I also tried static IP on my HTC phone and no success, its always in DHCP mode!
Do I need to call a "reconnect" command? If yes, then in which way?
I think you it should look like:
android.provider.Settings.System.putString(getContentResolver(),android.provider.Settings.System.WIFI_STATIC_IP,"192.168.1.15");
android.provider.Settings.System.putString(getContentResolver(),android.provider.Settings.System.WIFI_STATIC_DNS1, "192.168.1.1");
android.provider.Settings.System.putString(getContentResolver(),android.provider.Settings.System.WIFI_STATIC_GATEWAY, "192.168.1.1");
android.provider.Settings.System.putString(getContentResolver(),android.provider.Settings.System.WIFI_STATIC_NETMASK, "255.255.255.0");
android.provider.Settings.System.putString(getContentResolver(),android.provider.Settings.System.WIFI_USE_STATIC_IP, "1");
And don't forget the manifest:
<uses-permission android:name="android.permission.WRITE_SETTINGS"></uses-permission>
Regarding the WiFi problem that your device had, you can try switching the WIFI on programmatically. This post might be helpful:
How to programmatically turn off WiFi on Android device?
After more than a year, I give up with setting a static IP (or DHCP, DNS, ...). Simply it's not possible, or, better, it's not allowed (from an arbitrary application).
Someone says:
"You could use NDK - this gives you low-level access to Linux under Android. Warning: don't expect this to be documented or supported. They might even ban you from Android Market (I know I would)"
For those who want to have some expriences with NDK, here is the a link:
http://developer.android.com/tools/sdk/ndk/index.html
Good luck, and give some feedback if you find something interesting!
My Java.app broadcasts a packet on the network as soon as it starts up. Everytime I start this app, the Mac asks me do I want to allow network connections blah..blah.. Can I use info.plist or something to allow network access to this app and not bother the user who has trustingly downloaded and installed my app.
Thanks
You can choose to allow incoming connections for specific services in System Preferences > Security > Firewall.
Addendum: You application will appear only if the user has chosen to "Set access for specific services and applications." It will be added the first time the application attempts to open the port.
Addendum: The application appears with the name java in the Firewall pane. Once the user chooses to accept or deny, the dialog ceases to appear. This simple example is convenient for testing.
If you codesign your app (using the same key across updates) it should work properly with the app-specific firewall on. It seems to be a bug on Apple's side that unsigned java apps are prompted for allowing network connections (even if they don't try to listen to the network) every time they are run.