我正在开发针对SPECIFIC品牌手机的Android应用程序 - 这是项目要求而不是我的决定.
因此,我需要能够在Android市场中将该应用程序仅用于由该SPECIFIC制造商生产的那些设备.
我似乎无法找到如何做到这一点.
可能吗?
PS我可以在android代码中检索设备make.所以我怀疑市场应用程序应该能够通过设备make过滤.我只是不知道它是否确实如此(如果它确实会很好).
我正在为android开发一个SYSTEM应用程序来管理设备上的用户帐户.
有没有办法将付费用户应用程序从一个帐户转移到另一个帐户?
任何帮助都表示赞赏(即使答复没有直接针对解决方案).
到目前为止,我能够设置MediaCodec来编码视频流.目的是将用户生成的图稿保存到视频文件中.
我使用用户图稿的android Bitmap对象将帧推送到流中.
请参阅我在本文底部使用的代码片段(它是完整的代码,没有任何修剪):
MediaCodec使用ByteBuffer处理视频/音频流.
位图基于int [],如果转换为byte []将需要x4 int []的大小
我做了一些研究,以确定在处理MediaCodec中的视频/音频流时ByteBuffer的合同是什么,但信息几乎接近于zilch.
那么,MediaCodec中的ByteBuffer使用合约是什么?
在MediaFormat中指定帧尺寸是否自动意味着ByteBuffers具有宽度*高度*4字节容量?
(我每帧都使用一个位图对象)
谢谢你的帮助.
(已编辑,已添加代码)
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.nio.ByteBuffer;
import android.graphics.Rect;
import android.graphics.Bitmap.CompressFormat;
import android.media.MediaCodec;
import android.media.MediaCodec.BufferInfo;
import android.media.CamcorderProfile;
import android.media.MediaCodecInfo;
import android.media.MediaFormat;
import android.util.Log;
import android.view.View;
public class VideoCaptureManager {
private boolean running;
private long presentationTime;
public void start(View rootView, String saveFilePath){
Log.e("OUT", saveFilePath);
this.running = true;
this.presentationTime = 0;
this.capture(rootView, saveFilePath);
}
private void capture(final View rootView, String saveFilePath){
if(rootView != …Run Code Online (Sandbox Code Playgroud) 我做了一些研究,偶然发现了以下(可能是非官方的)url,用于从android play store查询应用程序详细信息.但基于非官方的谷歌市场API,我猜这个是使用身份验证令牌
http://android.clients.google.com/market/api/ApiRequest
Run Code Online (Sandbox Code Playgroud)
显然有一种方法可以在不登录Google帐户的情况下请求Android应用程序详细信息 - 这就是Google在网络浏览器中浏览网站时的工作方式.
我无法找到关于如何实际做到这一点的任何指导.
我开发的项目中没有任何非官方的库或代码,它也不能使用任何私有的android API.
我还想到了以下链接,这显然不是官方的谷歌API链接(换句话说,不是100%值得信赖,如果没有事先通知,它不会改变)
https://androidquery.appspot.com/api/market?app=(put the package name here)
Run Code Online (Sandbox Code Playgroud)
但我想任何可能的解决方案都应该类似于此链接在内部执行的内容.
那么,如何构建一个有效的请求谷歌播放商店来检索应用信息(请求网址,参数,参数格式,cookie等)?
我在我的Android应用程序中使用webview,但是在它完成加载后 - 我可以通过onPageFinished(WebView webview,String url)检测到 - 页面继续无限增长.
我怎样才能防止这种情况发生?
这就是我的工作.
我有一个包含ScrollView的通用页面模板.宽度和高度设置为与父级匹配.在ScrollView中,我创建的所有活动都有几个常见元素.其中一个是LinearLayout,我插入所有用户内容.
.....
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_margin="0dp"
android:padding="0dp"
android:scrollbars="none"
>
......
<LinearLayout
android:id="@+id/content"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:padding="0dp"
android:orientation="vertical">
//EVERY USER CONTENT GOES HERE
</LinearLayout>
......
</ScrollView>
Run Code Online (Sandbox Code Playgroud)
.....
在此特定情况下,内容是网页,使用移动网络API加载Google地图.这是布局文件
<?xml version="1.0" encoding="utf-8"?>
<WebView
android:id="@+id/maps"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_margin="0dp"
android:padding="0dp"
/>
Run Code Online (Sandbox Code Playgroud)这是我的活动的代码,初始化webview
.... WebView wv =(WebView)this.content.findViewById(R.id.maps);
WebSettings ws = wv.getSettings();
ws.setPluginState(PluginState.ON);
ws.setSupportZoom(false);
ws.setLightTouchEnabled(true);
ws.setDomStorageEnabled(true);
ws.setAppCacheMaxSize(1024 * 1024 * 8);
ws.setAppCachePath(context.getCacheDir().getAbsolutePath());
ws.setAppCacheEnabled(true);
ws.setAllowFileAccess(true);
ws.setCacheMode(WebSettings.LOAD_NORMAL);
ws.setJavaScriptEnabled(true);
wv.setInitialScale(0);
wv.addJavascriptInterface(new Object(), "Android");
wv.setKeepScreenOn(true);
Run Code Online (Sandbox Code Playgroud)最后,当我通过wv.loadUrl("......")加载地图时;
页面完成加载后,我得到以下日志,webview在无限循环中增长
02-18 14:16:06.195: …Run Code Online (Sandbox Code Playgroud) Kindda奇怪的情况......
我有一个ImageView,它有一个与之关联的点击互动.
在代码中,我通过动画更改ImageView的位置.
但是当动画结束时,可点击区域仍然在ImageView的原始位置(我实际上可以点击该区域并看到正在处理的点击).
做过一些研究,似乎动画只会移动视图像素,视图仍然保留原来的位置.
作为对android的批评 - 这不是一个直观的设计/实现.这不符合"你所看到的就是你得到的"标准.
我的问题是
有没有办法(除了在两个不同的ImageView之间切换)使可点击区域移动到视图像素所在的位置?
我的布局和动画xml结构如下.
布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keywords_layer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="0dp"
android:padding="0dp"
android:orientation="vertical"
android:visibility="gone"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="35dp"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="35dp"
android:layout_centerInParent="true"
android:adjustViewBounds="false"
android:scaleType="fitXY"
android:src="@drawable/keyword_bar_handle"
/>
<ImageView
android:id="@+id/bar_handle"
android:layout_width="45dp"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:adjustViewBounds="false"
android:scaleType="fitXY"
/>
</RelativeLayout>
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="@dimen/browser_address_bar_1_5_height"
android:layout_margin="0dp"
android:padding="0dp"
android:background="@drawable/keyword_bar_bg"
android:scrollbars="none"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="@dimen/browser_address_bar_1_5_height"
android:layout_margin="0dp"
android:padding="0dp"
/>
</HorizontalScrollView>
Run Code Online (Sandbox Code Playgroud)
动画:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator"
android:fillEnabled="true"
android:fillAfter="true">
<translate
android:fromYDelta="60"
android:toYDelta="0"
android:duration="300"
/>
</set>
Run Code Online (Sandbox Code Playgroud)
在这里,布局与屏幕底部对齐,需要平滑切换 …
在我将android和eclipse工具升级到v20后,发生了一些奇怪的错误
通过Ant构建在创建签名的apk时停止使用以下错误
BUILD FAILED
C:\Programs\Android\tools\ant\build.xml:1097: The following error occurred while executing this line:
C:\Programs\Android\tools\ant\build.xml:1109: Cannot recover key
Run Code Online (Sandbox Code Playgroud)
知道在升级到Android JB组件时可能会有什么变化,怎么能纠正这个?
我感谢任何帮助......
我面临的问题似乎没有解决方案,而且完全不可能纠正,但我想在这里问,以防万一我遗漏了什么。
我需要使用 asset 文件夹中的非系统、非标准字体在 android 小部件中显示一些文本。
不幸的是,Android 不允许在主屏幕小部件中扩展视图定义。我也无法从小部件内调用相应的 API 方法 (setTypeface)。
有谁知道是否还有其他替代方法可以实现此目的?(不仅在应用程序中而且在小部件中都能够自定义文本视图外观似乎很自然,但事实证明这是不可能的)。
我将不胜感激任何帮助。
谢谢...