我只是想知道在Java或C#中是否存在库或外部库中的任何构建,它允许我获取音频文件并解析它并从中提取文本.
我需要申请这样做,但我不知道从哪里可以开始.
我在Galaxy s6边缘设备上有以下例外
java.lang.RuntimeException: Camera is being used after Camera.release() was called
at android.hardware.Camera.setPreviewSurface(Native Method)
at android.hardware.Camera.setPreviewDisplay(Camera.java:702)
at com.forsale.forsale.view.uicomponent.qrcode.CameraPreview.surfaceCreated(CameraPreview.java:59)
at android.view.SurfaceView.updateWindow(SurfaceView.java:712)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:316)
at android.view.View.dispatchWindowVisibilityChanged(View.java:10434)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1328)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1328)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1328)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1328)
at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1328)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1750)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7397)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
at android.view.Choreographer.doCallbacks(Choreographer.java:695)
at android.view.Choreographer.doFrame(Choreographer.java:631)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback {
private SurfaceHolder mHolder;
private Camera mCamera;
private PreviewCallback …Run Code Online (Sandbox Code Playgroud) 我有一个带有此类定义的数据类
data class AccountInfoResponse(
@SerializedName("userprofile") val userprofiles: ArrayList<UserProfile>,
@SerializedName("userpatients") val userpatients: ArrayList<UserPatient>
)
class UserPatient (
@SerializedName("sex") val sex: String,
@SerializedName("date of birth") val date_of_birth: String,
@SerializedName("address") val address: String,
@SerializedName("patientID") val patientId: Int,
@SerializedName("first name") val first_name: String,
@SerializedName("clinicName") val clinic_name: String,
@SerializedName("clinicID") val clinicId: Int,
@SerializedName("mobile") val mobile: String,
@SerializedName("last name") val last_name: String
)
Run Code Online (Sandbox Code Playgroud)
我需要将这个类转换为这样的 json 字符串
{"userpatients":[{"sex":"male","date of birth":"2010-01-03","image":"","clinics":[1],"primary_provider":[{"clinic":1,"patient":1,"providers":1}],"role":"patient","last name":"John","address":"300 east main st. San Jose, Ca 95014","first name":"John","username":"John","email":"sameh88@ensofia.com","mobile":"+88083918427"}],"userpatients":[{"sex":"female","date of birth":"2000-01-01","address":"fawal st1","patientID":1,"first name":"john","clinicName":"light house peds","clinicID":1,"mobile":"8056688042","last name":"john"}]}
Run Code Online (Sandbox Code Playgroud) 抱歉,我没有正确解释我的问题,我的问题是我有一个带有自动完成扩展器的TextBox并且它可以工作但浏览器保存我之前输入的文本所以当我开始写入我的文本框时我有两个列表出现,一个来自浏览器,一个来自自动完成
我想禁用浏览器列表并仅保留自动完成列表
如果有人可以提供帮助,我将感激不尽
提前致谢
我想在java中构建一个简单的代码生成器,它可以获取数据库连接字符串,然后为数据库中的每个表创建模型层,我不知道我该怎么做,所以如果任何人有任何教程或链接可能帮我完成这项任务,我将感激不尽
提前致谢
我在代码项目上找到了一个很好的例子,它可以获取数据库并为数据库中的表生成良好的代码,但遗憾的是它是用C#编写的,并且还生成C#代码
我不知道生成C#代码然后使用任何转换软件将它们转换为java是正确的,或者正确的方法是尝试修改它以生成java类而不是C#类
顺便说一下,该示例的链接是http://www.codeproject.com/KB/codegen/TierGenerator.aspx
我尽快得到你的建议
提前致谢
我已经下载了JDK 6,我也有sqljdb4.jar,我有database.properties文件,其中包含以下数据
database.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver database.url=jdbc:sqlserver://.;databaseName=UserInfo;integratedSecurity=true; database.username=sa database.password=admin
BN:我正在我的机器上安装服务器,服务器名称=.,我也在使用Windows Authontication
我现在的问题是当我尝试创建连接时出现以下错误
com.microsoft.sqlserver.jdbc.SQLServerException:与主机localhost,端口1433的TCP/IP连接失败.错误:连接被拒绝:连接.请验证连接属性并检查主机上是否正在运行SQL Server实例并接受端口上的TCP/IP连接,并且没有防火墙阻止与端口的TCP连接.在com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:130)
我不知道这里的确切问题是什么
如果任何人可以帮助我将不胜感激
提前致谢
我有一个包含一些数据的枚举,我也有一个资源文件,其中包含相同的枚举数据但使用不同的翻译
防爆.
enum test
{
Sun =1,
Mon = 2
}
The resource file : Text.resx
Sun --> Sunday
Mon --> Monday
Run Code Online (Sandbox Code Playgroud)
现在我想从资源文件中获取值但不使用
string data = Resources.Text.Sun;
Run Code Online (Sandbox Code Playgroud)
但是使用我的枚举值,我找到了一些代码,但我有一个例外,代码如下:
string resourceFile = "~/App_GlobalResources/Text.resx";
string filePath = System.AppDomain.CurrentDomain.BaseDirectory.ToString();
ResourceManager resourceManager = ResourceManager.CreateFileBasedResourceManager(resourceFile, filePath, null);
string resourceValue = resourceManager.GetString(myEnum.ToString());
Run Code Online (Sandbox Code Playgroud)
我得到以下例外
找不到适合磁盘上指定文化(或中性文化)的任何资源.baseName:〜/ App_GlobalResources/Text.resx locationInfo:fileName:〜/ App_GlobalResources/Text.resx.resources
请尽快帮忙
提前致谢
我正在使用whatsapp共享一些数据,当用户从whatsapp按下深层链接时,我想在我的应用中打开一个特定的活动
我有以下架构
myapp://openapp?type=banner&id=10
Run Code Online (Sandbox Code Playgroud)
whatsapp将链接作为普通文本而不是网址共享,并且当用户按下它时我也无法打开我的应用程序
有人可以帮忙吗?
编辑
这是我的分享方法
public static void openWhatsApp(Context mContext) {
PackageManager pm = mContext.getPackageManager();
try {
Intent whatsAppIntent = new Intent(Intent.ACTION_SEND);
whatsAppIntent.setType("text/plain");
String text = "myapp://openapp?type=banner&id=10";
PackageInfo info=pm.getPackageInfo("com.whatsapp", PackageManager.GET_META_DATA);
whatsAppIntent.setPackage("com.whatsapp");
whatsAppIntent.putExtra(Intent.EXTRA_TEXT, text);
mContext.startActivity(Intent.createChooser(whatsAppIntent, mContext.getString(R.string.share_with)));
} catch (NameNotFoundException e) {
Toast.makeText(mContext, "WhatsApp not Installed", Toast.LENGTH_SHORT).show();
}
}
Run Code Online (Sandbox Code Playgroud) 尝试在android studio 3中生成签名APK时,我收到以下错误
Error:trouble processing "javax/xml/namespace/QName.class":
Error:Ill-advised or mistaken usage of a core class (java.* or javax.*)
Error:when not building a core library.
Error:This is often due to inadvertently including a core library file
Error:in your application's project, when using an IDE (such as
Error:Eclipse). If you are sure you're not intentionally defining a
Error:core class, then this is the most likely explanation of what's
Error:going on.
Error:However, you might actually be trying to define a class in a core …Run Code Online (Sandbox Code Playgroud) 我正在尝试将方法从 java 转换为 kotlin 并替换AsyncTask为协程,但我不知道如何从协程返回值
这是我的方法
override fun getCompressedVideo(context:Context ,video: Uri) {
GlobalScope.launch(Dispatchers.Main) {
val inputFile = video.getRealPathFromVideoUri(context)
val loadJNI: LoadJNI = LoadJNI();
try {
val workFolder: String = context.filesDir.absolutePath
val outputFile: String = getFileFullName(
FilesConstants.VIDEO_FOLDER,
String.format(FilesConstants.VIDEO_NAME_FILE_FORMAT, System.currentTimeMillis())
);
val complexCommand = arrayOf (
"ffmpeg", "-y"
, "-i", inputFile
, "-strict", "experimental"
, "-s", "320x240"
, "-r", "25"
, "-aspect", "4:3"
, "-ab", "48000"
, "-ac", "2"
, "-vcodec", "mpeg4"
, "-movflags", "+faststart"
, "-ar", "22050"
, "-b", …Run Code Online (Sandbox Code Playgroud)