Results 1 to 2 of 2
  1. #1
    akn_39 is offline Member
    Join Date
    May 2014
    Location
    Parksville, BC, Canada
    Posts
    9
    Rep Power
    0

    Default Turn camera flashlight On/Off

    Hello Everyone: I am trying to write a simple app which will turn the camera flashlight on and off. The examples/tutorials I have found use android.hardware.Camera; however, when I import this module (using Eclipse) it shows as deprecated and will not allow references or instatiation in subsequent code. I have the following parameters specified in the Android Manifest file:

    Java Code:
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.FLASHLIGHT" />
    <uses-feature android:name="android.hardware.camera" />
    
    <uses-sdk
         android:minSdkVersion="14"
         android:targetSdkVersion="19" />
    I have seen references to android.hardware.Camera being replaced with android.hardware.Camera2, and other commentary saying that android.hardware.Camera should still be usable i.e. deprecated does not mean removed. If I can still use android.hardware.Camera, that would be my preference (android.hardware.Camera2 is not shown as an Import option).

    Does anyone have any thoughts on how I can proceed?

    Cheers. .

    Tony N.

  2. #2
    akn_39 is offline Member
    Join Date
    May 2014
    Location
    Parksville, BC, Canada
    Posts
    9
    Rep Power
    0

    Default Re: Turn camera flashlight On/Off

    Okey dokey, while I don't know specifically what the problem was, by following the essential elements of this tutorial, I have been able to complete a working flashlight app which I have tested successfully on a Nexus 5 and a Samsung Galaxy S4. Still using android.hardware.Camera, but it just seems that the deprecation and other reference errors magically disappeared.

    Cheers. . .

    Tony N.

Similar Threads

  1. don't know where else to turn
    By HuffmanFamilyof4 in forum New To Java
    Replies: 5
    Last Post: 06-24-2012, 09:15 AM
  2. why my car can not turn left and turn 5 round,Help!!THx
    By seongchog in forum Java Applets
    Replies: 7
    Last Post: 03-01-2012, 09:53 AM
  3. Turn GUI Into Use-Able Program
    By Feriscool in forum Eclipse
    Replies: 3
    Last Post: 06-17-2011, 02:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •