我想将 Google 地图功能迁移到 HMS。大部分零部件很容易迁移到华为,但我有集群的功能,我使用ClusterItem,并ClusterManager与DefaultClusterRenderer我的GoogleMap的显示标记簇作为一个标志,如果很多人有在地图上。
HMS 中缺少此功能。我找到了它Marker,HWMarkerCluster但它的系统完全不同,HWMarkerCluster甚至在 Android 的导入类选项中都没有找到。它仅适用于 Javascript API。
如果在 HMS 中有任何替代方案,有什么建议吗?因为我正在阅读 Map Kit 文档一个小时,但我找不到任何东西。
在 Cordova 中,如何检测设备是否有华为应用程序库?
我们有一款应用程序使用蓝牙低功耗 (BLE) 技术与活动跟踪器等硬件设备进行通信。
所有支持 BLE 的手机均可进行通信,但当我们尝试将追踪器与华为手机连接时,它根本无法工作。
流程如下:
以下是显示问题的日志:
I/Bluetooth: BtGatt.GattService:onConnected() - clientIf=6, connId=0, address=E6:4F:92:69:B7:95
I/Bluetooth: BluetoothProfileService:isAvailable(), mStartError=false, mCleaningUp=false
BluetoothGatt Check Status and NewState: 133|0
I/Bluetooth: BtGatt.GattService:clientDisconnect() - address=E6:4F:92:69:B7:95, connId=null
Run Code Online (Sandbox Code Playgroud)
我们还使用“nRF Connect”应用程序进行了测试,在该应用程序中,它也提供了状态为 133(蓝牙 Gatt 故障)的断开回调。请查找随附的屏幕截图。
如果有人遇到同样的情况,可以帮助我们吗?
android bluetooth bluetooth-lowenergy android-bluetooth huawei-mobile-services
我非常担心,因为华为个人联系了我,他们解释说新手机不会安装 Play 服务(旧消息)。我工作中的应用程序目前使用不同的 Google 服务:play-services-ads、play-services-auth、firebase-messaging、firebase-analytics、Crashlytics、Google Sheets、Google Drive。
我们使用 Google Sign-in 来获取 GoogleAccountCredential 以调用 Drive/Sheets API:
GoogleAccountCredential credential = GoogleAccountCredential
.usingOAuth2(HomeActivity.this,
//Collections.singleton(DriveScopes.DRIVE_FILE));
Collections.singleton(DriveScopes.DRIVE));
public static DriveServiceHelper initDriveService(GoogleAccountCredential mCredential) {
if(mDriveService == null && mCredential != null){
// servicio drive
mDriveService = new Drive.Builder(
AndroidHttp.newCompatibleTransport(),
new GsonFactory(),
mCredential)
.setApplicationName(getString(R.string.app_name))
.build();
}
if(mSheetsService == null && mCredential != null){
// servicio sheets
mSheetsService = new Sheets.Builder(
AndroidHttp.newCompatibleTransport(),
new GsonFactory(),
mCredential)
.setApplicationName(getString(R.string.app_name))
.build();
}
//driveServiceHelper = new DriveServiceHelper(googleDriveService);
return new DriveServiceHelper(mDriveService, mSheetsService, mCredential);
} …Run Code Online (Sandbox Code Playgroud) android google-drive-api google-play-services google-sheets-api huawei-mobile-services
我仅在华为系列设备、Android 9 和 10 上收到android.database.sqlite.SQLiteBlobTooBigException
在onUpgrade方法中我想向表添加新列
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
...
case 43:
addColumn(db, TABLE_LESSONS, _SPEED_GAME_EASY_FINISHED, " INTEGER DEFAULT 0");
addColumn(db, TABLE_LESSONS, _SPEED_GAME_HARD_FINISHED, " INTEGER DEFAULT 0");
addColumn(db, TABLE_LESSONS, _MEMORY_GAME_EASY_FINISHED, " INTEGER DEFAULT 0");
...
}
Run Code Online (Sandbox Code Playgroud)
private void addColumn(SQLiteDatabase db, String table, String column, String columnType) {
boolean isColumnExist = false;
AbstractWindowedCursor cursor = null;
String selectQuery = "SELECT * FROM " + table + " LIMIT 0,1";
try { …Run Code Online (Sandbox Code Playgroud) 我目前正在开发一些map'ish应用程序,我想支持依赖HMS服务的华为手机。我已经成功地实现了地图和标记,但是我在地理编码坐标方面遇到了问题,使用谷歌它很简单,Geocoder在 HMS 中我没有看到任何类似的东西,我一直在查看该site包,但看起来不像这样应该使用,我也看到他们确实有geocode,reverseGeocode但是在JS库中,android hms地图库中不存在这样的东西。
也许有人已经遇到过类似的问题,并且对如何使用 hms 对我的坐标进行地理编码有一些提示?
我有一个网络应用程序项目,可以向手机浏览器发送推送通知。我已成功从我的华为设备检索推送令牌,但无法从我的服务器通过 HMS Push Kit 发送通知,收到 HTTP 401 且错误正文包含:
{
"msg": "No permission to send message to these tmIDs",
"code": 80300002
}
Run Code Online (Sandbox Code Playgroud)
我已联系客户服务并被指向以下 URL,我执行了其中列出的所有操作,但仍然遇到相同的错误。
这是返回错误的 URL (POST)(从我的服务器发送,使用项目设置中的应用程序 ID):
https://push-api.cloud.huawei.com/v1/my_app_id_from_project_settings/topic:订阅
使用控制台中的 OAuth 2.0 客户端 ID/秘密(“凭据”)从以下 URL 检索访问令牌:
我还从控制台申请了华为帐号(应用服务 > 开发 > 华为帐号,使用相同的 OAuth 2.0 客户端 ID/密钥)。
我为排除故障所做的事情:
topic(字符串)和tokenArray(字符串数组,例如["token1", "token2"])Authorization: …是否可以推出华为花瓣地图,使用意图从 A 点导航到 B 点,就像谷歌地图一样?如果是,怎么办?
android android-intent huawei-mobile-services huawei-developers
I would like to support emojis for Huawei devices in my app. For all other vendors I use code like this to init EmojiCompat:
val fontRequest = FontRequest(
"com.google.android.gms.fonts",
"com.google.android.gms",
"Noto Color Emoji Compat",
R.array.com_google_android_gms_fonts_certs
)
val config = FontRequestEmojiCompatConfig(context, fontRequest)
EmojiCompat.init(config)
Run Code Online (Sandbox Code Playgroud)
But for Huawei devices, for they do not have access to google resources (my guess), it does not work, and EmojiCompat doesn't get initialized. I know that BundledEmojiCompatConfig could be used, but I would prefer always to fetch …
我正在尝试在华为设备中检索 OTP。但它不起作用。
我已经在华为开发者控制台中创建了满足所有要求的应用程序。
下面是我用来检索短信的代码。
private fun initSmsManager() {
val task = ReadSmsManager.start(this@MainActivity)
task.addOnCompleteListener {
if (task.isSuccessful) {
// The service is enabled successfully. Continue with the process.
Toast.makeText(this, "ReadSms service has been enabled.", Toast.LENGTH_LONG).show()
} else
Toast.makeText(this, "The service failed to be enabled.", Toast.LENGTH_LONG).show()
}
task.addOnSuccessListener(this, OnSuccessListener {
if(task.isSuccessful){
Toast.makeText(this, "ReadSms service has been enabled.", Toast.LENGTH_LONG).show()
myReceiver = MyBroadcastReceiver();
val intentFilter = IntentFilter(READ_SMS_BROADCAST_ACTION)
registerReceiver(myReceiver, intentFilter)
}
})
task.addOnFailureListener(this, OnFailureListener {
Toast.makeText(this,it.message,Toast.LENGTH_SHORT).show();
})
}
Run Code Online (Sandbox Code Playgroud)
广播接收器
class MyBroadcastReceiver : BroadcastReceiver() {
companion …Run Code Online (Sandbox Code Playgroud) sms-retriever-api huawei-mobile-services huawei-account huawei-developers
android ×7
appgallery ×1
bluetooth ×1
cordova ×1
database ×1
emoji ×1
fonts ×1
google-fonts ×1
java ×1
sqlite ×1