android


Post to Facebook wall without using ShareDialog in Facebook 4.+


I am working on an app that I want to be able to post to Facebook wall. The language used for the app is non-latin based character set. Hence, the user types the content to share using the app itself and then share it on facebook without going to the ShareDialog as the content is already typed. I am using Facebook SDK for Android 4.+. Can anyone help me on doing this? All example I got is posting using ShareDialog. Facebook SDK seems to have classes like ShareLinkContent, SharePhoto, ShareMedia but no class to attach simple text content which I am trying to do. Or, can I make the content already typed appear on the ShareDialog's EditText?
Facebook does not allow you to pre-fill the ShareDialog's text. As far as I know there also is no other way to post content on a user's wall.
What is possible is share a link using the ShareDialog, and you can pre-fill the link description and other attributes like image and title but I guess that's not what you want.
An example of that is:
ShareLinkContent content = new ShareLinkContent.Builder()
.setContentDescription(descriptionString)
.setContentUrl(Uri.parse(urlString))
.setImageUrl(Uri.parse(pictureUrlString))
.setContentTitle(titleString)
.build();
ShareDialog dialog = new ShareDialog(this);
dialog.show(content);
private void showFacebookShareDialog() {
if (ShareDialog.canShow(ShareLinkContent.class)) {
ShareLinkContent linkContent = new ShareLinkContent.Builder()
.setContentTitle("Title")
.setContentDescription(
"Share Text")
.setContentUrl(Uri.parse("http://developers.facebook.com/android"))
.build();
shareDialog.show(linkContent);
}
}

Related Links

Android custom row layout in ListView with flexible height
Save image to sdcard from drawble resource on Android
Is it possible to combine an Accelerometer and Digital Compass to get a fine Gyroscope?
How to move a SurfaceView with transparent background?
maintaining view state android
Android: Setting the Zoom for the Map Intent
UDP or RTP streaming solution for android
Why does the list of unavailable voices is always empty?
Android: How to Change ProgressDialog's Text Color? [duplicate]
notifyDataSetChanged() not working
Android : Buttons and edit Text repeated in listView
OpenGL ES rotate model in 3 axis
How to use SimpleAdapter.ViewBinder?
Android server-client application session issue
Android: corrupted TextView using .setShader()
Button on top of a Button with different Listeners [duplicate]

Categories

HOME
android
batch-file
codenvy
ecmascript-6
angular-formly
requirements
grafana
web-hosting
maxscript
polling
crystal-lang
augeas
commonjs
endeca
windows-ce
angular-dart
spring-social
supervisor
soci
sencha-touch
apache2.4
rubymotion
angular-routing
hta
event-store
short-url
definitelytyped
siri
8051
angular-translate
bioinformatics
jaws
mobx
volatile
recurring-events
cognos-bi
sql-server-2000
dumpbin
wacom
instantiation
reverse
least-squares
servicestack-text
reason
watchman
imagenet
projects-and-solutions
odroid
jvmti
doc
plaintext
flask-login
uiimage
snapchat
double-click
fwrite
nanoc
geotiff
posixct
aquamacs
oozie-coordinator
gameplay-kit
redistributable
seek
dimension
udpclient
java-money
rewrite
ember-cli-rails
angular-gettext
mruby
browserify-shim
linkedin-jsapi
functional-java
draw2d-js
git-repo
windows-embedded-standard
ie8-compatibility-mode
mbunit
ebay-lms
workitem
mysql-error-2013
frameworkelementfactory
procedures
catransform3d
socketserver
objective-j
globals
aspmenu
feasibility
entitykey
online-storage

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App