原始碼中Android短視訊開發、iOS短視訊開發中記錄位置的原始碼
在原始碼中Android短視訊開發和iOS短視訊開發中,記錄位置資訊的功能是很重要的,它主要被用來定位使用者、搜尋附近的人、查詢使用者可能認識的人,並向用戶推薦他們。下面這段程式碼資訊就是短視訊開發過程中位置資訊處理簡介。
/*記錄位置資訊*/
private void sendLocationInfo() {
if (!mMapLoaded) {
ToastUtil.show(WordUtil.getString(R.string.map_not_loaded
return;
}
if (mAdapter != null) {
TxLocationPoiBean bean = null;
if (mSearchResultGroup.getVisibility() == View.VISIBLE
bean = mAdapter2.getCheckedLocationPoiBean();
} else {
bean = mAdapter.getCheckedLocationPoiBean();
}
if (bean != null) {
Intent intent = new Intent();
TxLocationPoiBean.Location location = bean.getLocation();
intent.putExtra(Constants.LAT, location.getLat());
intent.putExtra(Constants.LNG, location.getLng());
intent.putExtra(Constants.SCALE, mTencentMap.getZoomLevel());
String address = "{\"name\":\"" + bean.getTitle() + "\",\"info\":\"" + bean.getAddress() + "\"}";
intent.putExtra(Constants.ADDRESS, address);
setResult(RESULT_OK, intent);
finish();
} else {
ToastUtil.show(WordUtil.getString(R.string.address_failed));
}
} else {
ToastUtil.show(WordUtil.getString(R.string.address_failed));
}
}
相信閱讀這篇文章的讀者都是對Android短視訊開發和iOS短視訊開發有所瞭解的人,也許你正在尋找短視訊APP的開源原始碼,在這裡我就放幾段關鍵性的程式碼出來免費提供給大家學習和參考,本段程式碼僅供參考學習之用。