Example usage for android.content.pm PackageManager FEATURE_TOUCHSCREEN_MULTITOUCH

List of usage examples for android.content.pm PackageManager FEATURE_TOUCHSCREEN_MULTITOUCH

Introduction

In this page you can find the example usage for android.content.pm PackageManager FEATURE_TOUCHSCREEN_MULTITOUCH.

Prototype

String FEATURE_TOUCHSCREEN_MULTITOUCH

To view the source code for android.content.pm PackageManager FEATURE_TOUCHSCREEN_MULTITOUCH.

Click Source Link

Document

Feature for #getSystemAvailableFeatures and #hasSystemFeature : The device's touch screen supports multitouch sufficient for basic two-finger gesture detection.

Usage

From source file:Main.java

/**
 * A single feature that can be requested by an application.
 * This corresponds to information collected from the AndroidManifest.xml's tag.
 * @param feature "FeatureInfo"/*from   ww  w  .j a  v  a2 s.  c om*/
 */
@SuppressWarnings("deprecation")
public static String getFeature(String feature) {
    if (TextUtils.isEmpty(feature)) {
        return UNKNOWN;
    }

    switch (feature) {
    case PackageManager.FEATURE_APP_WIDGETS://android.software.app_widgets
        return "FEATURE_APP_WIDGETS";
    case PackageManager.FEATURE_AUDIO_LOW_LATENCY://android.hardware.audio.low_latency
        return "FEATURE_AUDIO_LOW_LATENCY";
    case PackageManager.FEATURE_AUDIO_OUTPUT://android.hardware.audio.output
        return "FEATURE_AUDIO_OUTPUT";
    case PackageManager.FEATURE_AUDIO_PRO://android.hardware.audio.pro
        return "FEATURE_AUDIO_PRO";//API 23
    case PackageManager.FEATURE_AUTOMOTIVE://android.hardware.type.automotive
        return "FEATURE_AUTOMOTIVE";//API 23
    case PackageManager.FEATURE_BACKUP://android.software.backup
        return "FEATURE_BACKUP";
    case PackageManager.FEATURE_BLUETOOTH://android.hardware.bluetooth
        return "FEATURE_BLUETOOTH";
    case PackageManager.FEATURE_BLUETOOTH_LE://android.hardware.bluetooth_le
        return "FEATURE_BLUETOOTH_LE";
    case PackageManager.FEATURE_CAMERA://android.hardware.camera
        return "FEATURE_CAMERA";
    case PackageManager.FEATURE_CAMERA_ANY://android.hardware.camera.any
        return "FEATURE_CAMERA_ANY";
    case PackageManager.FEATURE_CAMERA_AUTOFOCUS://android.hardware.camera.autofocus
        return "FEATURE_CAMERA_AUTOFOCUS";
    case PackageManager.FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING://android.hardware.camera.capability.manual_post_processing
        return "FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING";
    case PackageManager.FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR://android.hardware.camera.capability.manual_sensor
        return "FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR";
    case PackageManager.FEATURE_CAMERA_CAPABILITY_RAW://android.hardware.camera.capability.raw
        return "FEATURE_CAMERA_CAPABILITY_RAW";
    case PackageManager.FEATURE_CAMERA_EXTERNAL://android.hardware.camera.external
        return "FEATURE_CAMERA_EXTERNAL";
    case PackageManager.FEATURE_CAMERA_FLASH://android.hardware.camera.flash
        return "FEATURE_CAMERA_FLASH";
    case PackageManager.FEATURE_CAMERA_FRONT://android.hardware.camera.front
        return "FEATURE_CAMERA_FRONT";
    case PackageManager.FEATURE_CAMERA_LEVEL_FULL://android.hardware.camera.level.full
        return "FEATURE_CAMERA_LEVEL_FULL";
    case PackageManager.FEATURE_CONNECTION_SERVICE://android.software.connectionservice
        return "FEATURE_CONNECTION_SERVICE";
    case PackageManager.FEATURE_CONSUMER_IR://android.hardware.consumerir
        return "FEATURE_CONSUMER_IR";
    case PackageManager.FEATURE_DEVICE_ADMIN://android.software.device_admin
        return "FEATURE_DEVICE_ADMIN";
    case PackageManager.FEATURE_FAKETOUCH://android.hardware.faketouch
        return "FEATURE_FAKETOUCH";
    case PackageManager.FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT://android.hardware.faketouch.multitouch.distinct
        return "FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT";
    case PackageManager.FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND://android.hardware.faketouch.multitouch.jazzhand
        return "FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND";
    case PackageManager.FEATURE_FINGERPRINT://android.hardware.fingerprint
        return "FEATURE_FINGERPRINT";//API 23
    case PackageManager.FEATURE_GAMEPAD://android.hardware.gamepad
        return "FEATURE_GAMEPAD";
    case PackageManager.FEATURE_HIFI_SENSORS://android.hardware.sensor.hifi_sensors
        return "FEATURE_HIFI_SENSORS";//API 23
    case PackageManager.FEATURE_HOME_SCREEN://android.software.home_screen
        return "FEATURE_HOME_SCREEN";
    case PackageManager.FEATURE_INPUT_METHODS://android.software.input_methods
        return "FEATURE_INPUT_METHODS";
    case PackageManager.FEATURE_LEANBACK://android.software.leanback
        return "FEATURE_LEANBACK";
    case PackageManager.FEATURE_LIVE_TV://android.software.live_tv
        return "FEATURE_LIVE_TV";
    case PackageManager.FEATURE_LIVE_WALLPAPER://android.software.live_wallpaper
        return "FEATURE_LIVE_WALLPAPER";
    case PackageManager.FEATURE_LOCATION://android.hardware.location
        return "FEATURE_LOCATION";
    case PackageManager.FEATURE_LOCATION_GPS://android.hardware.location.gps
        return "FEATURE_LOCATION_GPS";
    case PackageManager.FEATURE_LOCATION_NETWORK://android.hardware.location.network
        return "FEATURE_LOCATION_NETWORK";
    case PackageManager.FEATURE_MANAGED_USERS://android.software.managed_users
        return "FEATURE_MANAGED_USERS";
    case PackageManager.FEATURE_MICROPHONE://android.hardware.microphone
        return "FEATURE_MICROPHONE";
    case PackageManager.FEATURE_MIDI://android.software.midi
        return "FEATURE_MIDI";//API 23
    case PackageManager.FEATURE_NFC://android.hardware.nfc
        return "FEATURE_NFC";
    case PackageManager.FEATURE_NFC_HOST_CARD_EMULATION://android.hardware.nfc.hce
        return "FEATURE_NFC_HOST_CARD_EMULATION";
    case PackageManager.FEATURE_OPENGLES_EXTENSION_PACK://android.hardware.opengles.aep
        return "FEATURE_OPENGLES_EXTENSION_PACK";
    case PackageManager.FEATURE_PRINTING://android.software.print
        return "FEATURE_PRINTING";
    case PackageManager.FEATURE_SCREEN_LANDSCAPE://android.hardware.screen.landscape
        return "FEATURE_SCREEN_LANDSCAPE";
    case PackageManager.FEATURE_SCREEN_PORTRAIT://android.hardware.screen.portrait
        return "FEATURE_SCREEN_PORTRAIT";
    case PackageManager.FEATURE_SECURELY_REMOVES_USERS://android.software.securely_removes_users
        return "FEATURE_SECURELY_REMOVES_USERS";
    case PackageManager.FEATURE_SENSOR_ACCELEROMETER://android.hardware.sensor.accelerometer
        return "FEATURE_SENSOR_ACCELEROMETER";
    case PackageManager.FEATURE_SENSOR_AMBIENT_TEMPERATURE://android.hardware.sensor.ambient_temperature
        return "FEATURE_SENSOR_AMBIENT_TEMPERATURE";
    case PackageManager.FEATURE_SENSOR_BAROMETER://android.hardware.sensor.barometer
        return "FEATURE_SENSOR_BAROMETER";
    case PackageManager.FEATURE_SENSOR_COMPASS://android.hardware.sensor.compass
        return "FEATURE_SENSOR_COMPASS";
    case PackageManager.FEATURE_SENSOR_GYROSCOPE://android.hardware.sensor.gyroscope
        return "FEATURE_SENSOR_GYROSCOPE";
    case PackageManager.FEATURE_SENSOR_HEART_RATE://android.hardware.sensor.heartrate
        return "FEATURE_SENSOR_HEART_RATE";
    case PackageManager.FEATURE_SENSOR_HEART_RATE_ECG://android.hardware.sensor.heartrate.ecg
        return "FEATURE_SENSOR_HEART_RATE_ECG";
    case PackageManager.FEATURE_SENSOR_LIGHT://android.hardware.sensor.light
        return "FEATURE_SENSOR_LIGHT";
    case PackageManager.FEATURE_SENSOR_PROXIMITY://android.hardware.sensor.proximity
        return "FEATURE_SENSOR_PROXIMITY";
    case PackageManager.FEATURE_SENSOR_RELATIVE_HUMIDITY://android.hardware.sensor.relative_humidity
        return "FEATURE_SENSOR_RELATIVE_HUMIDITY";
    case PackageManager.FEATURE_SENSOR_STEP_COUNTER://android.hardware.sensor.stepcounter
        return "FEATURE_SENSOR_STEP_COUNTER";
    case PackageManager.FEATURE_SENSOR_STEP_DETECTOR://android.hardware.sensor.stepdetector
        return "FEATURE_SENSOR_STEP_DETECTOR";
    case PackageManager.FEATURE_SIP://android.software.sip
        return "FEATURE_SIP";
    case PackageManager.FEATURE_SIP_VOIP://android.software.sip.voip
        return "FEATURE_SIP_VOIP";
    case PackageManager.FEATURE_TELEPHONY://android.hardware.telephony
        return "FEATURE_TELEPHONY";
    case PackageManager.FEATURE_TELEPHONY_CDMA://android.hardware.telephony.cdma
        return "FEATURE_TELEPHONY_CDMA";
    case PackageManager.FEATURE_TELEPHONY_GSM://android.hardware.telephony.gsm
        return "FEATURE_TELEPHONY_GSM";
    case PackageManager.FEATURE_TELEVISION://android.hardware.type.television
        return "FEATURE_TELEVISION";
    case PackageManager.FEATURE_TOUCHSCREEN://android.hardware.touchscreen
        return "FEATURE_TOUCHSCREEN";
    case PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH://android.hardware.touchscreen.multitouch
        return "FEATURE_TOUCHSCREEN_MULTITOUCH";
    case PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT://android.hardware.touchscreen.multitouch.distinct
        return "FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT";
    case PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND://android.hardware.touchscreen.multitouch.jazzhand
        return "FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND";
    case PackageManager.FEATURE_USB_ACCESSORY://android.hardware.usb.accessory
        return "FEATURE_USB_ACCESSORY";
    case PackageManager.FEATURE_USB_HOST://android.hardware.usb.host
        return "FEATURE_USB_HOST";
    case PackageManager.FEATURE_VERIFIED_BOOT://android.software.verified_boot
        return "FEATURE_VERIFIED_BOOT";
    case PackageManager.FEATURE_WATCH://android.hardware.type.watch
        return "FEATURE_WATCH";
    case PackageManager.FEATURE_WEBVIEW://android.software.webview
        return "FEATURE_WEBVIEW";
    case PackageManager.FEATURE_WIFI://android.hardware.wifi
        return "FEATURE_WIFI";
    case PackageManager.FEATURE_WIFI_DIRECT://android.hardware.wifi.direct
        return "FEATURE_WIFI_DIRECT";
    default:
        return UNKNOWN;
    }
}

