在我的应用程序中,我想确定用户的当前位置.但是我在这方面有几个问题:
我有什么:目前我的应用程序只告诉我当前位置的坐标.
我想要的:从gps提取的坐标中获取位置名称,以便我可以知道我到底在哪里.(位置名称)
我使用以下代码.图像已保存,但它是黑色的.
请看我的代码并告诉我我做错了什么.
我在菜单中使用此代码.
case R.id.id_menu_Save:
Bitmap bmp = SavePixels(0, 0, 800, 400, CCDirector.sharedDirector().gl);
File file = new File("/sdcard/test.jpg");
try
{
file.createNewFile();
FileOutputStream fos = new FileOutputStream(file);
bmp.compress(CompressFormat.JPEG, 100, fos);
Toast.makeText(getApplicationContext(), "Image Saved", 0).show();
Log.i("Menu Save Button", "Image saved as JPEG");
}
catch (Exception e)
{
e.printStackTrace();
}
break;
Run Code Online (Sandbox Code Playgroud)
这是我的保存图像功能.
public static Bitmap SavePixels(int x, int y, int w, int h, GL10 gl)
{
int b[]=new int[w*(y+h)];
int bt[]=new int[w*h];
IntBuffer ib=IntBuffer.wrap(b);
ib.position(0);
gl.glReadPixels(x, 0, w, y+h, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, ib);
for(int …Run Code Online (Sandbox Code Playgroud) 我正在使用一个简单的函数OnActivityResult,但它没有返回我想要的结果.
请看我的代码并告诉我我在哪里做错了.
public void OnClickFunction(View view)
{
Intent intent = new Intent(getApplicationContext(), Second.class);
startActivityForResult(intent, RESULT_OK);
/// My actions. . .
}
Run Code Online (Sandbox Code Playgroud)
然后在第二课中,我将结果设置为:
Button.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
ValueOne = EditText.getText().toString().trim();
if (ValueOne.equals(String.valueOf(Answer)))
{
Toast.makeText(getApplicationContext(), "Correct Answer", 0).show();
Second.this.setResult(RESULT_OK, null);
Second.this.finish();
}
else
{
Toast.makeText(getApplicationContext(), "Wrong Answer", 0).show();
}
}
});
Run Code Online (Sandbox Code Playgroud)
现在回到第一个类,从那里调用Intent:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
super.onActivityResult(requestCode, resultCode, data);
// if (requestCode == RESULT_OK)
// {
if (resultCode == RESULT_OK)
{ …Run Code Online (Sandbox Code Playgroud) 到目前为止,我搜索了很多关于解密whatsapp db file扩展的内容,
.db.crypt5
但没有办法对我有用.我尝试了一个Crypto.class,可以在stackoverflow链接中看到很多东西来读取WhatsApp数据库文件,但该文件对我来说也不起作用.
这是我的Crypto.class :
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.spec.SecretKeySpec;
import android.util.Log;
public class Crypto
{
public FileInputStream mIn;
public FileOutputStream mOut;
public Crypto(String fileIn, String fileOut)
{
try
{
mIn = new FileInputStream(new File(fileIn));
mOut = new FileOutputStream(new File(fileOut));
decrypt(mIn, mOut);
}
catch (Exception e)
{
e.printStackTrace();
}
}
public static void decrypt(InputStream in, FileOutputStream out) throws Exception
{
final String string = …Run Code Online (Sandbox Code Playgroud) 我想从字符串中读取数据.db.crypt file是否有任何lib或方法来解密此文件中的数据?
如果是,那么请指点我或提供任何样品.
我碰到的条款来LIVE IP和静态IP,并对其做了研究,但未能找到它们之间的区别有用的信息.
有人可以向我解释一下这个区别吗?
我已经制作了一个工作正常的小部件,而且我已经制作并且应用程序也很好用.
现在我想将这个小部件集成到我的应用程序中,这样两者都在同一个包中.
我怎样才能做到这一点 ??
我是否必须在清单文件中进行更改.
我已经完成了R&D,但所有链接都是从一开始就开发小部件..没有在集成上.
我见过很多但没有找到任何帮助.请帮助我这方面.
提前致谢.
我有什么:
现在我有一个Scroll视图作为父母.在这个滚动视图中,我使用的是一个加载URL然后在其中显示文本的WebView.这是我的xml:
<ScrollView
android:id="@+id/parentScroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/Heading" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp" >
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="300dp"
android:background="@drawable/webview" />
</RelativeLayout>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)
我想要的是:
我想在其中滚动webView.当我触摸webView时,很遗憾地会调用父滚动视图.我还要保留父滚动视图,但除此之外,我想在我触摸webView时滚动其中的WebView内容.
我怎样才能做到这一点?
我通过ProxySettings类在我的应用程序中启用了代理,但现在我想禁用它,以便ON/OFF代理按钮可以工作.
我搜索并尝试了很多,但我找不到停止代理的方法并继续使用常规Wi-Fi ......
我尝试从Stack Overflow获得的ProxySettings类中的以下代码:
public static void resetProxy(Context ctx) throws Exception
{
Object requestQueueObject = getRequestQueue(ctx);
if(requestQueueObject != null)
{
setDeclaredField(requestQueueObject, "mProxyHost", null);
}
}
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
android ×9
location ×2
database ×1
ip ×1
ip-address ×1
proxy ×1
screenshot ×1
scrollview ×1
webview ×1
whatsapp ×1