w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Android: write bytes to image file on SD Card
First of all make sure you have this permissions on your android manifest. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.INTERNET"/> File stream is designed to work on local file storage rather than network connection. Use URLConnection class instead. URL uri = new URL("Your Image URL"); URLConnection connection = uri.openConnection(); InputStream stream = connection.getInputStream(); //DO other stuff....

Categories : Android

Write file to sd card in android as image file
are you doing any kind of editing on image after capturing by canvas ? if not then you can try this code to move file to root folder var fs; function movePic(){ window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail); } function gotFS(fileSystem) { fs = fileSystem; window.resolveLocalFileSystemURI(picture, gotFileEntry, fail); } function gotFileEntry(fileEntry) { fileEntry.moveTo( fs.root,fileEntry.name, success, fail); } function fail(error) { console.log(error.code); }

Categories : Javascript

Card.io usage in android. Displaying Credit card number and Expiry date
Maybe I missed it but I dont see anything wrong with the code. The problem may be in your XML so I thought I would make it easy for you. Send the user to another activity when the scan is completed. Copy this in the appropriate place. Create a new xml.file and see if this works. If you have any problems tell me. This is working fine for me. private Button scanButton; } @Override protected void onResume() { super.onResume(); if (CardIOActivity.canReadCardWithCamera(this)) { scanButton.setText("Charge"); } else { scanButton.setText("Charge"); } } final String TAG = getClass().getName(); private int MY_SCAN_REQUEST_CODE = 100; // arbitrary int public void onScanPress(View v) { // This method is set up as an onClick handler in the layout xml // e.g. and

Categories : Android

read and write files to removable sd card
Maybe you forget these permissions. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

Categories : Android

Bingo Card Game Issue With Repeating Random Integers
Don't use the random function like that - instead, fill up an array or ArrayList with all of the potential random numbers. Then randomly remove numbers from that - that will ensure that you cannot get repeated numbers, as only one of each exists.

Categories : Java

What is the difference between twitter photo card and summary with large image card?
The difference between a summary_large_image card and a photo card is what occurs when the user clicks on the image in the card: In the case of a summary_large_image card, a click on the image opens the link in a new tab (or in a browser on smartphones). In the case of a photo card, a click on the image opens a bigger version of the image in the same browser window (or displays the image full-screen on smartphones).

Categories : Twitter

Android: write failed: EPIPE (Broken pipe) Error on write file
EPIPE issue usually happens when you either try to execute command which needs root permissions (getRuntime().exec) in your case on the device without it or run several root commands simultaneously. If you work on the emulator and need to root it I think you you can try this while the emulator is running: adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system adb push su /system/xbin/su adb shell chmod 06755 /system adb shell chmod 06755 /system/xbin/su Here http://abd-tech.blogspot.com/2011/05/test-root-apps-on-android-emulator.html more detail explanation.

Categories : Android

Im trying to figure out how to deal a card from the deck in my card game class
yeah, now that i've thinked about, "hand" was empty because you fill it from "deck" that is in turn empty. Maybe you can define a method "initDeck" in deck class that fills the deck with random cards, and call it from game constructor. or maybe you already do this out of the game class, but in that case you should pass the deck to game!

Categories : Java

How to implemet creadit card and debit card payment in salesforce
If you are not experienced with API development, paypal API details are here: https://developer.paypal.com/docs/api/ Then the best other option is an App. I have used the connected Epos solution, which is great for taking payments from credit cards, either with the customer present (chip n pin) or by keying in the card numbers. You need to get the PayPalHere card terminal which is about $50, but it is a great all round solution. https://appexchange.salesforce.com/listingDetail?listingId=a0N30000000qD0GEAU

Categories : Paypal

Java Card: How to load SIM applet to real smart card?
It might not work because the SIM application might have dependencies to APIs that are not present in the JCOP cards (for instance ETSI 102 705). But then it is worth trying. Make sure that the file format is compatible between the tools (a cap file is not always a cap file by the way; a real cap file is a zip, some tools prefer IJC files). Try using the cap file from the Gemalto tool in the jcManager. If it does not work you can try GPShell. The main challenge is to have the keys to your target, and then the right tool.

Categories : Java

Need help saving mp3 to SD card in Android
Commonsware answered my post the most accurately. Environment.getExternalStoragePublicDirectory() should be used along with the proper programming techniques like Logging and using the two parameter File constructor.

Categories : Android

Card.io android sdk and maven
If I understand your problem correctly, I think you need to add the .so files into a folder called 'libs' and then add the line: <nativeLibrariesDirectory>${project.basedir}/libs</nativeLibrariesDirectory> in your pom file inside the <configuration> tag of your android-maven-plugin. For more details, please have a look at this similar issue

Categories : Android

