Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Native Plugin for valume up button

Discussion in 'Android' started by Forux, Dec 27, 2015.

  1. Forux

    Forux

    Joined:
    Oct 20, 2015
    Posts:
    8
    I search all possible threads and do not found any working/understandable information, so i create this thread.

    I start with example from there http://docs.unity3d.com/Manual/PluginsForAndroid.html ("Native Plugin Sample")

    I want to handle volume up / down buttons on android smartphone.

    1. Can you post link to working example of native plugin that handle events?
    2. I have tried to add "input.h" library to my .c file, and get next error:
    "fatal error: input.h: No such file or directory"
    on compilation
    my Android.mk file:
    include $(CLEAR_VARS)

    LOCAL_ARM_MODE := arm
    LOCAL_PATH := $(NDK_PROJECT_PATH)
    LOCAL_MODULE := libnative
    LOCAL_CFLAGS := -Werror
    LOCAL_SRC_FILES := NativeCode.c
    LOCAL_LDLIBS := -llog -landroid
    LOCAL_MODULE := native-activity

    include $(BUILD_SHARED_LIBRARY)

    How to include system libs?
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,559
    According to the Android documentation (on this page):
    What exactly do you want to achieve ? what should the volume up/down buttons do in your game ?
     
  3. Forux

    Forux

    Joined:
    Oct 20, 2015
    Posts:
    8
    It must add additional functionality for android game, as additional key.
     
  4. Deleted User

    Deleted User

    Guest

    Did you find a solution?