Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Receive device serial num during Agentry Synch

Hello mobility experts.

We want to extract device uniq id (for example SN) when agentry session goes and store it somewhere in SAP. I've searched SDML reference and did not find anything for Android devices. Could you help with this question? Maybe some other ways exists...

Regards,

Andrey

Tags:
replied

Mark,

Thank you very much for approach. I decided to use OpenUI. I attach class logic, maybe someone find it useful.

package com.sap.mobile.platform.client.openui.extensions;

import com.sap.mobile.platform.client.openui.adapters.StringDisplayAdapter;

import com.sap.mobile.platform.client.openui.models.StringDisplayModel;

import android.content.Context;

import android.net.wifi.WifiInfo;

import android.net.wifi.WifiManager;

import android.os.Build;

import android.telephony.TelephonyManager;

import android.view.View;

public class ZAndroidInfo extends StringDisplayAdapter {

  StringDisplayModel _model;

  Context _context;

  @Override

  public void initialize(StringDisplayModel arg0, Context arg1) {

  // TODO Auto-generated method stub

  _model = arg0;

  _context = arg1;

  }

  @Override

  public View getView() {

  // TODO Auto-generated method stub

  return null;

  }

  @Override

  public String getExtensionString(String name)

  {

      if (name.equals("MAC")) {

      WifiManager wifiManager = (WifiManager) _context.getSystemService(Context.WIFI_SERVICE);

      WifiInfo wInfo = wifiManager.getConnectionInfo();

      return  wInfo.getMacAddress(); }

      if (name.equals("IMEI")) {

      TelephonyManager telephonyManager = (TelephonyManager)_context.getSystemService(Context.TELEPHONY_SERVICE);

      return telephonyManager.getDeviceId(); 

      }

      if (name.equals("SERIAL")) {

      return Build.SERIAL;  

      }

   

      return "";

  }

}

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question