Giter VIP home page Giter VIP logo

hasmenu's Introduction

HasMenu

This is simple android native titanium module that can be used to determine whether an Android device has a hardware menu button or not.

Why do you care?

If a device like some newer Android devices has virtual buttons then Ti.Platform.displayCaps.screenHeight or screenWidth does not include the on screen system bar. Also when changing from portrait to landscape the height and width are recalculated excluding the system bar which is repositioned. (i.e. height landscape != width portrait)

More Info

The module is really very simple and is only really one line of code. (Is it really worth a repo?) Also it is built and needs API 14.

How to

Install the modules like you install any module. Then you can do the following:

if (require('yy.hasmenu').hasMenu) {
  Ti.API.debug("Has a hardware button");
} else {
  Ti.API.debug("Uses a system bar, should probably add 48dp");
}

Licence: MIT

hasmenu's People

Contributors

dbankier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hasmenu's Issues

UnsatisfiedLinkError on Samsung Galaxy S7

Here is contents of a crash log from one of our Samsung Galaxy S7 users:

java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.empowerpc.empower-1/lib/arm/libyy.hasmenu.so: has text relocations
    at java.lang.Runtime.loadLibrary(Runtime.java:372)
    at java.lang.System.loadLibrary(System.java:1076)
    at org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:132)
    at org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:99)
    at org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:205)
    at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:114)

Device Specs:

Android 6.0
Manufacturer Samsung 
Android version Android 6.0 
RAM (MB) 4096 
Screen size 1440 ร— 2560 
Screen density (dpi) 640 
OpenGL ES version 3.1 
Native platform armeabi-v7a 
CPU make Qualcomm 
CPU model MSM8996

I can confirm that the .so files are present in my project, so they should be included when packaging the app. Is there anything that I might be missing here? Our app does not crash on earlier droid device models

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.