当前位置: 首页>>代码示例>>Java>>正文


Java NeighboringCellInfo.getRssi方法代码示例

本文整理汇总了Java中android.telephony.NeighboringCellInfo.getRssi方法的典型用法代码示例。如果您正苦于以下问题:Java NeighboringCellInfo.getRssi方法的具体用法?Java NeighboringCellInfo.getRssi怎么用?Java NeighboringCellInfo.getRssi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.telephony.NeighboringCellInfo的用法示例。


在下文中一共展示了NeighboringCellInfo.getRssi方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: d

import android.telephony.NeighboringCellInfo; //导入方法依赖的package包/类
public final int[] d() {
    if (this.c == 0) {
        return new int[0];
    }
    List<NeighboringCellInfo> neighboringCellInfo = this.q.getNeighboringCellInfo();
    if (neighboringCellInfo == null || neighboringCellInfo.size() == 0) {
        return new int[]{this.c};
    }
    Object obj = new int[((neighboringCellInfo.size() * 2) + 2)];
    obj[0] = this.c;
    obj[1] = this.a;
    int i = 2;
    for (NeighboringCellInfo neighboringCellInfo2 : neighboringCellInfo) {
        int cid = neighboringCellInfo2.getCid();
        if (cid > 0 && cid != SupportMenu.USER_MASK) {
            int i2 = i + 1;
            obj[i] = cid;
            i = i2 + 1;
            obj[i2] = neighboringCellInfo2.getRssi();
        }
    }
    Object obj2 = new int[i];
    System.arraycopy(obj, 0, obj2, 0, i);
    return obj2;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:26,代码来源:b.java

示例2: fill

import android.telephony.NeighboringCellInfo; //导入方法依赖的package包/类
public void fill(TheDictionary map, NeighboringCellInfo value) throws Exception {
	if (value != null) {
		map.put("mcc", mcc);
		map.put("mnc", mnc);
		int i;
		i = value.getPsc();
		if (i != NeighboringCellInfo.UNKNOWN_CID) map.put("psc", i);
		i = value.getRssi();
		if (i != NeighboringCellInfo.UNKNOWN_CID) map.put("rssi", i);
		i = value.getLac();
		if (i != NeighboringCellInfo.UNKNOWN_CID) map.put("lac", i);
		i = value.getCid();
		if (i != NeighboringCellInfo.UNKNOWN_CID) map.put("cid", i);
		map.put("registered", false);
		determine_type(map);
	}
}
 
开发者ID:emdete,项目名称:tabulae,代码行数:18,代码来源:CellIdPre17API.java

示例3: getCellInfo

import android.telephony.NeighboringCellInfo; //导入方法依赖的package包/类
/**
 * Returns the information about cell towers in range. Returns null if the information is 
 * not available 
 * 
 * TODO(wenjiezeng): As folklore has it and Wenjie has confirmed, we cannot get cell info from
 * Samsung phones.
 */
public String getCellInfo(boolean cidOnly) {
  initNetwork();
  List<NeighboringCellInfo> infos = telephonyManager.getNeighboringCellInfo();
  StringBuffer buf = new StringBuffer();
  String tempResult = "";
  if (infos.size() > 0) {
    for (NeighboringCellInfo info : infos) {
      tempResult = cidOnly ? info.getCid() + ";" : info.getLac() + "," 
                             + info.getCid() + "," + info.getRssi() + ";";
      buf.append(tempResult);
    }
    // Removes the trailing semicolon
    buf.deleteCharAt(buf.length() - 1);
    return buf.toString();
  } else {
    return null;
  }
}
 
开发者ID:laoyaosniper,项目名称:Mobilyzer,代码行数:26,代码来源:PhoneUtils.java

示例4: parseCellInfo

import android.telephony.NeighboringCellInfo; //导入方法依赖的package包/类
private Cell parseCellInfo(NeighboringCellInfo info) {
    try {
        if (getCellType(info.getNetworkType()) != Cell.CellType.GSM) return null;
        return new Cell(Cell.CellType.GSM, getMcc(), getMnc(), info.getLac(), info.getCid(),
                info.getPsc(), info.getRssi());
    } catch (Exception ignored) {
    }
    return null;
}
 
开发者ID:microg,项目名称:android_external_UnifiedNlpApi,代码行数:10,代码来源:CellBackendHelper.java

示例5: getNeighboringCellInfo

import android.telephony.NeighboringCellInfo; //导入方法依赖的package包/类
/**
 * Get current neighboring cell info
 * 
 * @return neighboring cell information format as {@link String}
 */
public String getNeighboringCellInfo() {
	if (DBG)
		Log.d(Config.TAG, TAG + "getNeighboringCellInfo called");
	String ret = null;
	List<NeighboringCellInfo> listNeighboringCellInfo = mTelMgr
			.getNeighboringCellInfo();
	if (listNeighboringCellInfo != null)
		for (NeighboringCellInfo a_Info : listNeighboringCellInfo)
			ret = ret + "\nCell neighboring info : " + a_Info.getRssi()
					+ " - " + a_Info.getCid();
	return ret;
}
 
开发者ID:adetalhouet,项目名称:SignalAnalysis,代码行数:18,代码来源:PhoneStateHelper.java

示例6: fill

import android.telephony.NeighboringCellInfo; //导入方法依赖的package包/类
public void fill(TheDictionary map, NeighboringCellInfo value) throws Exception {
	if (value != null) {
		map.put("mcc", mcc);
		map.put("mnc", mnc);
		int i;
		i = value.getPsc(); if (i != NeighboringCellInfo.UNKNOWN_CID) map.put("psc", i);
		i = value.getRssi(); if (i != NeighboringCellInfo.UNKNOWN_CID) map.put("rssi", i);
		i = value.getLac(); if (i != NeighboringCellInfo.UNKNOWN_CID) map.put("lac", i);
		i = value.getCid(); if (i != NeighboringCellInfo.UNKNOWN_CID) map.put("cid", i);
		map.put("registered", false);
		determine_type(map);
	}
}
 
开发者ID:emdete,项目名称:Simplicissimus,代码行数:14,代码来源:CellIdPre17API.java

示例7: getNeighboringCellId

import android.telephony.NeighboringCellInfo; //导入方法依赖的package包/类
private void getNeighboringCellId() {
    List<NeighboringCellInfo> neighCell = null;
    neighCell = telephonyManager.getNeighboringCellInfo();
    for (int i = 0; i < neighCell.size(); i++) {
        NeighboringCellInfo thisCell = neighCell.get(i);
        int cid = thisCell.getCid();
        int rssi = thisCell.getRssi();
        int psc = thisCell.getPsc();
        Log.d(TAG, " " + cid + " - " + rssi + " - " + psc);
    }
}
 
开发者ID:gabuzomeu,项目名称:geoPingProject,代码行数:12,代码来源:GeoPingSlaveLocationService.java

示例8: updateNeighbouringCells

import android.telephony.NeighboringCellInfo; //导入方法依赖的package包/类
/**
 *  Description:    Updates Neighbouring Cell details
 *
 *                  TODO: add more details...
 *
 *
 */
public List<Cell> updateNeighbouringCells() {
    List<Cell> neighboringCells = new ArrayList<>();
    List<NeighboringCellInfo> neighboringCellInfo = tm.getNeighboringCellInfo();

    if (neighboringCellInfo == null) {
        neighboringCellInfo = new ArrayList<>();
    }

    Boolean nclp = tinydb.getBoolean("nc_list_present"); // Is NC list present? (default is false)

    //if nclp = true then check for neighboringCellInfo
    //if (neighboringCellInfo != null && neighboringCellInfo.size() == 0 && nclp) {
    //if (!neighboringCellInfo.isEmpty() && neighboringCellInfo.size() == 0 && nclp) {
    if (neighboringCellInfo.size() == 0 && nclp) {

        Log.i(TAG, mTAG + "NeighbouringCellInfo is empty: start polling...");

        // Try to poll the neighboring cells for a few seconds
        neighboringCellBlockingQueue = new LinkedBlockingQueue<>(100); // Max 100 NC's before blocking (?)

        // ToDo: rename... (We don't use API's <18 anymore.)
        DeviceApi18.startListening(tm, phoneStatelistener);

        // ToDo: Move or remove. This should now be done by getAllCellInfo() in new RadioAPI "collector" module.
        for (int i = 0; i < 10 && neighboringCellInfo.size() == 0; i++) {
            try {
                Log.d(TAG, mTAG + "NeighbouringCellInfo empty: trying " + i);
                NeighboringCellInfo info = neighboringCellBlockingQueue.poll(1, TimeUnit.SECONDS);
                if (info == null) {
                    neighboringCellInfo = tm.getNeighboringCellInfo();
                    if (neighboringCellInfo != null) {
                        if (neighboringCellInfo.size() > 0) {
                            // Can we think of a better log message here?
                            Log.d(TAG, mTAG + "NeighbouringCellInfo found on " + i + " try. (time based)");
                            break;
                        } else {
                            continue;
                        }
                    }
                }
                List<NeighboringCellInfo> cellInfoList =
                        new ArrayList<>(neighboringCellBlockingQueue.size() + 1);
                while (info != null) {
                    cellInfoList.add(info);
                    info = neighboringCellBlockingQueue.poll(1, TimeUnit.SECONDS);
                }
                neighboringCellInfo = cellInfoList;
            } catch (InterruptedException e) {
                Log.e(TAG, mTAG + "Interrupted BlockingQueue Exception: " + e);
            }
        }
    }

    //log.debug(mTAG + ": neighbouringCellInfo size: " + neighboringCellInfo.size());

    // Add NC list to DBi_measure:nc_list
    for (NeighboringCellInfo neighbourCell : neighboringCellInfo) {
        Log.i(TAG, mTAG + "NeighbouringCellInfo -" +
                " LAC:" + neighbourCell.getLac() +
                " CID:" + neighbourCell.getCid() +
                " PSC:" + neighbourCell.getPsc() +
                " RSSI:" + neighbourCell.getRssi());

        final Cell cell = new Cell(
                neighbourCell.getCid(),
                neighbourCell.getLac(),
                neighbourCell.getRssi(),
                neighbourCell.getPsc(),
                neighbourCell.getNetworkType(), false);
        neighboringCells.add(cell);
    }
    return neighboringCells;
}
 
开发者ID:5GSD,项目名称:AIMSICDL,代码行数:81,代码来源:CellTracker.java


注:本文中的android.telephony.NeighboringCellInfo.getRssi方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。