我正在尝试将PNG文件转换为单片视频片段,以便在项目中启动.
我有什么代码来实现它是: -
private boolean MediaConversion()
{
MediaCodec codec = MediaCodec.createEncoderByType(MIMETYPE);
MediaFormat mediaFormat = null;
if(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_720P)){
mediaFormat = MediaFormat.createVideoFormat(MIMETYPE, 1280 , 720);
} else {
mediaFormat = MediaFormat.createVideoFormat(MIMETYPE, 720, 480);
}
mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, 700000);
mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, 10);
mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar);
mediaFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 5);
codec.configure(mediaFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
codec.start();
ByteBuffer[] inputBuffers = codec.getInputBuffers();
ByteBuffer[] outputBuffers = codec.getOutputBuffers();
boolean sawInputEOS = false;
int inputBufferIndex= -1, outputBufferIndex= -1;
BufferInfo info=null;
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
Bitmap bitmap = null;
try {
bitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.image);
Log.e("Uploaded", "Bitmap:" …Run Code Online (Sandbox Code Playgroud) 我的应用程序在Android OS Lollipop中运行时,后台出现以下异常.无法在我的代码中弄清楚它的确切位置或对它的任何引用.
02-23 17:58:14.145: E/System(16417): Uncaught exception thrown by finalizer
02-23 17:58:14.146: E/System(16417): java.lang.NullPointerException: Attempt to invoke virtual method 'void dalvik.system.CloseGuard.close()' on a null object reference
02-23 17:58:14.146: E/System(16417): at java.io.FileInputStream.close(FileInputStream.java:113)
02-23 17:58:14.146: E/System(16417): at java.io.FileInputStream.finalize(FileInputStream.java:140)
02-23 17:58:14.146: E/System(16417): at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:190)
02-23 17:58:14.146: E/System(16417): at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:173)
02-23 17:58:14.146: E/System(16417): at java.lang.Thread.run(Thread.java:818)
Run Code Online (Sandbox Code Playgroud)
以前有人遇到过吗?
我想在数据库中保存工作日,所以我想通过为每天分配int值来存储它.即
1 - >选中, 0 - >未选中.
星期一= 0/1
星期二= 0/1
.....
星期日= 0/1.
但这将在DB中生成 7列.所以我想如果我将它存储在一个数组中并检索值以供进一步使用,是否有人可以帮助我.我正在通过互联网阅读一些例子,但没有轻易得到它.
我正在尝试在Android WebView中使用CSS3动画,但是在启动动画时(大约500ms)我会遇到非常恼人的延迟.
动画运行平稳,无滞后,但开始时有延迟.由于没有滞后,我认为这不是性能问题.或者它可能是?
这不是默认的300ms onclick延迟,我已经改为ontouchstart,当我做除了动画/过渡之外的任何事情时,没有延迟.只有这两个.
它也不是动画延迟属性,我已经将它设置为0.
任何可能的解释/解决方案
PS:我正在尝试运行的动画/转换是transform: translateX()属性.之前,我正在尝试left: Xpx,但它在动画期间滞后.随着变换,没有滞后,但有延迟.
delay webview android-webview css-transitions css-animations
我已经在我的Android应用程序中集成了Quickblox SDK V2.2.5以与Social Integration Twitter一起工作,但它会抛出错误:'{"errors":["Bad Authentication data"]}'
以下是我的代码: -
// If in the below code I use static TOKEN & TOKEN-SECRET generated by my iOS app then it works well, whereas it is not working with Android generated TOKEN & its SECRET.
QBUsers.signInUsingSocialProvider(QBProvider.TWITTER,
preferences.getTwitterToken().trim(),
preferences.getTwitterTokenSecret().trim(),
new QBEntityCallbackImpl<QBUser>() {
@Override
public void onSuccess(QBUser user, Bundle args) {
Log.d("Login was successful", "user: " + user.toString());
}
@Override
public void onError(List<String> errors) {
Log.e("Twitter Login", "Error: " + …Run Code Online (Sandbox Code Playgroud) 当我在 Apache flink 中运行SocketWindowWordCount程序时,它显示一个
警告:org.apache.flink.api.java.ClosureCleaner 的非法反射访问
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.apache.flink.api.java.ClosureCleaner (file:/home/aman.srivastava/Downloads/flink-1.10.0/lib/flink-dist_2.11-1.10.0.jar) to field java.lang.String.value WARNING: Please consider reporting this to the maintainers of org.apache.flink.api.java.ClosureCleaner WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Job has been submitted with JobID a4badaa76080e47e82a322a4e2060e45
我正在尝试使用"位置名称"(即"国家/地区名称")将MapView中的动画设置为某个位置.我得到了例外:

如果你看不到pic那么异常是:: IOException:服务不可用有错误无法获得连接工厂客户端.
我使用的代码如下:
public class ShowMapView extends MapActivity
{
MapView mapView;
MapController mapController;
String Country;
@Override
public void onCreate(Bundle bundleMap)
{
super.onCreate(bundleMap);
setContentView(R.layout.show_map);
mapView = (MapView)findViewById(R.id.MapView);
LinearLayout zoomLayout = (LinearLayout)findViewById(R.id.zoom);
View zoomView = mapView.getZoomControls();
zoomLayout.addView(zoomView,
new LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
mapView.setBuiltInZoomControls(true);
Intent intent = this.getIntent();
Country = intent.getStringExtra("Country");
Geocoder geocoder = new Geocoder(this, Locale.getDefault());
Log.v("GEOCODER", geocoder.toString());
try
{
Log.v("MAP", "TRY BLOCK");
List<Address> address = geocoder.getFromLocationName(Country, 2);
Log.v("MAP", "Country: " + Country);
if(address.size() > 0)
{ …Run Code Online (Sandbox Code Playgroud) 我从Web服务中获取GridView的图像和文本,因此需要一些时间来显示GridView.我想显示一个ProgressDialog,直到Grid完全加载.我到现在所做的如下:
public class PCGridMain extends Activity
{
WebService web = new WebService();
private GridView gridView;
ProgressDialog dialog;
Bitmap icon;
int i, total;
URL url= null;
List<GridItem> list;
@Override
public void onCreate(Bundle grid)
{
super.onCreate(grid);
dialog = ProgressDialog.show(PCGridMain.this, "Loading...", "Loading App, Please wait.", true);
DialogWork dWork = new DialogWork();
dWork.execute();
setContentView(R.layout.main);
gridView = (GridView)findViewById(R.id.gridView1);
web.WebService1();
total = web.totalService;
list = new ArrayList<GridItem>();
for(i=0; i<total; i++)
{
Log.v("Try Block", "See what we get:-");
try
{
Log.v("GridMain", "try url" + Integer.toString(i));
url = …Run Code Online (Sandbox Code Playgroud) android ×7
arraylist ×1
delay ×1
jakarta-mail ×1
mediacodec ×1
quickblox ×1
smtp ×1
sqlite ×1
twitter ×1
webview ×1