因此,我正在考虑为文本应用程序构建语音以获得乐趣.我做了一些研究,发现一个内置的Speech to Text API使用的是免费的RecognizerIntent,但也发现google现在提供了一个云语音API的收费.
我的问题是,它们之间有什么区别,如果我使用内置的RecognizerIntent,它是免费的吗?
开发者网站上描述了这一行,但我没有完全理解它
Call getInstalledApplications() or getInstalledPackages(). Both methods should return a filtered list.
Run Code Online (Sandbox Code Playgroud)
事实上,我需要测试Testing package visibility behavior
https://developer.android.com/training/package-visibility/testing
android android-package-managers android-update-app android-11
我已经尝试过蓝牙LE广告,即使用Android手机作为BLE"外围设备".启动和停止持续广告一旦正常工作,但如果我想实际传输一些不同的数据,我需要在一个周期内启动,停止和重新启动广告,并始终更改广告包.
我当然使用这些方法:
BluetoothLeAdvertiser.startAdvertising()
BluetoothLeAdvertiser.stopAdvertising()
至少在摩托罗拉Moto G 4G第二代.(XT1072)与Android 5.0.2的循环只运行一段时间,然后蓝牙堆栈出现问题,无法再启动新的广告.当快速运行循环时,这很快发生,如果运行缓慢,则需要更多时间,因此可能与某些缓冲区填满有关.
我的问题是:这是否也发生在摩托罗拉以外的其他设备上?
(当然,欢迎任何其他相关评论.)
从理论上讲,它可能依赖于一些制造商特定的HAL实现等.所以我想知道我是否应该让其他设备能够解决这个问题,因为谷歌/摩托罗拉的任何修复都需要一些时间.
这个测试应用程序 可以用来试试这个:
https://bitbucket.org/MarkusKauppinen/bleadvertisertest
如果一切顺利,它将乐意继续广告,如果这个问题再现,它将在几分钟左右的时间内显示一个对话框.如果您的设备根本不支持蓝牙LE广告或BLE,它就会崩溃.(这只是一个快速而肮脏的测试应用程序.)
另一种简单的方法是从https://github.com/devunwired/accessory-samples运行"bluetoothadvertiser"应用程序,并快速点击UI上的"更新广告"按钮一段时间.
额外细节:
蓝牙LE外设模式支持(广告需要)在Lollipop中添加,在4.x中不可用.只有某些设备具有外设模式支持.兼容性至少包含在:
https://altbeacon.github.io/android-beacon-library/beacon-transmitter-devices.html 支持Android 5 BLE外设模式 芯片组的芯片组/设备支持Android 5上的BLE外设角色
例如,这些设备应该得到支持:摩托罗拉Moto E 4G(2015),摩托罗拉Moto G 4G(第二代),索尼Xperia M4 Aqua,中兴Blade S6,摩托罗拉Moto X(2014),三星Galaxy S6,谷歌Nexus 6 ,谷歌Nexus 9,HTC One M9,三星Galaxy S6 Edge.
至于"脏细节",在此之前我总是可以在LogCat中看到"GKI_Exception":
GKI_exception():65524 getbuf:缓冲区外
在第一个"GKI_Exception"之后不久,广告以AdvertiseCallback.ADVERTISE_FAILED_INTERNAL_ERROR失败.这条线......
E/BtGatt.btif?### ASSERT:external/bluetooth/bluedroid/main /../ btif/src/btif_gatt_client.c 803行上下文传输失败!(3)###
......可能很重要,但我不熟悉BlueDroid.所述断言在这里:
一些可能相关的问题:
https://code.google.com/p/android/issues/detail?id = 65455 < - 我在此添加了一些注释和日志文件.
https://code.google.com/p/android-developer-preview/issues/detail?id=1753 在三星S4上
扫描大量BLE标签
蓝牙崩溃
我从昨天升级 flutter 后收到此错误。升级之前,iOS 和 android 上的一切正常。现在我的项目不是在 iOS 中构建的。下面是我的终端信息。
pod 设置 --verbose
WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.profile:
export LANG=en_US.UTF-8
Run Code Online (Sandbox Code Playgroud)
pod 安装 --verbose
WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.profile:
export LANG=en_US.UTF-8
[!] No `Podfile' found in the project directory.
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:151:in `verify_podfile_exists!'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command/install.rb:46:in `run'
/Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:22:in `load'
/usr/local/bin/pod:22:in `<main>'
Run Code Online (Sandbox Code Playgroud)
语言环境
LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C" …Run Code Online (Sandbox Code Playgroud) 我正在寻找蓝牙 GATT 服务列表以及每个服务的简短描述。我正在开发 BLE Android 应用程序,必须选择最好的服务。
当我的音乐播放器应用在背景上播放时,我需要一些问题的帮助.
我可以在应用程序和后台播放这两种服务的音乐.我也可以设置MPNowPlayingInfoCenter并显示正确的信息,但只有当用户使用Spotify进行身份验证时,播放/暂停,下一首曲目和之前的曲目才有效:
当用户使用Spotify进行身份验证时,应用程序会正确接收通知
但是当用户使用Apple Music进行身份验证时,它不起作用.在这种情况下,Apple Music似乎是接收通知的人.
当我AVPlayer与Apple Music SPTAudioStreamingController同步并与Spotify同步时,我正在使用它来播放音乐.
以下是媒体中心设置的代码:
- (void)setMediaCenterinfoForPlayer:(id)player {
SPTAudioStreamingController *spotifyPlayer;
AVPlayer *localPlayer;
NSMutableDictionary *trackInfo = [[NSMutableDictionary alloc] initWithDictionary: @{ MPMediaItemPropertyTitle: self.currentTrack.name,
MPMediaItemPropertyArtist: ((SPTArtist *)self.currentTrack.artists[0]).name,
MPMediaItemPropertyAlbumTitle : self.currentTrack.album.name,
MPNowPlayingInfoPropertyPlaybackRate: @(1.0)
}];
if ([player isKindOfClass:[SPTAudioStreamingController class]]) {
spotifyPlayer = (SPTAudioStreamingController *)player;
[trackInfo setObject:[NSNumber numberWithFloat:spotifyPlayer.currentPlaybackPosition] forKey:MPNowPlayingInfoPropertyElapsedPlaybackTime];
[trackInfo setObject:[NSNumber numberWithFloat:spotifyPlayer.currentTrackDuration] forKey:MPMediaItemPropertyPlaybackDuration];
} else {
localPlayer = (AVPlayer *)player;
NSTimeInterval playbackTime = [self currentPlaybackTimeForPlayer:player];
[trackInfo setObject:@(playbackTime) forKey:MPNowPlayingInfoPropertyElapsedPlaybackTime];
[trackInfo setObject:@(CMTimeGetSeconds(localPlayer.currentItem.asset.duration)) forKey:MPMediaItemPropertyPlaybackDuration];
}
[MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo …Run Code Online (Sandbox Code Playgroud)使用以下命令从 adb 设置时区:
user$ adb shell setprop persist.sys.timezone $"GMT-11.00"
Run Code Online (Sandbox Code Playgroud)
下面的错误来了:
setprop: failed to set property 'persist.sys.timezone' to 'GMT-11.00'
Run Code Online (Sandbox Code Playgroud) 我正在使用此权限
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
Run Code Online (Sandbox Code Playgroud)
检查设备是否有指纹。这就是我在 kotlin 中检查它的方式
val fingerSensorManager = FingerSensorManager(this)
fingerSensorManager.isFingerPrintAvailable()
Run Code Online (Sandbox Code Playgroud)
它工作正常,但会Android 8 and above引发异常。
如何检查指纹并在所有版本中使用它?我知道还有另一种适用于 Android 8 及更高版本的方法,但我很困惑如何实现它以便它适用于每个设备
我有自己的自定义适配器类,称为 WordAdapter,我正在使用媒体播放器(pronounce在 WordAdapter 类中命名为-global 变量)。我有不同的活动,其中每个列表项都有一个线性布局(命名为linearLayout)。我正在设置onClickListener它,以便在单击线性布局时播放声音文件。播放完那个声音后,我想释放任何不需要的记忆。但我不知道我是否应该使用release()或reset()。我之前已经检查过之前在SO上提出的问题,但我认为它没有为我的情况提供准确的解释以使用哪种方法。
注意:在此之后我也应该能够播放其他音频文件(完成播放此音频文件后,当我在同一活动中单击其他项目时,我应该能够听到声音。)
linearLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
pronounce = MediaPlayer.create(context, currentWord.getPronounceResourceID());
pronounce.start();
pronounce.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer player) {
//pronounce.release();
//pronounce.reset();
}
});
}
});
Run Code Online (Sandbox Code Playgroud) 我的 Android 应用程序中有一个 webview。当用户转到 webview 并单击链接下载文件时,没有任何反应。
我正在尝试通过在 UIDAI 网站中输入 aadhaar 编号来下载 offlineaadhaaar zip。但我无法下载文件。请检查我的代码。我试过下载监听器。但下载监听器没有被调用。
public class WebviewActivity extends AppCompatActivity {
private WebView webView;
private ProgressDialog dialog;
private ProgressDialog progress;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_webview);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
webView=(WebView) findViewById(R.id.webView);
webView.setInitialScale(0);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setSupportMultipleWindows(true);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setDisplayZoomControls(false);
webView.getSettings().setDomStorageEnabled(true);
if (Build.VERSION.SDK_INT >= 19) {
webView.setWebContentsDebuggingEnabled(false);
}
if (Build.VERSION.SDK_INT >= 26) {
webView.getSettings().setMixedContentMode(0);
}
webView.clearCache(true);
webView.clearHistory();
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webView.setScrollbarFadingEnabled(false);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("https://resident.uidai.gov.in/offlineaadhaar");
webView.setWebChromeClient(new WebChromeClient() {
@Override
public …Run Code Online (Sandbox Code Playgroud) android ×7
ios ×2
adb ×1
android-11 ×1
bluetooth ×1
flutter ×1
gatt ×1
kotlin ×1
objective-c ×1
xcode ×1