w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Using android action bar share intent
If you want a static share Intent (i.e., it never changes), then you update your onCreateOptionsMenu to be public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.mainpage, menu); MenuItem item = menu.findItem(R.id.menu_item_share); mShareActionProvider = (ShareActionProvider) item.getActionProvider(); // Create the share Intent String playStoreLink = "https://play.google.com/store/apps/details?id=" + getPackageName(); String yourShareText = "Install this app " + playStoreLink; Intent shareIntent = ShareCompat.IntentBuilder.from(this) .setType("text/plain").setText(yourShareText).getIntent(); // Set the share Intent mShareActionProvider.

Categories : Android

Customize Share Intent Android
Might be because you are only registering for the MULTIPLE intent. try adding this intent filter: <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="image/*" /> </intent-filter>

Categories : Android

Launching intent of certain android apps causes IllegalStateException
How to launch the camera How to launch the dialer to launch a specific app you need to know the package name and the class name try{ Intent i = new Intent(); i.setClassName("com.example.app", "com.example.app.MainActivity"); i.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(e); }catch(ActivityNotFoundException e){ e.printStackTrace(); }

Categories : Android

Save bitmap to internal Storage and share it via intent android
You will need to write Content Providers to share image in internal storage See Sharing images that are stored on internal memory public class MediaContentProvider extends ContentProvider { private static final String TAG = "MediaContentProvider"; // name for the provider class public static final String AUTHORITY = "com.way.srl.HandyWay.contentproviders.media"; private MediaData _mediaData; // UriMatcher used to match against incoming requests private UriMatcher _uriMatcher; @Override public int delete(Uri uri, String selection, String[] selectionArgs) { // TODO Auto-generated method stub return 0; } @Override public String getType(Uri uri) { // TODO Auto-generated method stub return null; } @Override public Uri insert(Uri uri, ContentValues values) { // TODO A

Categories : Android

How to filter apps while share photo on Android
I found the method, but not sure is it the best method. My method as below: First, remove the line startActivity(Intent.createChooser(sharingIntent, "Share"); Second, I remove the app I want to filter from list resolveInfo as below: for(i = resolveInfo.size(); i >= 0; i--) { if((resolveInfo.get(i).activityInfo.packageName).equals("com.facebook.katana")) { resolveInfo.remove(i); } } Third, create own app chooser to show a ListView Dialog to show resolveInfo's item, resolveInfo.get(i).activityInfo.loadLabel(pm) and resolveInfo.get(i).activityInfo.loadIcon(pm), the app name and icon resid. Finally, if click item i, then use below code to share photo: Intent mysharingIntent = new Intent(Intent.ACTION_SEND); mysharingIntent.setType("image/jpeg"); mysharingInte

Categories : Android

Using a Network Socket to share Data bewteen two Apps on the Same Android device
Are you aware of the UNIX sockets? We can use UNIX sockets for communicating between apps in the same device. Android supports it. Helpful links: 1) http://beej.us/guide/bgipc/output/html/multipage/unixsock.html But I am not aware of how to create UNIX socket in java layer. If you are aware of the JNI then you can create the UNIX socket in C and pass on the data between the Java<->Native layers. Android supports local sockets: https://developer.android.com/reference/android/net/LocalSocket.html

Categories : Android

Android: Launch intent and send key
// try this public void openWhatsappConversation(String whatsappid) { runOnUiThread(new Runnable() { @Override public void run() { whatsappid = "4917012345678@s.whatsapp.net"; Cursor c = getContentResolver().query( ContactsContract.Data.CONTENT_URI, new String[] { ContactsContract.Contacts.Data._ID }, ContactsContract.Data.DATA1 + "=?", new String[] { whatsappid }, null); c.moveToFirst(); Intent whatsapp = new Intent(Intent.ACTION_VIEW, Uri.parse("content://com.android.contacts/data/" + c.getString(0)));

Categories : Android

Fill up the username or password on website through my android apps
Filling the username automatically is only possible if the browser supports some extension point. The only browser with plugin support I know of on Android is Dolphin. LastPass comes with such I plugin. On other browsers, it becomes more difficult. "Safe in Cloud" has an interesting mechanism you might want to look at. And finally, my app "Keepass2Android" uses a workflow described in https://keepass2android.codeplex.com/documentation. Basically, it is: if the user is on a website that needs credentials, he uses "Share URL" from the menu and selects the app the app finds the appropriate credentials from the database and makes them accessible. Either through clipboard (which is not particularly safe on Android, see https://www2.dcsec.uni-hannover.de/files/p170.pdf or by implementing a c

Categories : Android

how to send data to other paticipant using intent or bundle in android
You can't do this with intents. To communicate between different phones you need to use something that can connect the devices together. This can be a web server, Bluetooth, a local wifi network but there has to be a connection between the different phones before you can do this.

Categories : Android

Why my android send email intent method isn't work
final Intent i = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto","suphawut@mpatmail.com", null)); i.putExtra(Intent.EXTRA_SUBJECT, "Emergency Location"); i.putExtra(Intent.EXTRA_TEXT,Html.fromHtml(DescribText));

Categories : Java

android send intent to specific contact (whatsapp, sms, hike, etc.)
You have to implement the send action for different messaging apps like hike whatsapp hike etc. as you cant tell thes apps to send a message to a specific contact as the database is protected. Reason You never know which contact has what id in these apps like for you what may be contact1 can be smthing else in whatsapp database. So all you have to do this is just put data and package name. Hike - com.bsb.hike Whatsapp - com.whatsapp Intent i=new Intent(); i.setPackageName(""); startActivity(i); Hope it helps.

Categories : Android

Code to send a created Document via email Intent in android
I'm doing something similar with my application Pic4Share. After creating the photo album in PDF the user can share it as an attachment of an e-mail. This is the code that opens the chooser for sharing with the file already attached and some messages pre loaded: //create the send intent Intent shareIntent = new Intent(android.content.Intent.ACTION_SEND); // File path String fileName = "file://" + android.os.Environment.getExternalStorageDirectory() + "/" + getResources().getString(R.string.folder_name) + "/" + albumTitle + ".pdf"; Uri pdfUri = Uri.parse(fileName); //set the type shareIntent.setType("application/pdf"); //add a subject shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, albumTitle); //build the body of the message to be shared String shareMessage = getResources()

Categories : Android

How to/Can we hide share target apps(e.g OneNote, Twitter, etc.) that are displayed after tapping share from charms bar using c# in win 8/winrt apps?
Yes, it is possible to do what you want to. Here is the link for the same. The procedure is The Share charm automatically lists all of the apps installed on your PC that can share. But if you don't want certain apps to appear, you can remove them from the list without uninstalling them.To remove an app from the app list :- Swipe in from the right edge of the screen, tap Settings, and then tap Change PC settings. (If you're using a mouse, point to the upper-right corner of the screen, move the mouse pointer down, click Settings, and then click Change PC settings.) Then tap or click Share. Under Use these apps to share, find the app you don't want to appear, then set the slider to Off to remove it.