From source file:org.samcrow.ridgesurvey.MainActivity.java

/**
 * Sets up the map view in {@link #mMap}
 *//*from www.  j  a  va  2 s . c om*/
private void setUpMap() throws IOException {

    // Start loading orthophoto images in the background
    final TileFolderLoad loadTask = new TileFolderLoad(this, R.raw.tiles, "ortho_tiles", "jpeg");
    loadTask.setDoneHandler(new DoneHandler() {
        @Override
        public void done(TileFolder result) {
            addOrthophotos(result);
        }
    });
    loadTask.execute();

    mMap = (MapView) findViewById(R.id.map);
    // Disable built-in zoom controls, unless running in an emulator or if the device
    // does not support basic multi-touch
    if (Build.HARDWARE.equals("goldfish")
            || !(getPackageManager().hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH))) {
        mMap.setBuiltInZoomControls(true);
    } else {
        mMap.setBuiltInZoomControls(false);
    }

    {
        // Limit view to the bounds of the map file
        MapFile mapFile = new MapFile(Storage.getResourceAsFile(this, R.raw.jasper_ridge_map));
        mMap.getModel().mapViewPosition.setMapLimit(mapFile.boundingBox());
        mMap.getModel().mapViewPosition.setZoomLevelMin(START_POSITION.zoomLevel);
    }

    // Get colors
    final Iterator<Integer> colors = Palette.getColorsRepeating();

    final List<Layer> routeLayers = new ArrayList<>();
    // Try to load sites
    List<Route> routes = null;
    try {
        routes = SiteStorage.readRoutes(getResources().openRawResource(R.raw.sites));
        final ObservationDatabase db = new ObservationDatabase(this);
        for (Route route : routes) {
            if (!route.getSites().isEmpty()) {

                // Solve the traveling salesman problem, starting at the southwesternmost point
                double minLatitude = Double.MAX_VALUE;
                double minLongitude = Double.MAX_VALUE;
                Site start = null;
                for (Site site : route.getSites()) {
                    final double latitude = site.getPosition().latitude;
                    final double longitude = site.getPosition().longitude;
                    if (latitude < minLatitude && longitude < minLongitude) {
                        minLatitude = latitude;
                        minLongitude = longitude;
                        start = site;
                    }
                }

                final OrderedRoute solution = new Nearest().solve(route, start);
                final int color = colors.next();
                final Layer routeLayer = new RouteLayer(db, route, solution, color, mSelectionManager);
                routeLayers.add(routeLayer);
            }
        }
    } catch (IOException e) {
        new AlertDialog.Builder(this).setTitle(R.string.failed_to_load_sites)
                .setMessage(e.getLocalizedMessage()).show();
        Log.e(TAG, "Failed to load sites", e);
    }

    // Location layers
    final RouteLineLayer routeLineLayer = new RouteLineLayer(this);
    mSelectionManager.addSelectionListener(routeLineLayer);
    mLocationFinder.addListener(routeLineLayer);
    final MyLocationLayer locationLayer = new MyLocationLayer(getMyLocationDrawable());
    mLocationFinder.addListener(locationLayer);

    // If a selected site was saved, restore it
    if (routes != null && mPreferences.contains(SELECTED_SITE_KEY)) {
        final int selectedSiteId = mPreferences.getInt(SELECTED_SITE_KEY, 0);
        for (Route route : routes) {
            for (Site site : route.getSites()) {
                if (site.getId() == selectedSiteId) {
                    Log.d(TAG, "Restoring selected site " + selectedSiteId);
                    mSelectionManager.setSelectedSite(site, route);
                }
            }
        }
    }

    // Add layers to the map
    mMap.getLayerManager().getLayers().add(routeLineLayer);
    mMap.getLayerManager().getLayers().addAll(routeLayers);
    mMap.getLayerManager().getLayers().add(locationLayer);
}

