PNG JPG BMP TIFF SVG
Aspose.BarCode  for Android via Java
Data Matrix

Data Matrix लेबल Android via Java के साथ जनरेट करें

Android via Java API के लिए सर्वर-साइड Aspose.BarCode का उपयोग करके Java में Data Matrix कोड बनाएं।

How to Generate Data Matrix कोड Using Android via Java

Android एप्लिकेशन में आसानी से Data Matrix कोड बनाने के लिए Java के माध्यम से Android के लिए Aspose.BarCode आज़माएं। यह एक बहुमुखी, मजबूत और उपयोगकर्ता के अनुकूल बारकोड लाइब्रेरी है जिसे विशेष रूप से एंड्रॉइड एप्लिकेशन के लिए डिज़ाइन किया गया है। आप बिल्ड.ग्रेडल में निम्नलिखित कॉन्फ़िगरेशन डालकर सीधे मावेन-आधारित प्रोजेक्ट से जावा के माध्यम से Android के लिए Aspose.BarCode को आसानी से कर सकते हैं:

Command

  maven { url "http://repository.aspose.com/repo/" }

Command

  implementation group: 'com.aspose', name: 'aspose-barcode', version: '23.XX', ext: 'aar'      
  implementation group: 'com.aspose', name: 'aspose-barcode', classifier: 'control.android.via.java-javadoc', version: '23.XX' 

Java में Data Matrix कोड जनरेट करने के चरण

Aspose.BarCode डेवलपर्स के लिए कोड की कुछ पंक्तियों के साथ Data Matrix कोड छवियां बनाना आसान बनाता है।

  • BarCodeGenerator वर्ग का एक नया उदाहरण बनाएं
  • Data Matrix कोड बारकोड प्रकार को EncodeTypes पैरामीटर के रूप में पास करें
  • setCodeText विधि का उपयोग करके बारकोड टेक्स्ट परिभाषित करें
  • Data Matrix कोड बारकोड इमेज को सेव करने के लिए GenerateBarCodeImage() मेथड लॉन्च करें

सिस्टम आवश्यकताएं

Aspose बारकोड एपीआई सभी प्रमुख प्लेटफॉर्म और ऑपरेटिंग सिस्टम द्वारा समर्थित हैं। नीचे दिए गए कोड नमूने को निष्पादित करने से पहले, कृपया जांच लें कि आपके सिस्टम में निम्नलिखित पूर्वापेक्षाएँ सक्षम हैं।

  • Microsoft Windows, Linux, या Android रनटाइम वातावरण के साथ संगत कोई भी OS
  • Android SDK v.30
  • Android OS 2.0 या बाद के संस्करण चलाने वाले Android सिस्टम

Code to be executed - Java


// Create an instane of the BarcodeGenerator class
BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.DataMatrix);

// Specify the code text
generator.setCodeText("");

// Specify the X-dimension 
// the smallest width of the unit of BarCode bars or spaces
generator.getParameters().getBarcode().getXDimension().setMillimeters(2);

// Set codetext position
generator.getParameters().getBarcode().getCodeTextParameters().setLocation(CodeLocation.Below);

// Generate image
generator.generateBarCodeImage();
Generation result