Setting static IP programmatically.

edited May 20 in General

We are developing a kiosk application to be installed in public facing areas.

The problem we have is that we cannot find a way to programmatically set the ethernet ip address. I can see you have a static IP option in Emteria Settings, is there a way for me to set the IP in my app the way you are in your settings application or alternatively, Is there a way for me to launch directly into the ethernet settings via an intent?

I tried to launch the "EthernetSettings" activity but received an exception saying java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.SEND cmp=com.emteria.settings/.EthernetActivity } ... not exported from uid 1000

I believe this is because your manifest has android:exported=false set for this activity.

Tagged:

Comments

  • This behavior is correct - for security reasons you don't want arbitrary applications to be able to set global Ethernet (or other system-related) options. Even if you manage to open the respective activity, you probably won't be able to fill out the values programmatically. Is there a way to do so in other OSes?

    We are currently working on an online device management solution, which will be able to set Ethernet options.

  • I understand that, Sorry for not clarifying better, what I was looking for was a way to allow the user to access the settings and set these values. Being able to send them directly to the Emteria ethernet settings would mean these settings can be updated on site without having to allow users access to the more dangerous or confusing settings available in the settings MainActivity.

    You can use intent flags to access specific pages of the default android settings, for example sending users to the Wifi page (using ACTION_WIFI_SETTINGS) to connect to a specific SSID or configure settings for a particular network.

  • @dsod said:
    ... these settings can be updated on site without having to allow users access to the more dangerous or confusing settings available in the settings MainActivity.

    Got it, thanks. Sounds good to me, I'll include this into the next release.

  • Thanks.

Sign In or Register to comment.