w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Send a picture from iOS app to php script to mySQL DB
If you are getting other posted data on your php script i.e username & password then the issue is that you will not get data in $_FILES array since the Xcode you share is not uploading the data as form (multipart/form-data) instead it's posting the data (i believe), so i think you will be getting raw image data in $_POST['photo'] and query should be: $data = $_POST['photo']; $query = "INSERT INTO mytb VALUES (' ','$username','$password'','$data')"; Even if you get the photo in $_FILES then still your using wrong thing to fread it should be: $data = addslashes(fread(fopen($_FILES['photo']['tmp_name'], "rb")));

Categories : PHP

video encoder for a picture + voice (supported by mobile phones)
My most intuitive solution for this would be to store a JPEG and an MP3 separately on the server. To download one entity as a single unit, download a bit of JSON or XML data that contains pointers to the picture and the audio file. If you are set on having one file do the job, you might try embedding the JPEG inside the ID3 metadata of an MP3 file (this type of metadata functionality exists to, e.g., store album art with a music file). You would want to make sure that the ID3 tag is near the start of the file. JavaScript within the mobile browser could fetch the file, a third party library could do the ID3 parsing (some Googling reveals that such libraries exist; don't know if they all support fetching a JPEG image). Then the JS would need to be able to feed the file into an audio tag for

Categories : Android

Send the latest picture taken to contect on whatsapp
You can add share feature to you Android App. Here goes the link : http://developer.android.com/training/sharing/shareaction.html <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/menu_item_share" android:showAsAction="ifRoom" android:title="Share" android:actionProviderClass="android.widget.ShareActionProvider" /> ... </menu> For Intent Share check this link: Android: how to add app to "Share via" list for camera picture Vrinda

Categories : Android

Send picture taken from android to .net web application (to store it in database)
Do you receive 414 (Request-URI Too Long) error? You should use HTTP POST method to upload your images as POST body - no Base64 encoding will be also required. Look at http://stackoverflow.com/a/7632849/2714032

Categories : Android

Android Camera Take Picture and SAVE or send to next activity
instead of this line : fos.write(data); write : fos.write(data,0,data.length); if you want to pass it to the next activity: Intent i = new Intent(StyloveFoto.this, Filter.class); i.putExtra("myImage",data); startActivity(i); and then in class filter in the oncreate method byte[] myImage = getIntent()getIntent().getByteArrayExtra("myImage");

Categories : Android

How to send django text and picture form by ajax
You can't send files via jQuery $.ajax(), you should go for other solution then, like http://blueimp.github.io/jQuery-File-Upload/ or https://github.com/Widen/fine-uploader

Categories : Django

Altering Feedback.js to send info & picture to an email address
When you initialize Feedback(), you can set some options. In your case the url option is important. This url should point to a php script which uses the $_POST[] data send by feedback.js. After you got all the data you can send it in an email with php. Here is an example how to set some options: Feedback({ label: 'What is your problem', header: 'Report an issue', nextLabel: 'Next', reviewLabel: 'Review screenshot', sendLabel: 'Send email', closeLabel: 'Cancel', messageSuccess: 'Done!', messageError: 'Oops..', url: 'path/to/email/sendFeedback.php' // This is what you need }); In the sendFeedback.php file you should do something like te following if($_POST) { $image = $_POST['data']; $otherField = $_POST['your-other-field']; // Send email

Categories : Javascript

Java Comm API Issue
In your code you have (exception handling removed for purpose of example): byte[] readBuffer = new byte[20]; while (inputStream.available() > 0) { int numBytes = inputStream.read(readBuffer); } System.out.print(new String(readBuffer)); You have a 20-byte buffer and you are constructing a String from all 20 bytes no matter how much data you read. In Java, a String can contain nulls, and so your string ends up being a character followed by 19 nulls. Then when you print it your particular console displays spaces instead of nulls. Couple of things to note. First, it's not really clear what you are trying to do with this loop. You repeatedly read into the same 20 byte buffer no matter how many bytes are left on the stream (e.g. if there are 400 bytes to read, at most readBuffer end

Categories : Java

Java javax.comm syncronous read
For me the solution was: jssc.SerialPort instead of rxtx or java.comm. Here I found this method: public java.lang.String readString(int byteCount, int timeout) To wait some bytes until a timeout.

Categories : Java

Passing a Command to a Comm Port Using C#'s SerialPort Class
sending stuff out the serialport is relatively straight forward.... var serialPort = new SerialPort("COM1", 9600); serialPort.Write("UUT_SEND "REMS\n" "); To get any responses you will have to hook the DataReceived event.

Categories : C#

How to free serial port after javax.comm.PortInUseException in java/shell
First, you should debug your code and make sure that the thread responsible for closing the device node really does close it; since you're talking about access to a non-shareable hardware device, using the Holder pattern for the RXTX connection might be helpful. If the program isn't properly closing the device node, the only option is to kill it. You can use fuser /dev/ttyUSB0 to see what process has it open and then kill that PID. This doesn't require root privileges, just access as the user who owns the process to be killed.

Categories : Java

Send push notification according to mobile OS
What I would do and what I have done. If you are storing the ID's in the database it should be very easy to distinguish the two. If you are keeping them in the same table but different fields then just use a different name for the columns. Save the ID's according to device type. Just don't have a generic column for Push Notification ID use two. I save the device ID according to type and the user's member ID with it. So even if they register with multiple devices it will send it to all their devices android or ios. Or I can just select all and send to every registered user. Here are some examples. One example using multiple id columns and one using a single id column with another column for type. gcm_id and apn_id as column names in the DB where the keys are stored one for android and o

Categories : PHP

How to set MP3 as Ringtone
Try this one: this is on click mec btn5.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { MediaPlayer mPlayer = MediaPlayer.create(FakeCallScreen.this, R.raw.mysoundfile); mPlayer.start(); } }); public void onDestroy() { mPlayer.stop(); super.onDestroy(); } Add permission in Manifest File: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Categories : Android

Android mobile as GSM Modem to send/recieve SMS on PC?
Yes, I think you can do it. Just install your cellphone drivers and then connect your mobile to PC. (Usually there are drivers in the mobile packages disks.) Then open "Phone and Modem" from your windows control panel. Then click on "Modems" tab. Now you can see all of your modems and their COM number. Use you cellphones COM in your .Net application. If you can not see you cellphones name as a modem in "Phone and Modem", it mean that you can not use you cellphone as a GSM modem. (I'm sorry for my bad English speaking)

Categories : Android

PHP Contact Form won't send from mobile device
Please read up on Error Control Operators PHP supports one error control operator: the at sign (@). When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored.

Categories : PHP

ringtone is not available on vline
The client has a setRingtone function that lets you set a single file path or an array of paths, say of mp3 and ogg file formats. It got dropped off from the docs. You can set the your ringtone after you create the client. We will make sure the docs get exported in the next builds. /** * Set the sound to be played as the ringtone for calls. The parameter takes an * array of paths, so that you can pass in different file formats like * ogg and mp3 for cross browser support. * @param {!string|!Array.<!string>} audioFilePath path to audio file(s). */ setRingtone(<audioPath(s)>)

Categories : Misc

capture picture from linux command line (uvccapture captures black picture)
a bit of an odd suggestion, but have you tried using sudo uvccapture -S40 -C30 -G80 -B20 -x1280 -y720 -v -t0 That should just take a single shot. Try this and see what it comes back with. I find that sometimes uvccapture wants that extra parameter. Not always though. Cheers. ARc

Categories : Linux

Set raw resource as ringtone in Android
The following code solved my problem : String name = "your_raw_audio_name"; File file = new File(Environment.getExternalStorageDirectory(), "/myRingtonFolder/Audio/"); if (!file.exists()) { file.mkdirs(); } String path = Environment.getExternalStorageDirectory() .getAbsolutePath() + "/myRingtonFolder/Audio/"; File f = new File(path + "/", name + ".mp3"); Uri mUri = Uri.parse("android.resource://" + context.getPackageName() + "/raw/" + name); ContentResolver mCr = context.getContentResolver(); AssetFileDescriptor soundFile; try { soundFile = mCr.openAssetFileDescriptor(mUri, "r");

Categories : Android

Intent to use my app to select a ringtone
Try this code - Uri alert = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); mp= MediaPlayer.create(getBaseContext(), alert); mp.setVolume(100, 100); mp.start(); mp.setOnCompletionListener(new OnCompletionListener(){ @Override public void onCompletion(MediaPlayer mp){ mp.release(); } }); vibrator = (Vibrator) getSystemService (VIBRATOR_SERVICE); vibrator.vibrate(400);

Categories : Android

How to create Ruby on Rails App to send messages to/from a chatting mobile app
This task is going to be a lot of interfacing with the WeChat API in order to do GET requests and POST requests to their server. Interesting, they don't have any documentation for how to do this with web applications (only mobile), so it will take some trial and error (see documentation). From reading their documentation, it seems like you may have two basic options of how to go about this. One is to make a mobile-used application without a large database, but instead provides a small layer onto the WeChat api. This would mean that each time a user comes to your web application, they would have to give your app permission (client authorization), after your app could make api calls for them for at most 2 hours. In this case you would have to store their token and user information as

Categories : Ruby On Rails

RingtonePreference with custom Ringtone from raw-resources
i wrote a Preference Class which suits to my needs, here maybe it will help other peoples: public class SoundPreference extends ListPreference implements PreferenceManager.OnActivityResultListener, OnPreferenceChangeListener { private NotificationPrefs mAct; public SoundPreference(NotificationPrefs act) { super(act); mAct = act; setEntries(new String[] { "Silent", "Custom", "Picker" }); setEntryValues(new String[] { "silent", "custom", "picker" }); setOnPreferenceChangeListener(this); } @Override public boolean onActivityResult(int requestCode, int resultCode, Intent data) { if (data != null) { Uri uri = dat

Categories : Java

changing the notification ringtone in android
This is the code that let you set tone: Notification notification = new Notification(icon, text, time); //custom sound notification.sound = Uri.parse("android.resource://" + context.getPackageName() + "/" + R.raw.siren);

Categories : Android

Taking a picture doesn't save the picture in the gallery
You are getting External storage. Instead save your image with this: MediaStore.Images.Media.insertImage(getContentResolver(), Bitmap, Title, Description); This will save the image in gallery. See insertImage(). Parameters cr The content resolver to use image Path The path to the image to insert name The name of the image description The description of the image Returns The URL to the newly created image

Categories : Android

AngularJS - What's the best way to implement a "picture-in-picture" view within my stated app?
Define abstract ListIndex state with ui-view directive to hold child states. Define ListCategory state that is child of ListIndex with resolve object to access category info in your controller List and Item controllers. Define ListCategoryItem state that is child of ListCategory. Some quick sample code: states.ListIndex = { url: '/list', abstract: true, template: '<div ui-view/>' }; states.ListCategory = { url: '/list/:categoryId', controller: ['$scope', 'category', function($scope, category) { $scope.category = category; }], templateUrl: 'category.html', resolve: { category: ['CategoryService', '$stateParams', function(CategoryService, $stateParams) { return CategoryService.get($stateParams.categoryId); }] }; states.ListCategoryItem = { url

Categories : Javascript

Send message from webserver to mobile chat app (like WhatsApp, Viber or Kik) on my smartphone?
There are many web services that allows you to send and receive SMS/notifications. PHP itself doesn't support this on it's own. You can use a service like Twilio to do this. You can send messages to your own smartphone, or even a friend's. An example: <?php require "Services/Twilio.php"; // Step 2: set our AccountSid and AuthToken from www.twilio.com/user/account $AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; $AuthToken = "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY"; // Step 3: instantiate a new Twilio Rest Client $client = new Services_Twilio($AccountSid, $AuthToken); // Step 4: make an array of people we know, to send them a message. // Feel free to change/add your own phone number and name here. $people = array( "+14158675309" => "Curi

Categories : PHP

What is the maximum size of data we can send using web services(REST) from mobile to server
There's no "defined limit" other than if there's a maximum on the server or on the users bandwidth limit. Consider your users might get quite annoyed if they get a bill at the end of the month as you've been doing a GET on 300mb.

Categories : Java

Using ringtone and notification in an alarm receiver class
Check if your receiver is called multiple times. Also set your vibration and Music option via notification. You dont have to set your own. refer this sample http://smartandroidians.blogspot.com/2010/04/alarmmanager-and-notification-in.html

Categories : Android

Android ringtone picker refresh the activity, why?
I ran into this in my app. I had overridden onResume to reload my view in case changes were made while my app wasn't on top. Coming back from the ringtone picker was setting off my onResume. For me, it was safe to move everything from onResume to onStart. There it would run when my app came to the foreground or first started but not when the ringtone picker was dismissed.

Categories : Java

How to set music files which are not in Media Store as ringtone
I have try with something and its work for me. Hope it will also help you. I am fetching all the available songs in device with below method: public static long [] getAllSongs(Context context) { //System.out.println("In get All Songs Method"); Cursor c = query(context, MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String[] {MediaStore.Audio.Media._ID}, MediaStore.Audio.Media.IS_MUSIC +"!= 0", null, MediaStore.Audio.Media.TITLE + " ASC"); try { if (c == null || c.getCount() == 0) { return null; } int len = c.getCount(); long [] list = new long[len]; for (int i = 0; i < len; i++) { c.moveToNext(); list[i] = c.getLong(0); //System.out.println("ID IS: "+c.getLong(

Categories : Android

How I get the default ringtone list in android on programmatically?
This question/answer should provide what you're after: How to bring up list of available notification sounds on Android You'll just need to swap out the RingtoneManager.TYPE_NOTIFICATION for RingtoneManager.TYPE_RINGTONE

Categories : Android

Set default ringtone from private internal storage
In my testing (Android v.19), I can use RingtoneManager.setActualDefaultRingtoneUri() to point to a ringtone on private, internal app storage without exception. However, attempting to play this Ringtone simply plays the default sound. I'm betting the system application that plays Ringtones doesn't have access to your apps internal storage. Bad for this scenario, but good for security!

Categories : Android

python ringtone maker : how to split files
You have to be a bit careful since mp3 frames do not always stand on their own, which is one of the reasons high end music tools will first convert to WAV or something like it, but as you remarked, it does work up till a certain level. You could probably benefit from looking at the code in the following project (note that it is GPL licensed though): http://sourceforge.net/projects/pymp3cut/ the interesting bits: http://pymp3cut.cvs.sourceforge.net/viewvc/pymp3cut/pymp3cut/pmpcmp3.py?revision=1.2&view=markup Once you extracted the actual music part, the rough idea is that you base yourself on the bitrate to get the relation between the framesize, seconds, filesize and byte content, which then tells you where to split the bytes to get the starting time and duration that you want.

Categories : Python

Changing the name of a picture makes the picture looks small
May be there are two images like one Publictransportation.png present in resources and another one will be just reference of Publictransportation.png, which might me there on your machine. Search Publictransportation.png in your project and check for duplication.

Categories : Image

Make soundclip in a listView selectable as (notification) ringtone?
The solution I post is just making it possible for you to detect the position of the listitem you clicked and set as ringtone (which is not working), inside the setRingtone function the magic happens. all code to make the sound as ringtone must be placed in there Inside the switch change the case id 'main_menu' to the item id from your menu -> context_menu.xml like below <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/main_menu" android:title="@string/set_ringtone" android:showAsAction="ifRoom" /> </menu> Add beneath onCreateContextMenu the code below. @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo

Categories : Java

Pause Phone Ringtone while Speaking through Text To Speech and then Resume
Get rid of this focus listener and add this code phoneStateListener class. This will solve your problem. int mode = audioManager.getRingerMode(); int musicVolume= audioManager.getStreamVolume(AudioManager.STREAM_MUSIC); audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, musicVolume, 0); audioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT); if(phoneState == TelephonyManager.CALL_STATE_IDLE) { audioManager.setRingerMode(mode); }

Categories : Android

how to have a picture in a picture-box change every 10 seconds
A couple of things: If these images aren't too big and plentiful you should consider preloading them all before hand: Dim images As New List(Of Image)() images.add(Image.FromFile(Somefilepath)) Now create a Timer that will tick every 10 seconds: Dim pictureChangeTimer As New Timer() 'Creates a timer AddHandler pictureChangeTimer.Tick, AddressOf pictureChangeTimer_tick 'creates an event handler, simply type in pictureChangeTimer.Tick += and hit tab twice. this will automatically create the method for you ' Sets the timer interval to 10 seconds. myTimer.Interval = 10000 myTimer.Start() Now in a separate function you can change your pictures every time the event lauches Private Sub pictureChangeTimer_tick(sender As Object, e As EventArgs) 'if using a lis

Categories : Vb.Net

Put a lot of pictures together to make one picture, how to use the picture which you want
check this out it will help you alot... http://spritegen.website-performance.org/ also this for techniques... http://coding.smashingmagazine.com/2009/04/27/the-mystery-of-css-sprites-techniques-tools-and-tutorials/

Categories : CSS

Replace a button with a picture when clicked and then create a new button on top of picture in WPF
Here's a quick, rather crude example, but it shows some basics of adding and positioning controls at runtime. Things to note: Add controls to a Canvas if you want to be able to position x,y explicitly. I used UserControls for location items, and just added instances If you're building a game, and if it's any significant size and complexity, don't use WPF. I've been there, done that, built a full multiplayer space arcade/action game on it. It's too slow for games. Here's the code dump below. //PathBuilding.xaml <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:TravianResourceProd" x:Class="TravianResourceProd.PathBuilding" Title="PathBuildin

Categories : C#

How to send cache-control: no-cache from mobile?
As i know, just three options available on different browsers: Slide down Settings -> Refresh Settings -> Privacy -> Clear cache (All/For this site only) If 1 and 2 doesn't help you just make extra click to clear cache manually UPDATE: Ok I check safari and chrome at this site: it seems like you cannot send pragma: no-cache, from browser, only programmatically via meta tags, so there is no way to do it

Categories : Caching

C# Progress Bar in background worker + Socket - Progress bar only updates after socket comm is done
The problem is because the progress bar is being updated by the UI thread. But the UI thread is "busy" waiting for the GetDeviceStats function to complete. So it cannot handle the progres bar update until it becomes free again. If the GetDeviceStats function is a long running process (which to me it is) then you would be best including that work within you background worker thread. However, you still wont be able to report the progress (and therefore update the progress bar) until the call has once again finished. Some possible solutions to that would be to either have GetDeviceStats report progress as it completes (I am not sure what that function actually does, so this may not be an option), OR if you need to "fake" the progress then use a second background thread or a timer. Person

Categories : C#



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