मैं यूआई बटन पढ़ें/लिखें कि sysfs read
या sysfs write
करता है के साथ एक Android आवेदन लिखना चाहते हैं।sysfs को पढ़ने/लिखने के लिए एंड्रॉइड एप्लिकेशन कैसे लिखें।
मुझे java.io.RandomAccessFile के लिए नीचे दिया गया उदाहरण कोड मिला।
package com.tutorialspoint;
import java.io.*;
public class RandomAccessFileDemo {
public static void main(String[] args) {
try {
// create a new RandomAccessFile with filename test
RandomAccessFile raf = new RandomAccessFile("c:/test.txt", "rw");
// write something in the file
raf.writeUTF("Hello World");
// set the file pointer at 0 position
raf.seek(0);
// read the first byte and print it
System.out.println("" + raf.read());
// set the file pointer at 4rth position
raf.seek(4);
// read the first byte and print it
System.out.println("" + raf.read());
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
क्या कोई मुझे बता सकता है कि एंड्रॉइड एसडीके का उपयोग करके इस कोड को कैसे बनाया जाए?
आपको क्या समस्याएं हैं? एंड्रॉइड ऐप लिख रहा है? बटन बनाना? फाइलें पढ़ना/लिखना? –
मैं linux ड्राइवर प्रोग्रामिंग के लिए उपयोग किया जाता है। मैंने उपयोगकर्ताओं को sysfs निर्यात किया है। मैं इसे उपयोगकर्ता स्पेस एंड्रॉइड एप्लिकेशन में एक्सेस करना चाहता था। मैं एंड्रॉइड एप्लिकेशन दुनिया के लिए नया हूँ। मैं एंड्रॉइड अनुप्रयोगों को लिखने पर सामान्यीकृत लिंक से शुरू नहीं करना चाहता हूं। यह बेहतर होगा अगर मुझे अपने काम – kzs
से शुरू करने के लिए टेम्पलेट या कंकाल स्टब मिलता है तो कृपया कोई इस तरह के पॉइंटर्स दें .. इस एप्लिकेशन के लिए कहां से शुरू करना है। – kzs