如果我使用openFileOutput()来创建和写入临时文件,如何在写完文件后获取文件大小?
我试图阻止IntelliJ将生成的文件放在我的主源文件夹中.这些生成的.java文件干扰了我与其他工具一起使用的glob规则.(想想find -name '*.java'.)
对于Android开发,我似乎能够自定义R.java从AIDL编译器生成的输出目录和文件,但IntelliJ似乎一直在创建gen/目录和BuildConfig.java在源代码树中编写文件.有什么办法可以阻止它吗?
我意识到通常,gen/文件夹是在文件夹旁边创建的src/,但在我的情况下,我使用的是:
<sourceFolder packagePrefix="com.example" />
Run Code Online (Sandbox Code Playgroud)
所以在下面gen/创建的目录com.example看起来像一个新的包(com.example.gen)而不是.
如何通过经度和纬度找到城市温度....有没有人知道我可以使用API或小部件的服务来显示基于地理坐标的天气?
我正在使用Android Stick(http://www.geekbuying.com/item/Uhost-2-Dual-Core-TV-Box-Mini-PC-Android-4-0-4-RK3066-Cortex-A9-1 -6GHZ-1GB-RAM-4G-ROM-with-Bluetooth-WIFI-Skype-XBMC --- Black-312467.html)用于构建应用程序.该应用程序使用附加的USB网络摄像头来实现其中的一些功能.此外,我将鼠标连接到此设备,用户可以使用该设备浏览应用程序中的各个页面.鼠标的左/右移动导致导航到上一页/下一页.
当鼠标与Android设备配合使用时,我还要求在与用户的每次交互后将鼠标的位置重置为中心.是否可以使用Android中的软件设置鼠标位置?我View.OnGenericMotionListener用来捕捉鼠标移动.
目前,我还需要执行主鼠标按钮单击以将鼠标置于应用程序内.我想通过在软件中生成主鼠标按钮来删除此要求,或者通过其他方式将应用程序带入软件中.
我一直无法找到任何API来实现上述功能.任何有关这些的帮助都会非常有用.
为了防止我需要编写某种驱动程序来使这个东西工作,这方面的任何帮助也会有用.
围绕这个问题的任何解决方法,虽然仍然使用鼠标,也可以证明是有用的.
关于Android和ffmpeg,我有一个非常基本的问题.我从http://bambuser.com/opensource获得了ffmpeg,并且能够为ARM编译它.
结果是二进制文件(ffmpeg)以及几个libsomething.so文件.
我的问题是:这足以解码视频吗?那我怎么实际使用ffmpeg呢?
要加载库,我有:
static {
System.load("/data/data/com.package/lib/libavcodec.so");
}
Run Code Online (Sandbox Code Playgroud)
它加载很好.那么呢?
更多解释:我看到其他项目,人们在项目的JNI目录中有他们的ffmpeg源.他们还创建了一些Android.mk文件和一些C代码.我也需要这个吗?为什么我首先创建.so文件然后再次复制ffmpeg源代码?
我知道NDK,它应该如何工作,但我从来没有见过人们如何将使用它实际调用的ffmpeg功能的例子,因为人们似乎隐藏它们的实现(这是那种可以理解),但即使不给有用的线索或例子.
我们只想说我想解码一个视频文件.我需要实现哪种本机方法?我该如何运行该项目?需要传递哪些数据类型?这里肯定有一些人至少做过这件事,我从搜索上来的时间和时间都知道这一点.
发件人ID用于c2dm的注册过程.但是没有接收消息或任何注册ID.
//Akashc2dmActivity.java文件
public class Akashc2dmActivity extends Activity implements OnClickListener {
Button Register,id;
private static PowerManager.WakeLock mWakeLock;
private static final String WAKELOCK_KEY = "C2DM_LIB";
@Override
protected void onCreate(Bundle savedInstanceState) {
if (mWakeLock == null) {
PowerManager pm = (PowerManager) Akashc2dmActivity.this
.getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
WAKELOCK_KEY);
}
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Register = (Button) findViewById(R.id.button);
Register.setOnClickListener(this);
}
public void sendRequest(View ignored) {
Log.d("Register", "hello");
Intent registrationIntent = new Intent(Constants.SEND_REGISTRATION_TO_GOOGLE);
iHaveNoClueWhatThisSettingDoesButItIsRequiredForTheIntentToWorkSoIBetterSetIt(registrationIntent);
registrationIntent.putExtra("sender", Constants.C2DM_APPLICATION_SERVER_ID);
startService(registrationIntent);
}
private void iHaveNoClueWhatThisSettingDoesButItIsRequiredForTheIntentToWorkSoIBetterSetIt(Intent registrationIntent) {
registrationIntent.putExtra("app", PendingIntent.getBroadcast(Akashc2dmActivity.this, 0, new Intent(), …Run Code Online (Sandbox Code Playgroud) 这个错误出现在日志中.
from='kutbi1@360degree/Smack' to='akash@360degree/Smack' type='error' id='hK1L6-5'>
<si xmlns='http://jabber.org/protocol/si' id='jsi_191216212994140179' mime-type='image/png' profile='http://jabber.org/protocol/si/profile/file-transfer'>
<file xmlns='http://jabber.org/protocol/si/profile/file-transfer' name='this_old_house.png' size='12623'>
<desc>You won't believe this!</desc></file>
<feature xmlns='http://jabber.org/protocol/feature-neg'>
<x xmlns='jabber:x:data' type='form'><field var='stream-method' type='list-multi'>
<option><value>http://jabber.org/protocol/bytestreams</value></option>
<option><value>http://jabber.org/protocol/ibb</value></option>
</field>
</x>
</feature>
</si>
<error code='503' type='cancel'>
<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
</error></iq>
Run Code Online (Sandbox Code Playgroud)
我在这里使用以下代码
ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(Main.connection);
if (sdm == null)
sdm = new ServiceDiscoveryManager(Main.connection);
sdm.addFeature("http://jabber.org/protocol/disco#info");
sdm.addFeature("jabber:iq:privacy");
FileTransferNegotiator.setServiceEnabled(Main.connection, true);
FileTransferManager manager = new FileTransferManager(Main.connection);
OutgoingFileTransfer transfer = manager.createOutgoingFileTransfer(id
+ "/Smack");
Log.i("transfere file", "outgoingfiletransfere is created");
try{
//OutgoingFileTransfer.setResponseTimeout(60000);
transfer.sendFile(new File(txt_file.getText().toString()), "You won't believe this!");
if (transfer.getStatus().equals(Status.cancelled) …Run Code Online (Sandbox Code Playgroud) 我正在创建一个目标为2.2的Android应用程序.我仍然想使用android.support-v4.jar.i中提供的ViewPager,想要在按钮click.i上使用以下代码禁用Viewpager swipping.但它不起作用.
public class ServiesDeail extends FragmentActivity{
ServiesTitleFragmentAdapter mAdapter;
ViewPager mPager;
int position = 0 ;
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mastermenu);
LinearLayout lnrparent = (LinearLayout) findViewById(R.id.LL_001);
LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.menu_deatil, null);
lnrparent.addView(view);
mAdapter = new ServiesTitleFragmentAdapter(getSupportFragmentManager());
mPager = (ViewPager) findViewById(R.id.pagerone);
mPager.setAdapter(mAdapter);
TitlePageIndicator indicator = (TitlePageIndicator) findViewById(R.id.indicatorone);
indicator.setViewPager(mPager,position);
Menu_Button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mPager.setClickable(false);
}
});
}
}
Run Code Online (Sandbox Code Playgroud)
如果你有任何想法...请给我回应..我等你的回应
我有一个DashClockExtension有时不更新.
它使用LocalBroadcastReceiver更新类似于http://bit.ly/1e4uMl0的扩展名.接收方在onInitialize()方法中注册:
@Override
protected void onInitialize(boolean isReconnect) {
super.onInitialize(isReconnect);
LocalBroadcastManager broadcastMgr = LocalBroadcastManager.getInstance(this);
if (mDashClockReceiver != null) {
try {
broadcastMgr.unregisterReceiver(mDashClockReceiver);
} catch (Exception ignore) {}
}
mDashClockReceiver = new DashClockUpdateReceiver();
broadcastMgr.registerReceiver(mDashClockReceiver, new IntentFilter(UPDATE_DASHCLOCK));
}
Run Code Online (Sandbox Code Playgroud)
这就是我发送广播的方式:
public static void updateDashClock() {
LocalBroadcastManager.getInstance(Application.getContext()).sendBroadcast(new Intent(UPDATE_DASHCLOCK));
}
Run Code Online (Sandbox Code Playgroud)
这是我的BroadcastReceiver:
private class DashClockUpdateReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
retrieveDataAndUpdateWidget();
}
}
Run Code Online (Sandbox Code Playgroud)
我注意到,当广播被触发时,接收器有时不会收到该事件.
我通过杀死我的应用程序来测试它,但这不会重现问题,所以我不知道为什么会发生这种情况.
任何人?
在Eclipse开始之后我收到消息"Android SDK:解决错误标记"遇到了问题.

如何在电子邮件中发送多个图像?我非常希望图像在电子邮件的正文中,而不是附加它.
我运行此代码但不起作用.
我很困惑
Abstract Class A{method();method2();}
Run Code Online (Sandbox Code Playgroud)
和其他Class B有内在的Class C
Class B{Abstract Class C{method(){//body}}}
Run Code Online (Sandbox Code Playgroud)
现在问题是如何扩展C类B/C抽象类必须扩展,否则这是Unused类.