小编K_A*_*nas的帖子

如何获得Android设备的屏幕分辨率..?

我可以获得Android手机的分辨率吗?
如果是,那么如何..?
这对我真的很有帮助..
谢谢..

android screen-resolution cordova

20
推荐指数
2
解决办法
5万
查看次数

在android上的geopoints之间绘制平滑线

我在地理位置之间画了一条线.它成功地画了.当我们看到地图时,当下一次拉伸时,画线看起来像是像素化的.如何合并线?

在此输入图像描述

我的代码在这里,

@Override
public void draw(Canvas canvas, MapView mapview, boolean shadow) {
    super.draw(canvas, mapview, shadow);
    if(! routeIsActive) return;

    mapview.getProjection().toPixels(locpoint, pp);       // Converts GeoPoint to screen pixels

    int xoff = 0;
    int yoff = 0;
    int oldx = pp.x;
    int oldy = pp.y;
    int newx = oldx + xoff;
    int newy = oldy + yoff;

    paint.setAntiAlias(true);
    paint.setDither(true);
            paint.setStrokeWidth(7);
    for(int i=0; i<numberRoutePoints-1; i++)
    {
        switch(routeMode.get(i))
        {
        case 0:
            paint.setColor(Color.parseColor("#666666"));
            break;
        case 1:
            paint.setColor(Color.parseColor("#0EA7D6"));
            break;
        case 2:
            paint.setColor(Color.parseColor("#654321"));
            break;
        case 3:
            paint.setColor(Color.parseColor("#123456"));
            break; …
Run Code Online (Sandbox Code Playgroud)

android google-maps draw

6
推荐指数
1
解决办法
1907
查看次数

如何在底部显示标签栏,-Tab with Fragment

我正在开发基于选项卡的android应用程序,我已经看到"TabActivity"类已被弃用,而是使用Fragment来实现相同的功能,我使用以下链接开发我的应用程序,现在我需要显示标签栏中的底部,我尝试了几种方法,但无法使其正常工作,

http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way/

有人可以帮我这个,我的标签布局xml

  <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    <TabHost
        android:id="@android:id/tabhost"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            >

            <TabWidget
                android:id="@android:id/tabs"
                android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_weight="0"
                />

            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="0"/>

            <FrameLayout
                android:id="@+android:id/realtabcontent"
                android:layout_width="fill_parent"
                android:layout_height="0dp"
                android:layout_weight="1"/>
        </LinearLayout>
    </TabHost>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

android android-layout

4
推荐指数
1
解决办法
8216
查看次数

Android Layout nullpointerException

我有一个非常奇怪的例外!首先我引用相对布局,然后我尝试获取其可见性状态,但活动崩溃并在getVisibilty()时抛出NullPointerException ; 我不知道为什么!,我花了很多时间试图找出问题,但我不能!,这是我的活动代码:

    setContentView(R.layout.main3d_activity);
    RelativeLayout optionLayout;
    optionLayout = (RelativeLayout) findViewById(R.id.main_optionLayout);
    int vis= optionLayout.getVisibility();
Run Code Online (Sandbox Code Playgroud)

main3d_activity代码:

    <?xml version="1.0" encoding="utf-8"?> 
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/MainLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <include
        android:id="@+id/include_headerbar"
        android:layout_width="fill_parent"
        android:layout_height="60dp"
        layout="@layout/headerbar_layout" />
    <include
        android:id="@+id/include_footerbar"
        android:layout_width="fill_parent"
        android:layout_height="60dp"
        android:layout_alignParentBottom="true"
        layout="@layout/footerbar_layout" />

    <ViewFlipper
        android:id="@+id/vf"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/include_footerbar"
        android:layout_below="@+id/include_headerbar" >

        <include
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            layout="@layout/container_mainlayout" />

        <include
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            layout="@layout/living_layout" />

        <include
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            layout="@layout/bedroom_layout" />

        <include
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            layout="@layout/childrenbedroom_layout" />

        <include
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            layout="@layout/kitchen_layout" />

        <include
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            layout="@layout/dinningroom_layout" />

        <include
            android:layout_width="match_parent"
            android:layout_height="match_parent" …
Run Code Online (Sandbox Code Playgroud)

android nullpointerexception android-layout

2
推荐指数
1
解决办法
3176
查看次数

在GridView中加载多个大图像的最佳方法

我的问题涉及内存,我有一个Web服务,为我提供了一个URL列表.每个URL对应一个大图像.我的移动应用程序必须解析Web服务提供的xml,而不是在GridView中显示这些图像.我尝试了几个功能,以显示图像,如:

  • 多线程

  • 延迟加载

  • 使用inSampleSize 缩小图像大小(这会导致我的应用程序耗时太长)

我是否必须为每个大图像附加缩略图图像,并使网络服务返回给我所有缩略图的列表,然后向用户显示这些缩略图,如果他点击其中一个,我必须显示在一个单独的视图中的大图像,我有这个想法,因为我注意到当我显示一个图像,我没有得到一个outofMemory异常!

这是一个可靠的解决方案有更好的方法吗?

android gridview image

2
推荐指数
1
解决办法
4168
查看次数

什么是暖缓存?

在热缓存中运行程序是什么意思?

哪位好心人能解释一下。

热缓存是否意味着......查询时给出缓存命中的缓存?

caching warm-up

1
推荐指数
1
解决办法
1460
查看次数

销售队伍与Android?

我想从我的 Android 程序中连接销售人员,请建议哪一种是实现这一目标的正确方法我是销售人员的新手 我对 Android 应用程序开发有一些了解。

提前致谢。

android salesforce

1
推荐指数
1
解决办法
5124
查看次数