iOS Phonegap app crashes after Card.io scans credit card
@Paul if you using latest card.io SDK just modify the CardIOPGPlugin.m file on line 101 from [CardIOCreditCardInfo displayStringForCardType:info.cardType] to [CardIOCreditCardInfo displayStringForCardType:info.cardType usingLanguageOrLocale:[[NSLocale currentLocale] localeIdentifier]] Hope it helps.

Categories : IOS

Reset Smart Card pin having Muscle card applet
MSCUnblockPIN is the function to use, but you have to know the unblock value of course. The corresponding ISO command Reset Retry Counter allows variants without unblock value, but these need another kind of protection to avoid arbitrary many retries.

Categories : Security

How to write an Android application to do sysfs read/write.?
Firstly, make sure you have the permission to that sysfs node(Usually you don't, if you are developing a user app). Secondly, I would say usually you don't have to talk to sysfs node directly from Android app.Below app there are Android Framework and HAL levels that did all the abstraction for you. Since not sure about what you are going to do, here is an example I fetched from Android LightsService which directly talk to sysfs node, which might be helpful to you. 216 private static final String FLASHLIGHT_FILE = "/sys/class/leds/spotlight/brightness"; ... 236 try { 237 FileOutputStream fos = new FileOutputStream(FLASHLIGHT_FILE); 238 byte[] bytes = new byte[2]; 239 bytes[0] = (byte)(on ? '1' : '0'); 240 bytes[1]

Categories : Android

Android work with db file from SD card
yes place the DB file in your assets folder and get it this way : DB_PATH="/data/data/app1_package/databases/my_database.db" in your create : is = getAssets().open("Meaniningss.db"); write(is); the method : public void write(InputStream is) { try { OutputStream out = new FileOutputStream(new File(DB_PATH)); int read = 0; byte[] bytes = new byte[1024]; while ((read = is.read(bytes)) != -1) { out.write(bytes, 0, read); } is.close(); out.flush(); out.close(); System.err.println(out + " "); } catch (IOException e) { e.printStackTrace(); } }

Categories : Android

android how to run files from sd card when click?
Implement a ListView (follow this TUTORIAL). Then implement a listener to handle the click on the items ( listView.onItemClickListener(); ) and then use the snipper below for the installation: Intent promptInstall = new Intent(Intent.ACTION_VIEW) .setData(Uri.parse("file:///path/to/your.apk")) .setType("application/vnd.android.package-archive"); startActivity(promptInstall); ref: http://stackoverflow.com/a/4604922/847818 You have to go step-by-step.

Categories : Android

Decrypting XML file on SD card Android
Arrays do not override the toString() method in Java. Invoking toString() on a byte array will probably not produce what you are after. The AdvancedCrypto.decrypt() method expects the ciphertext as a string. The corresponding encrypt method seems to hex encode the output bytes. The simplest fix to your code would be to change contents.toString() to new String(contents). (Note that it's bad practice to rely on the platform default encoding – you should explicitly specify UTF-8 when translating between strings and bytes in either direction.) However, the simplest fix is not always the best one. Copy-pasting random cryptographic code from the internet is particularly questionable. There's absolutely no reason to hex encode the ciphertext if you're storing it in a file, but this AdvancedCr

Categories : Android

Overwrite image on sd card android
What is while (output.exists()){ fileName = "myfile.jpg"; output = new File(imagesFolder, fileName); } this will loop your code for unfinite. Use instead if (output.exists()){ output.delete(); //DELETE existing file fileName = "myfile.jpg"; output = new File(imagesFolder, fileName); }

Categories : Android

Card.io SDK gives partial credit card number
Josh from card.io here. The sample code you're probably looking at reads: - (void)userDidProvideCreditCardInfo:(CardIOCreditCardInfo *)info inPaymentViewController:(CardIOPaymentViewController *)scanViewController { // The full card number is available as info.cardNumber, but don't log that! NSLog(@"Received card info. Number: %@, expiry: %02i/%i, cvv: %@.", info.redactedCardNumber, info.expiryMonth, info.expiryYear, info.cvv); // Use the card info... [scanViewController dismissModalViewControllerAnimated:YES]; } Note the comment above the NSLog call. What is being logged is info.redactedCardNumber. You want info.cardNumber instead. See the header files, which are pretty well documented, for more details. The older version of the SDK is has been publicly deprecated for nearly a

Categories : Iphone

Card holder's name in APDU commands (ICC Card)
Reading the card holders name and other info on a chip & pin card is not as simple as you might think. It's not as simple as just one straight forward APDU , there are several more steps you have to go through first. First you need to perform an application selection. How you do this, depends on your card and your terminal. There are 2 standard ways. 1) Application file selection 2) AID Scanning For type 1, you typically call a known file name using the select file apdu (NOTE: I'm not going to implement full apdu sentences in what I type here as there is just too much data to try and represent, if there is enough attention to this post then I might do a blog entry) The file name to select for most EMV standard cards is '1PAY.SYS.DDF01' or '2PAY.SYS.DDF01' for contactless ca

Categories : Misc

Coordinate Id of same card that is read by two different card readers
Its rather hard to understand just exactly what your wanting, but in the bottom you state: 'in other words, i want to convert this array of bytes to corresponding hex code'. You can perform that operation like so: public static string ByteArrayToString(byte[] ba) { StringBuilder sb = new StringBuilder(ba.Length * 2); foreach (byte b in ba) { sb.AppendFormat("{0:x2}", b); } return sb.ToString(); } Just pass in your Byte array and the result will be your hex conversion in string format. Edit: This will probably yield the same results, but try this: byte[ ] bytes = {0, 1, 2, 4, 8, 16, 32, 64, 128, 255 } Console.WriteLine( BitConverter.ToString( bytes ) );

Categories : C#

Card Flip in Android List View
To understand what to do I would make a simple example to flip the views without any fragments and FragmentManager. Then your getView method in your adapter would look like this: @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub LayoutInflater mInflater = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View rowView = mInflater.inflate(textViewResourceId, parent); String frontText = list.get(position); String backText = frontText+"...back side"; TextView tvFront = (TextView)rowView.findViewById(R.id.frontSide); tvFront.setText(frontText); // set View visible tvFront.setVisibility(View.VISIBLE); TextView tvBack = (TextView)rowView.findViewById(R.id.backSi

Categories : Android

Saving an image to sd card from android pager
Try some thing as below : button=(Button)vi.findViewById(R.id.button_save); button.setOnClickListener(new OnClickListener() { private Bitmap bm; private String PREFS_NAME; public void onClick(View arg0) { String root = Environment.getExternalStorageDirectory().toString(); File myDir = new File(root + "/saved_images"); if(!myDir.exists()){ myDir.mkdirs();} bm = BitmapFactory.decodeResource( mContext.getResources(), images[itemPos]); holder.image.setImageBitmap(bm); SharedPreferences savedNumber = mContext.getSharedPreferences(PREFS_NAME, 0); int lastSavedNumber = savedNumber.getInt("lastsavednumber",0); lastSavedNumber++; String fname = "Image-"+lastSavedNumber+".png"; File file = new

Categories : Android

reading images from memory card ANDROID
Try this code. File extStore = Environment.getExternalStorageDirectory(); and then give the folder name and file name. /audios/ringtone1.extension

Categories : Android

Android;Force AppWidget to work from SD Card?
For now, there is no way to make a Widget to work while the app is installed on the SD-Card. This is the normal behavior even when SD-Card is mounted. You get the error problem loading widget because Widgets are automatically disabled (and removed from the Widget list, so you can't add them) when you move the app to external storage, but they are kept in Home Screen, to be ready when you move it back to the phone and home application is resetted. If you're going to support that the user move your app to external storage, maybe you can publish another app to only hold your widgets, and configure it so that it can only by installed in the phone. This solves the problem but the user has to download two apps instead of one.

Categories : Android

Delete File in SD Card android with string
You can try using this: String strFile = "/sdcard/Pictures/neoadnEditGyM/GYM_2.2.jpg" File file = new File(strFile); boolean deleted = file.delete(); Also, if you are using >1.6 SDK you have to give permission uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" in AndroidManifest.xml file

Categories : Android

Android reuse sd card for multiple emulators
1) Read up on how to create an img sdcard file http://developer.android.com/tools/help/mksdcard.html 2) Use the sdcard file here where it says file while creating a new emulator device And in case you see locking errors - follow instructions here: Android emulator sd card image already in use

Categories : Android

How to disable SMS messages on Android without removing the SIM card?
At this point, there is no way other than by removing the sim card to disable sending messages. Sorry for offering you the best possibility to try and get you closer to solving your problem. I guess it was something you didn't want to hear. Next time try to be more clear when asking a question please, and work on your grammar. You will get much better answers if people understand the question.

Categories : Android

Identify if an Android tablet has a sim card slot
Try this code: TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE); //gets the current TelephonyManager if (tm.getSimState() != TelephonyManager.SIM_STATE_ABSENT){ //the device has a sim card } else { //no sim card available } source

Categories : Android

Android - Better Approach in Loading SD CARD Images
If it's a fixed set of images that never change that you know in advance, I don't see any problems with storing references to them in a String array, that's probably the best way to do it. If you want to dynamically find images on the SD card at run-time you'd be better off scanning/getting a file list of the particular folder or folders you are interested in and passing that to the Image Loader. You can query the MediaStore or you can use Java IO methods. There are many examples of SO how to do this: http://stackoverflow.com/a/9531063/833647 Either way, Universal Image Loader should take a lot of the heavy-lifting on the bitmap-display side, so I wouldn't worry too much about that.

Categories : Java

Display all the video from a specific folder in SD card in android
Use this File Browser library to browse through files and put the filter of video type in the following code Intent intent = new Intent(getBaseContext(), FileDialog.class); intent.putExtra(FileDialog.START_PATH, "/sdcard"); //can user select directories or not intent.putExtra(FileDialog.CAN_SELECT_DIR, true); //alternatively you can set file filter intent.putExtra(FileDialog.FORMAT_FILTER, new String[] { "avi" }); startActivityForResult(intent, REQUEST_SAVE);

Categories : Android

Cant create folder using mkdir to sd card for android tablet
Two things. Your code reads File folder = new File(Environment.getExternalStorageDirectory().toString() + "/myappfolder" ); and you'd be better off using this syntax File folder = new File(Environment.getExternalStorageDirectory().toString() , "myappfolder" ); If you're debugging your code, it's possible that the external SD Card has been dismounted. Go to Setting->Storage and verify that your SD Card is accessible to apps on your device. After seeing your logcat, one thing seems to be causing you trouble. Your logcat has this line in it: 06-22 04:33:57.320: W/PackageManager(143): Unknown permission android.permission.READ_EXTERNAL_STORAGE in package com.android.myapp which means you're actually having trouble with your manifest (you're targetting an Android version whic

Categories : Eclipse

Android Google Maps V2 - Sd card as Tile Provider
I modified somethings and it worked. Here is the code: CustomMapTileProvider.java package com.example.mapsteste; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import com.google.android.gms.maps.model.Tile; import com.google.android.gms.maps.model.TileProvider; import android.content.res.AssetManager; import android.os.Environment; public class CustomMapTileProvider implements TileProvider { private static final int TILE_WIDTH = 256; private static final int TILE_HEIGHT = 256; private static final int BUFFER_SIZE = 16 * 1024; private AssetManager mAssets; private Context ctx; public CustomMapTileProvider(AssetManager assets) { mAssets = assets; }

Categories : Java

Google Card Style 9-Patch with ListView - Android
Your 9-patch image stretches all the white/border correctly, but it has nothing but transparency at the bottom. If you want a gray shadowy area beneath it, you need to draw it there, below the white. Just make sure you don't extend the black stretch-bar down to it, or it will stretch as well.

Categories : Android

Choose SIM card when sending SMS on a dual SIM Android device
Please refer to this Dual Sim Android article. If you follow this direction, I think you can make it, even if current android api doesn't support it.

Categories : Android

How can I make a file to disappear once if it is deleted in android SD card?
add this line adapter.notifyDataSetChanged(); after deleteFile() method in onclick event.. or call same activity using intent after that.. Try like this: adapter = new MyListAdapter(this); lv = (ListView) findViewById(android.R.id.list); lv.setAdapter(adapter); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> a, View v, int position, long id) { AlertDialog.Builder adb=new AlertDialog.Builder(MyActivity.this); adb.setTitle("Delete?"); adb.setMessage("Are you sure you want to delete " + position); final int positionToRemove = position; adb.setNegativeButton("Cancel", null); adb.setPositiveButton("Ok", new AlertDialog.OnClickListener() { public void onClick(

Categories : Android

Android - How to get two or more SD Cards' path from Card Reader using OTG to connect our phone?
Well, When you've got the path of the USB device, try File usbPath = new File("path_to_usb_device"); File[] sdcardsPath = usbPath.listFiles(); for(File ff : sdcardsPath) { Log.d("File repo", ff.getAbsolutePath()); }

Categories : Android

Android BroadCast Receiver Thread to notify sd card removal
Activity to notify SDCard Removal or unmounting Here is the check: Boolean isSDPresent = android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED); if(isSDPresent) { // Do something } else { // trigger the broadcast!! }

Categories : Java

How to upload file from any folder in sd card to server using Android Phonegap
I used this method to upload log files. You have to change the path of the file and server address. If you don't know the ip address 10.0.2.2 is android alias for your localhost. I got this method from some other site. I just changed the file path and server address. private void uploadMedia() throws IOException { HttpURLConnection connection = null; DataOutputStream outputStream = null; DataInputStream inputStream = null; String pathToOurFile ="/data/data/com.jos.finalsolution/files/LocationData"; String urlServer = "http://10.0.2.2/phpvt/receiver.php"; String lineEnd = " "; String twoHyphens = "--"; String boundary = "*****"; int bytesRead, bytesAvailable, bufferSize; byte[] buffer; int maxBufferSize = 1*1024*1024; try { FileI

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.