From source file:cn.suishen.email.activity.MessageViewFragmentBase.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (Logging.DEBUG_LIFECYCLE && Email.DEBUG) {
        Log.d(Logging.LOG_TAG, this + " onCreateView");
    }/*from ww  w  .  jav a 2 s . co  m*/
    final View view = inflater.inflate(R.layout.message_view_fragment, container, false);

    cleanupDetachedViews();

    mSubjectView = (TextView) UiUtilities.getView(view, R.id.subject);
    mFromNameView = (TextView) UiUtilities.getView(view, R.id.from_name);
    mFromAddressView = (TextView) UiUtilities.getView(view, R.id.from_address);
    mAddressesView = (TextView) UiUtilities.getView(view, R.id.addresses);
    mDateTimeView = (TextView) UiUtilities.getView(view, R.id.datetime);
    mMessageContentView = (WebView) UiUtilities.getView(view, R.id.message_content);
    mAttachments = (LinearLayout) UiUtilities.getView(view, R.id.attachments);
    mTabSection = UiUtilities.getView(view, R.id.message_tabs_section);
    mFromBadge = (ImageView) UiUtilities.getView(view, R.id.badge);
    mSenderPresenceView = (ImageView) UiUtilities.getView(view, R.id.presence);
    mMainView = UiUtilities.getView(view, R.id.main_panel);
    mLoadingProgress = UiUtilities.getView(view, R.id.loading_progress);
    mDetailsCollapsed = UiUtilities.getView(view, R.id.sub_header_contents_collapsed);
    mDetailsExpanded = UiUtilities.getView(view, R.id.sub_header_contents_expanded);

    mFromNameView.setOnClickListener(this);
    mFromAddressView.setOnClickListener(this);
    mFromBadge.setOnClickListener(this);
    mSenderPresenceView.setOnClickListener(this);

    mMessageTab = UiUtilities.getView(view, R.id.show_message);
    mAttachmentTab = UiUtilities.getView(view, R.id.show_attachments);
    mShowPicturesTab = UiUtilities.getView(view, R.id.show_pictures);
    mAlwaysShowPicturesButton = UiUtilities.getView(view, R.id.always_show_pictures_button);
    // Invite is only used in MessageViewFragment, but visibility is controlled here.
    mInviteTab = UiUtilities.getView(view, R.id.show_invite);

    mMessageTab.setOnClickListener(this);
    mAttachmentTab.setOnClickListener(this);
    mShowPicturesTab.setOnClickListener(this);
    mAlwaysShowPicturesButton.setOnClickListener(this);
    mInviteTab.setOnClickListener(this);
    mDetailsCollapsed.setOnClickListener(this);
    mDetailsExpanded.setOnClickListener(this);

    mAttachmentsScroll = UiUtilities.getView(view, R.id.attachments_scroll);
    mInviteScroll = UiUtilities.getView(view, R.id.invite_scroll);

    WebSettings webSettings = mMessageContentView.getSettings();
    boolean supportMultiTouch = mContext.getPackageManager()
            .hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH);
    webSettings.setDisplayZoomControls(!supportMultiTouch);
    webSettings.setSupportZoom(true);
    webSettings.setBuiltInZoomControls(true);
    mMessageContentView.setWebViewClient(new CustomWebViewClient());
    return view;
}