我在Play商店中放了一个应用程序,我的朋友,运行4.1(Nexus 7),在尝试安装我的应用程序时收到以下消息:"您的设备与此版本不兼容".为什么会这样?请任何人帮助我.
Manifeast file
< ?xml version="1.0" encoding="utf-8"?>
< manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ibkr.pcg"
android:versionCode="3"
android:versionName="1.1">
< uses-sdk android:minSdkVersion="7"
android:targetSdkVersion="8"/>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" ></uses-permission>
<!-- C2DM Permissions Start -->
<!-- Only this application can receive the messages and registration result -->
<permission android:name="com.ibkr.pcg.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.ibkr.pcg.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive message -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- End of the C2DM Permissions -->
<application android:icon="@drawable/pcgicon"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:name="MyApplication"
android:debuggable="true">
<activity android:name=".PriceCheckGuruSplash"
android:label="@string/app_name"> …Run Code Online (Sandbox Code Playgroud) 我有一个网址,我试图在JavaFX的Web视图中打开该URL,但内容与Web视图不兼容.它只与chrome和firefox兼容.所以我想只在Chrome浏览器中打开Url,而不是在Web视图中打开它.有可能吗?(我不想在默认浏览器中打开它.)
我尝试了下面的代码,但我们得到错误为"无法运行程序"chrome":错误= 2,没有这样的文件或目录".
Runtime.getRuntime().exec(new String[] { "Chrome", "http://goo.gl/EsomR0" });
Run Code Online (Sandbox Code Playgroud)
谢谢,
我是Android中的Graph概念的新手.在我的应用程序中,我想使用achartengine实现线图.我有achartengine的演示,它包含很多代码.我无法理解折线图.我想要使用achartengine的简单线图.请任何人帮助我.
谢谢
我是jquery移动框架的新手.我使用jquery mobile实现了示例应用程序.现在我想将此应用程序部署到设备中.我不知道如何部署这个?请任何人帮助我.
Sample Application
<!DOCTYPE html>
<html>
<head>
<title>My Page< /title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header" data-theme="b">
<h1>My Title</h1>
</div><!-- /header -->
<div data-role="content">
<p>Hello world</p>
</div><!-- /content -->
<div data-role="footer">
<h1>End of the page</h1>
</div>
</div><!-- /page -->
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
谢谢
我想在收音机组中的单选按钮旁边设置视图.我试过但我没有得到.请任何人帮助我.
源代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#FFFFFF">
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:checkedButton="@+id/view_completehistroy_rb"
android:id="@+id/timeframe_group">
<!-- View complete history Radio Button -->
<RadioButton
android:text="Complete History"
android:textSize="16sp"
android:layout_marginLeft="5dp"
android:id="@+id/view_completehistroy_rb"
android:textColor="#000000"
/>
<!-- View history using date range Radio Button -->
<RadioButton
android:text="From"
android:textSize="16sp"
android:layout_marginLeft="5dp"
android:textColor="#000000"
android:id="@+id/view_daterange_history_rb"/>
</RadioGroup>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<!--Layout for Time selection -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="5dp"
android:layout_toRightOf="@id/view_daterange_history_rb">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:text="test1"
android:textColor="#000000"
android:textSize="16sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:text="test2"
android:textColor="#000000"
android:textSize="16sp"/>
</LinearLayout>
</RelativeLayout> …Run Code Online (Sandbox Code Playgroud) 我是新来的。我有一张桌子有3列
1. Id
2. FoodName
3. Date and time
(ex: '1' 'Chicken' '2012-08-10 13:54')
Run Code Online (Sandbox Code Playgroud)
我在某处阅读了Android sqlite不提供日期数据类型的信息。
因此,我使用文本数据类型将日期存储在本地数据库中。工作正常。
现在,我想编写一个查询来检索两个日期之间的记录。我尝试过,但没有得到。
== >>代码
public class FoodDB {
//Database Related Constants
public static final String KEY_ROWID = "id";
public static final String KEY_NAME = "fooditem";
public static final String KEY_TIMESTAMP = "timestamp";
private static final String DATABASE_NAME = "AJFoodDB";
private static final String DATABASE_TABLE = "AJ_Food";
private static final int DATABASE_VERSION = 1;
Cursor c;
long id;
private static final String DATABASE_CREATE =
"create …Run Code Online (Sandbox Code Playgroud) 嗨我有arraylist它存储字符串值.我想检查一下列表中是否存在某些字符串.在这里,我想忽略区分大小写.
码
public static ArrayList< String > arrFoodItems = new ArrayList< String >();
if(arrFoodItems.contains("string"))
{
System.out.println("already available in the List.");
}
else
{
System.out.println("Not available");
}
Run Code Online (Sandbox Code Playgroud)
它工作正常.但是在下面的示例中它失败了.如何在不使用循环的情况下完成.示例:列表包含:"Rice,Chicken,..."现在您要检查列表中的"rice"是否已退出.在这种情况下,我们得到"不存在".
不要使用这个
for(int i=0; i < arrFoodItems.size(); i++)
{
if(arrFoodItems.get(i)..equalsIgnoreCase(string))
{
System.out.println("already available in the List.");
}
}
Run Code Online (Sandbox Code Playgroud) 我在sdcard中实现了从相机相册中获取图像的应用程序.但它无法正常工作.
这里Intent返回如此Intent {act = com.htc.HTCAlbum.action.ITEM_PICKER_FROM_COLLECTIONS dat = content:// media/external/images/media/9 typ = image/jpeg(has extras)}
在代码中
位图缩略图=(位图)data.getExtras().get("data");
这里(Bitmap)data.getExtras().get("data")
这部分返回null.
如何在这里获取位图请任何人帮助我.
码:
cam_images_btn.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
Intent cam_ImagesIntent = new Intent(Intent.ACTION_GET_CONTENT);
cam_ImagesIntent.setType("image/*");
startActivityForResult(cam_ImagesIntent, CAMERA_IMAGES_REQUEST);
}
});
if(requestCode == CAMERA_IMAGES_REQUEST && resultCode==Activity.RESULT_OK)
{
System.out.println("data(CAMERA_IMAGES_REQUEST):"+data);
if(data != null)
{
Bitmap thumbnail = (Bitmap) data.getExtras().get("data");
System.out.println("Bitmap(CAMERA_IMAGES_REQUEST):"+thumbnail);
System.out.println("cap_image(CAMERA_IMAGES_REQUEST):"+cap_image);
cap_image.setImageBitmap(thumbnail);
}
else
{
System.out.println("SDCard have no images");
Toast.makeText(camera.this, "SDCard have no images", Toast.LENGTH_SHORT);
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢
我试图使用ksoap库向Web服务发送一个double值.这是我尝试过的,但它不起作用.任何人都可以解释如何使这项工作.
public String getDataForStaticSearch() throws SoapFault
{
String data = "";
String serviceUrl = RB_Constant.RB_Webservice_URL;
String serviceNamespace = RB_Constant.RB_Webservice_Namespace;
String soapAction = "http://www.roadbrake.com/GetSearchResultsV2";
String type_of_soap = "GetSearchResultsV2";
PropertyInfo headingdirectionObj = new PropertyInfo ();
headingdirectionObj.name = "headingdirection";
headingdirectionObj.type = PropertyInfo.INTEGER_CLASS;
try
{
SoapObject Request = new SoapObject(serviceNamespace, type_of_soap);
// strUserLatitude and strUserLongitude are of type double.
// How to pass these values to ws.
Request.addProperty("strUserLatitude", 33.924012);
Request.addProperty("strUserLongitude", -118.3832772);
//headingdirectionObj is of type int
Request.addProperty(headingdirectionObj, 0);
System.out.println("Request Value->"+Request.toString());
SoapSerializationEnvelope envelope = new …Run Code Online (Sandbox Code Playgroud) 我的应用程序有5个活动(A1,A2,A3,A4,A5).每个活动都有一个文本视图和一个按钮(B1,B2,B3,B4,B5).如果单击该按钮,则转到下一个活动.假设你单击B1按钮然后它进入A2活动,并且每个活动还有一个菜单按钮(Logout),如果你单击该按钮,它将退出应用程序.但它没有用.在这里,我为每个活动调用使用以下代码.
清除堆栈
Intent intent = new Intent(act1.this,act2.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
在Logout按钮中单击监听器,我使用.完成当前活动.finish()因为我们很清楚堆栈使用FLAG_ACTIVITY_CLEAR_TOPnow stack只包含当前活动,这就是我刚刚完成当前活动的原因.但是如果你单击Logout按钮,它只会完成当前的动作.它不会退出应用程序.这里使用该语句清除或不清除堆栈FLAG_ACTIVITY_CLEAR_TOP.以下是我的代码可以任何人帮助我.
行动一
public class logout extends Activity
{
TextView tv;
Button next;
public static final int logout_menu = Menu.FIRST+1;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = (TextView) findViewById(R.id.text);
tv.setText("activity1");
Button next = (Button) findViewById(R.id.button);
next.setOnClickListener(nextListener);
}
private OnClickListener nextListener = new OnClickListener()
{
public void onClick(View v)
{
try
{
Intent …Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我正在从网上下载图像.我得到了外出记忆异常.有人建议使用以下代码清除堆.但我仍然面临着内存不足的例外.任何人都可以帮助我.活动开始时调用以下方法.在这里我指的是这个链接
public void onStart()
{
super.onStart();
//Handling the out of memory exception
logHeap(this.getClass());
}
public static void logHeap(Class clazz) {
Double allocated = new Double(Debug.getNativeHeapAllocatedSize())/new Double((1048576));
Double available = new Double(Debug.getNativeHeapSize()/1048576.0);
Double free = new Double(Debug.getNativeHeapFreeSize()/1048576.0);
DecimalFormat df = new DecimalFormat();
df.setMaximumFractionDigits(2);
df.setMinimumFractionDigits(2);
System.out.println("debug. =================================");
System.out.println("debug.heap native: allocated " + df.format(allocated) + "MB of " + df.format(available) + "MB (" + df.format(free) + "MB free) in [" + clazz.getName().replaceAll("com.myapp.android.","") + "]");
System.out.println("debug.memory: allocated: " + df.format(new Double(Runtime.getRuntime().totalMemory()/1048576)) + "MB …Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我有一些网址使用这些网址我正在从网上下载图像并在我的应用程序中使用这些图像.在哪里存储这些图像?因为我的应用程序有很多图像在那里.建议最好的方式,即,这种方式没有机会得到"内存异常".请任何人帮助我.
我使用以下方式是好还是坏.任何人都可以建议我.
谢谢
在我的应用程序中,我想显示两个地理点之间的方向.因为我使用了地图应用程序.但它显示了移动提供的不同选项,如跟随图像.但我想显示方向而不问这个.可能吗?请任何人帮助我.
String directionweburl = "http://maps.google.com/maps?daddr="+dest_lat+","+dest_long+"&saddr="+source_lat+","+source_long;
Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(directionweburl));
startActivity(myIntent);
Run Code Online (Sandbox Code Playgroud)

更新
最初它显示如下

但我想直接表现出如下可能吗?