Categories : C#

Send plain text from an Android library to an Android project
You could achieve this communication with the aid of interfaces. The idea is to crate a callback method that will be implemented in your activity, and will be called by the project library to send text back to you (in android project). For example, create an interface: public interface OnTaskFinishedListener(){ void onTaskFinished(String text); } Let assume that in your project library you have a class named Task with a method doTask() that you use in your Android project to perform some task and then send the result back to you. Then the implementation of Task will look like this: public class Task{ // ...... public void doTask(OnTaskFinishedListener listener){ // Do the task... String textToSend = // some text to send to caller activity listener.onTask

Categories : Android

(Android) Why i use SmsManager.getDefault().sendTextMessage but apps dont send sms?
SmsManager smsManager = SmsManager.getDefault(); smsManager.sendTextMessage("", null, "< message body>", null, null); SmsManager require, SMS_SEND permission in your android mainfest.

Categories : Android

how to send data from website server to android app
A better but more complex way to do it is to use Google Cloud Messaging (aka Push Notifications). This way your server can notify the app that there are new data to be retrieved, and only then your app has to query your server. This is a much more battery friendly approach and works pretty well. I've used this before for the same reason. To answer some of the comments too, polling is a bad idea because it overuses both your server and the user's device for no reason it will drain the user's battery there will always be some delay between when the server wants to communicate with the app and the time your app will do the next polling. The push notification approach takes more effort but has great advantages too.

Categories : Android

Share link and text with Android Facebook SDK 3.0
Finally managed to get everything I needed with the Facebook SDK 3.0 using the following: Bundle params = new Bundle(); params.putString("caption", "caption"); params.putString("message", "message"); params.putString("link", "link_url"); params.putString("picture", "picture_url"); Request request = new Request(Session.getActiveSession(), "me/feed", params, HttpMethod.POST); request.setCallback(new Request.Callback() { @Override public void onCompleted(Response response) { if (response.getError() == null) { // Tell the user success! } } }); request.executeAsync();

Categories : Android

Receive text from the Android share menu
From the Example you forget to add data mimeType <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/plain" /> </intent-filter>

Categories : Android

send data form hybrid android app to simple website in google app engine using json
Check out Google App Engine endpoints: https://developers.google.com/appengine/docs/java/endpoints/ This makes it easy to create app engine apps for Android developers.

Categories : Android

Android - Send html file to print app via intent, won't appear as html
Figured it out. I wasn't doing anything wrong programatically on my end, but it just so happens that the brother app doesn't read html. It takes in a URL to a webpage, and takes an image capture of it for a print preview. My solution here is to take my html file, and rather than sending it directly to the brother app I am to upload it to a web hosting service and send the URL to the page to the brother print app in the intent. If only they had documentation explaining this :|

Categories : Android

Notify android users of my website to install Android app from website?
Use this JavaScript code on the website to detect if the visitor is visiting through an Android phone: <script type="text/javascript"> if( /Android|iPhone|BlackBerry/i.test(navigator.userAgent) ) { var url=confirm("Would you like to download our mobile application?"); if (url==true) { var url = window.location.href = 'http://www.google.com'; url.show(); } else { } } </script> Or this PHP code: $ua = strtolower($_SERVER['HTTP_USER_AGENT']); if(stripos($ua,'android') !== false) { // && stripos($ua,'mobile') !== false) { // Android Device // Here you me popup a dialog with a link to your google play page }

Categories : Javascript

i have two android apps ,one can send the string over LAN at specific IP and other app for receiving but i want to broadcast the string over LAN?
Socket is a TCP socket. Broadcasting is not possible with TCP. If you want to use TCP, you cannot broadcast, you must have a connection open to each client and send the data over each connection separately. DatagramSocket is a UDP socket. Broadcasting is possible with UDP. However, the caveat is that UDP does not guarantee that your message will actually arrive. To guarantee that your message arrives you must implement some kind of acknowledgment/retry protocol, but if you do that, you might as well use TCP, since that's what it does. Edit: Another question and my responses from the comments below. OP wrote: then how i'll get the IP's of listening devices in LAN in order to make connection separately? The subject here is device or service discovery, a not uncommon challenge. There

Categories : Java

startActivity(Intent intent)'s not working in the Android version of my LibGDX project
You could use Gdx.net.openURI(theYouTubeUri); which will either open the video in the YouTube app or their browser, depending on their device/defaults/selection. If you want to use your interface approach, the interface should have a reference to your Activity (AndroidApplication) and use the startActivity from there.

Categories : Android

Read Text from website and put it in a string (Android , Eclipse)
Use equals instead of ==. if(total.toString().equals("Text")) == checks if two references point to the same object, which won't be true in that case.

Categories : Android

Strange one: Text in website on Android is scrambled, looks hacked, but isn't
Just try to change text rendering method in your style.css. From: body { … text-rendering: optimizeLegibility; … } To: body { … text-rendering: auto; … } OptimizeLegibility method is broken on Android Froyo. Hope this helps!

Categories : Android

How to configure the android intent actions in android manifest
Your answer seems to me a bit strange, I think you are a bit confuse about the difference between Intent and manifest permission. The first one are the system used by android to let app communicate with each other, the second one allow you to use some feature of the device like wifi and direct phone call that need the explicit agreement of the user to be used (the prompt that popup when you make the first install of an app). With this clarification it is clear that if you want to do something that require another app you will have to make an Intent. This Intent, if well formed, will be elaborated by the os that will take care of sending it to the correct application able to accomplish the Intentrequirement. So the answer to your question, as far as i know, is no, you have to use intent

Categories : Android

Android:How can i make an AutoCompleteTextView to pass the text from a website and show me the results
After parsing the webservice data you will get results into an array. Let's say you are getting result into array named resultData then use below code. arrayAdapter = new ArrayAdapter<String>(viewAutoComplete, android.R.layout.simple_list_item_1, resultData); autoCompleteText.setAdapter(arrayAdapter);

Categories : Java

How to get android play store installed apps packages through android code?
You should use getInstallerPackageName, it retrieves the package name of the application that installed a package. This identifies which market the package came from: http://developer.android.com/reference/android/content/pm/PackageManager.html#getInstallerPackageName%28java.lang.String%29 For the Play Store, you should check if it comes from com.android.vending!

Categories : Android

Can we use Google Android in-App purchase in Android apps published on Samsung Store?
For samsung app Store you need to use Plasma.... for more ref. visit http://developer.samsung.com/distribute/monetization http://developer.samsung.com/android/technical-docs/In-App-Purchase-using-Plasma-in-Android This may help you

Categories : Android

Upload an image AND send text with $_POST through an android app
You can not combine UrlEncoded and Multipart. Instead, add all string fields as it own part of a Multipart. Look here for an example: Apache HttpClient making multipart form post

Categories : PHP

How to send email with html text with 3 columns from android application?
Use the following code : final Intent mEmailIntent = new Intent(android.content.Intent.ACTION_SEND); mEmailIntent.setType("application/text"); mEmailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{"sender@somedomain.com"}); mEmailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject"); mEmailIntent.putExtra(Intent.EXTRA_TEXT,Html.fromHtml(new StringBuilder() .append("<b>c11 &nbsp c12 &nbsp c13</b><br>") .append("<b>c21 &nbsp c22 &nbsp c23</b><br>") .append("<b>c31 &nbsp c32 &nbsp c33</b><br>") .toString())); startActivity(Intent.createChooser(mE

Categories : Android

Unable to send text data between two bluetooth devices in android?
I had alot of problems with the chat example myself, so i tried another approach. First you have to make one device host and the other the client, this works with the example pretty well. if you dont have this running, i can provide you with that code aswell. Using the classes above, you get the socket for the connection. Use that to pass it to this class and then you can send using the write method. and the incoming messages are automatically parsed in the run-method (i added a message id and length to the front, thats why there is so much things going on in there) private class ConnectedThread extends Thread { /** the connection socket */ private final BluetoothSocket mmSocket; /** input stream for incoming messages */ private final InputStream mmInStream; /** output stream for out

Categories : Android

Android Apps Debugging in Android Studio
in click Edit Configurations then change the yellow circled to USB devices

Categories : Android

Share links with my app using "Share via" in Android
I have set an Intent Filter on an activity so that my app displays in the "Share via" dialog. That part works fine, but I'm not sure how to actually get the data into my "new post" dialog when it launches. If by "the data", you mean the text that was shared, call getIntent() on your activity and read the EXTRA_TEXT extra for that. In the case of browsers sharing URLs, EXTRA_TEXT should be the URL.

Categories : Android

Read/send data in android and c# Bluetooth Communication : c# <-> Android
To establish communication between two devices by using Web services you don't have to use winform application. You can establish a connection via web services, just create a new ASP.NET project using visual studio then add a Web service and folloe the template it gives you. Right click on the service, click on view in browser, verify there is no any error. The address of this browser is the address of your service just connect to this service from the second device. Please check out this guideline: CodeProject Web Service

Categories : C#

How to Send/receive string via bluetooth android to another android phone
If you are sending via Bluetooth, you need to make a UUID object and use it to open the socket connection. I used a thread to listen for in coming data. you will also need a function to open and close the bluetooth connection. void openBT() throws IOException { UUID uuid = UUID.fromString("00001101-0000-1000-8000-00805f9b34fb"); //Standard //SerialPortService ID mmSocket = mmDevice.createRfcommSocketToServiceRecord(uuid); mmSocket.connect(); mmOutputStream = mmSocket.getOutputStream(); mmInputStream = mmSocket.getInputStream(); beginListenForData(); myLabel.setText("Bluetooth Opened"); } void beginListenForData() { final Handler handler = new Handler(); final byte delimiter = 10; //This is the ASCII code for a newline chara

Categories : Android

Android send data from android to the server as bundle
Not sure exactly what you want, but one solution is to use a JSONArray in addition to what you are currently doing. You would continue to create the JSONObjects exactly as you are, but instead of sending right away, add it to a JSONArray. Then on whatever iteration you want (say after you have added 100 JSONObjects), send the JSONArray to the server.

Categories : Android

Android: send post params, file, and text in one Http Post Request
Take a look at what I use in my apps: In my ServerController.class: AsyncTask to POST/GET calls private final int GET = 0; private final int POST = 1; private class ServerRequestTask extends AsyncTask<Void, Void, Void> { private URL requestUrl; private int request_type; private Map<String, String> parameters; private JSONObject json_parameters; private boolean showDialog; public ServerRequestTask(URL requestUrl, int request_type, Map<String, String> parameters, boolean showDialog) { this.requestUrl = requestUrl; this.request_type = request_type; this.parameters = parameters; this.showDialog = showDialog; } public ServerRequestTask(URL requestUrl, int request_type, JSONObject json_parameters, boolean s

Categories : Android

Android old intent keeps relaunching
I think the problem is that your activity is still waiting for a result. If so, calling forceFinish() in your onResume() should fix the problem. http://developer.android.com/reference/android/app/Activity.html#finishActivity%28int%29

Categories : Android

Email intent android?
I think you have to install Email App to you phone, like Gmail, or Android can not find any App to receive that intent. And you should change Intent.ACTION_SEND to Intent.ACTION_SENDTO

Categories : Android



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