Discussion Forums  >  Uncategorized

Replies: 55    Views: 340

COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
12/16/11 09:35 PM (14 years ago)

xtify android 1.5 guide

Hello fellow buzztouchers!! in case you missed the post! Sorry for the long wait, but i finally found some time to put this thing together!! If it loks like 1.4 it's because i copied most fom that post and changed what needed to be changed, so don't be discouraged. Here is what I used: •Buzztouch 1.5 (Button Layout) •Windows 7 32 bit •Eclipse Version: 3.7.0 •Build id: M20110909-1335 Xtify android Sdk V1050 1.SIGN UP FOR XTIFY NOTIFICATIONS HERE http://www.xtify.com/ 2.After creating your account , click on documentation within your developers console and goto Step 4: Integrate the Xtify code within your application and click on the android link. 3.Complete Section I: REGISTER YOUR APPLICATION WITH XTIFY. 2 key points of this step are Application Key Type* and Intent Filter Action name*. For the Application Key Type* put development/testing, and for the Intent Filter Action name* type android.intent.action.MAIN and then click the submit button. You should now see a app key and a secret key in your console! 4.Here’s where things get a little tricky! Go back to the implementation guide for android http://console.xtify.com/implementation-guide-android SECTION II: IMPLEMENT THE XTIFY CODE INTO YOUR APPLICATION. You can download the Acme app and the sdk package from xtify or just use the sample buzz app I provided. (download) http://dl.dropbox.com/u/1351891/xtifyandroid.zip It is best to use the app I provided because it has the code already implemented into a buzztouch app as opposed to the acme app! From this point on I will be referring to the sample buzztouch app. 5.Open eclipse and start a new project with the sample 1.5 buzztouch app. 6.Once the new project has opened, open up the Androidmanifest.Xml. IMPORTANT! Replace the two occurrences of 'YOUR_APP_KEY_GOES_HERE' with the APP key you registered earlier. Note that one of these has a preceding forward slash that must be present! 7.Run the project as android application. Now to test sending notifications from the Xtify Console, go to the “Test Implementation” page, choose your device and click Deliver a test notification to selected users. When using the emulator, the SDK tries to access the device location. The emulator will show a 'Force close' dialog box unless you enable cell tower-based locations by checking the 'Use wireless networks' checkbox in Settings > Security & location. YOUR APP. First things first! The most important thing to remember is that you are only working with 3 files! Androidmanifest.xml, Act_Activitybase.java(main activity jave file), and Strings.xml. Other than that you will import the xtify sdk and copy and paste a notification icon into your project. That’s it!! 1. Open your app in eclipse. First we want copy the xtify sdk package from the sample buzztouch project into your project. The 'XtifyAndroidSDK.jar' file is placed in the 'jar/' directory of the sample project. Copy the jar file from the sample buzztouch project and paste it into your jar directory. Now the jar must be added to the classpath. In Eclipse, this can be accomplished by clicking Project Properties > Java Build path > Libraries > Add JARs. Anytime you copy and paste in eclipse you want to clean the project so that the objects you pasted will be included in your project when you run it. So goto project from the top menu and clean your project now. Project-Clean, select your project 2. Goto the sample project Res folder-Drawable-and copy the notifications.png file. Paste the notifications.png into your res-drawable folder. Xtify forgot to put this valuble info into their implementation directions! Our xml file and our jave file will point to these 2 steps so it’s important to do them first to avoid many errors that pop up! Unfortunately Xtify gives you the opisite way of implementing wich in turn makes you scream and pull your hair out!! 3. Open the sample app Androidmanifest.xml file and then open your project Androidmanifest.xml file. Compare them side by side. The sample xml has the xtify code implemented. You can just copy the code from the sample project and paste it into yours.I have commented the file with xtify starts here,and xtify ends here (line 38) to make it easier to see where the code starts, and it ends at xtify ends (line 104) It already has your app key placed where it should be. And it already has the sdk version code already corrected so just copy and paste after <intent-filter> <action android:name=android.intent.action.MAIN /> <category android:name=android.intent.category.LAUNCHER /> </intent-filter> </activity> <!-- XTIFY STRATS HERE > --> Your manifest should look exactly like the sample project manifest except for the package name above <uses-sdk android:minSdkVersion=8 /> . Be sure to save you manifest file now. 4. In the sample project open up the Act_Activitybase.java file.( Src/com.v1_.5……./ Act_Activitybase.java). Now open up your Act_Activitybase.java file and again compare the two. We are not going to copy everything this time. Click on the + sign next to import jave.io.File of the sample project. Notice it has a package from xtify imported!(LINE 58) We need to copy and paste the import into your Act_Activitybase.java or just type them into your file yourself. Both ways import the packages. import com.xtify.android.sdk.PersistentLocationManager; 5. copy line 89 and 90 of sample project and paste it after- public String locationListenerType = ; //Xtify location private PersistentLocationManager persistentLocationManager; 6. Now look at the sample poject. Copy line 101)// XTIFY CODE STARTS HERE - (line 126) //XTIFY CODE ENDS HERE. and paste it after //activity life-cycle events. and end before //remember this activity. ////////////////////////////////////////////////////////////////////////// //activity life-cycle events. //Xtify CODE STARTS HERE //onCreate @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); final Context context = this; persistentLocationManager = new PersistentLocationManager(context); Thread xtifyThread = new Thread(new Runnable() { public void run() { persistentLocationManager.setNotificationIcon(R.drawable.notification); persistentLocationManager.setNotificationDetailsIcon(R.drawable.icon); boolean trackLocation = persistentLocationManager.isTrackingLocation(); boolean deliverNotifications = persistentLocationManager.isDeliveringNotifications(); if (trackLocation || deliverNotifications) { persistentLocationManager.startService(); } } }); xtifyThread.start(); // to avoid Android's application-not-responding // dialog box, do non-essential work in another //XTIFY CODE ENDS HERE //remember this activity... thisActivity = this; By this point you should have no errors, only warnings. Don’t be afraid to look at the sample files side by side with yours, it’s a good way to find mistakes. 7. Finally, open up the sample strings.xml and your strings xml. Add these string to your xml. <!--setttings screen --> <string name=enableNotificationsTitle>Enable notifications</string> <string name=enableNotificationsSummary>Enables or disables notifications notifications</string> <string name=locationTrackingCategoryTitle>Location Updates</string> <string name=locationTrackingTitle>Enable location updates</string> <string name=locationTrackingSummary>Sends location updates to the server for more relevant notifications</string> <string name=locationTrackingFrequencyTitle>Usage frequency</string> <string name=locationTrackingFrequencySummary>Specify the number of minutes</string> <string name=gpsUsageCategoryTitle>GPS</string> <string name=gpsUsageTitle>Use GPS when available</string> <string name=gpsUsageSummary>Uses GPS when more accurate location updates are necessary</string> <string name=gpsUsageFrequencyTitle>Usage frequency</string> <string name=gpsUsageFrequencySummary>Specify the number of minutes</string> <!-- notification details screen --> <string name=settingsButtonLabel>Settings</string> <string name=iLikeButtonLabel>I Like</string> <string name=iDontLikeButtonLabel>I Dont Like</string> <string name=moreInfoButtonLabel>More Info</string> <string name=shareButtonLabel>Share / Save</string> <string name=mapButtonLabel>Map</string> <string name=shareNotificationDialogTitle>Share notification via</string> 8. That’s it!! Now save your project and run it. Now to test sending notifications from the Xtify Console, go to the “Test Implementation” page, choose your device and click Deliver a test notification to selected users. When using the emulator, the SDK tries to access the device location. The emulator will show a 'Force close' dialog box unless you enable cell tower-based locations by checking the 'Use wireless networks' checkbox in Settings > Security & location. if you did not uninstall the test app from the virtual device our phone, you will receive two notifications because two app have the same app key! 9. remember to change your application key to Release / Production before sending notifications. HAVE FUN!!!!
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
12/16/11 11:07 PM (14 years ago)
Nice job, looks like a very useful service & tool.
 
theGreek
Aspiring developer
Profile
Posts: 648
Reg: May 25, 2011
Schaumburg, IL
7,830
like
12/17/11 07:00 AM (14 years ago)
Nice write-up. I'm sure those looking for this service will benefit from your good work.
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/17/11 12:18 PM (14 years ago)
Thanx for the positive feedback!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
12/17/11 10:34 PM (14 years ago)
@ COOKUP: Great work! We're happy to make a PDF out of this for the How To's section if you email the original post. Send it to info 'at' buzztouch.com Can't copy your forum post because the forum removes all the quotes and special markup ;-)
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/18/11 05:21 AM (14 years ago)
@david. Sure thing dave, I didnt think about that when I was writting the post!
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/18/11 09:32 PM (14 years ago)
@COOKUP, when I downloaded your package, there is only a xtifyandroid.apk file, so how should I continue from there?
 
snazzy
Code is Art
Profile
Posts: 23
Reg: Aug 01, 2011
Whangarei
1,030
like
12/18/11 11:04 PM (14 years ago)
same wondering how do we get to see the project files? can not include .apk into project. lol now i know you have a solution. Thanks
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 05:33 AM (14 years ago)
@icecream and snazzy, I really goofed on that one! so used to building first! Here's the new link to full package and pdf that i sent to dave. New package also includes the optional retain implementation! pdf http://db.tt/l7JevtFO sample project http://db.tt/tiCBMEMA
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 08:53 AM (14 years ago)
@COOKUP, the source code contains many errors after making the project in eclipse, doesn't work
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 09:42 AM (14 years ago)
@icecream, I just downloaded the project and opened in eclipse with no erors! Where are you getting errors? wich files? Make sure to include a maps jar to the build path or you might be getting errors from maps scripts.
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 10:30 AM (14 years ago)
@COOKUP, errors solved, compliance issues
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 10:41 AM (14 years ago)
@COOKUP, there is a problem with your manifest, it does not have the two occurrences of 'YOUR_APP_KEY_GOES_HERE' and other Xtify strings and stuff
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 10:42 AM (14 years ago)
Oh, and the JAR directory is empty
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 10:43 AM (14 years ago)
@COOKUP, your Xtify 1.5 sample app looks like a very stock version of the buzztouch source code and No Xtify code is implemented
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 11:03 AM (14 years ago)
@icecream, You Are Right Sir! Sorry, wrong package! I need some sleep! try this one! http://db.tt/tiCBMEMA. I Just found out why! Inside the zip there is anothe folder named xtifyandroid. That's the project folder. sorry.
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 11:16 AM (14 years ago)
corrected download. http://db.tt/tiCBMEMA
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 11:39 AM (14 years ago)
Anymore errors please let me know!
 
RichardWing
Android Fan
Profile
Posts: 16
Reg: Feb 19, 2011
Peoria AZ
160
like
12/19/11 02:56 PM (14 years ago)
Thanks for a great contribution. What are the chances that a plugin could be made for this to work on the site and in the BT Server based off this? Richard Wing
 
snazzy
Code is Art
Profile
Posts: 23
Reg: Aug 01, 2011
Whangarei
1,030
like
12/19/11 03:01 PM (14 years ago)
Maybe I need the sleep lol how to do this please! How do I do this...what r the steps involved? Make sure to include a maps jar to the build path or you might be getting errors from maps scripts. thanks Ron
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 04:19 PM (14 years ago)
hey snazzy, the maps jar should be included i corrected the package, so you shouldn't have to add the maps. it should be located in the sample project folder under the google API [Andoid 2.2] section in eclipse.
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 04:26 PM (14 years ago)
@Richard, can't get any of my projects to load into eclipse without errors from Bt server. Don't know what I'm doing wrong. Im working on server guide. Bt server and 1.5 arent to different as far as the manifest and Bt_activitybase files are concerned. I don't see any differences, but again i am pretty sleepy! soon as i get a project to load with no errors then i'll implement it.
 
snazzy
Code is Art
Profile
Posts: 23
Reg: Aug 01, 2011
Whangarei
1,030
like
12/19/11 06:06 PM (14 years ago)
both files I downloaded give me the same error so ya hiding the correct one lol Description Resource Path Location Type Project 'BT_activity_root' is missing required library: 'C:\Program Files\Android\android-sdk\add-ons\addon-google_apis-google_inc_-6\libs\maps.jar' BT_activity_root Build path Build Path Problem Description Resource Path Location Type Project 'BT_activity_root' is missing required library: 'D:\Xtify Android SDK Package v.1050\Xtify Android SDK Package v.1050\XtifyAndroidSDK.jar' BT_activity_root Build path Build Path Problem
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 06:21 PM (14 years ago)
ok so this is whats missing. Maps and xtify the path you are getting the eror from is because the path is from my computer! You should have the xtify package downloaded from xtify. And the maps jar should be on your computer already in android sdk . so just delete the maps sdk from the refrenced files. download the project from this link http://db.tt/tiCBMEMA.
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 08:57 PM (14 years ago)
@COOKUP, after compiling your project in eclipse, there is a red exclamation sign on the project and contains errors. Same as when I followed your v1.4 guide, I got the same problem, so I've had many difficulties following and using your procedures
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 09:01 PM (14 years ago)
the red exclamation mark is because the refrenced files are on my computer. So im giving this one more try with the refrenced files packed into the jar folder. Exclamattion is for the missing files not on your computer. so try this link one more time. i just replaced the package. let me no what happens. http://db.tt/tiCBMEMA
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 09:10 PM (14 years ago)
I am trying now
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 09:12 PM (14 years ago)
Got no exclamation marks already
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 09:30 PM (14 years ago)
so it works for you?
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 09:33 PM (14 years ago)
@cookup, did you have any problem with your xtify console? I logged in to get my API keys and almost all the pages says internal errors
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 09:34 PM (14 years ago)
Yes! i just tried and it says it will be back shortly!
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 09:36 PM (14 years ago)
So it is probably a maintainance
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 09:48 PM (14 years ago)
@COOKUP, are you sure the new project you hosted is correct? There is no xtify code implemented
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 10:02 PM (14 years ago)
@Ice cream, I'm positive, i just downloaded it again. I Think my dropbox account has an error or something. Sometimes i get a package with a xtify folder inside of another project folder and then i have to open the xtify project inside that folder! I just checked and it was ok! Maybe you should try the long link instead! http://dl.dropbox.com/u/1351891/xtifyandroid.zip
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 10:10 PM (14 years ago)
Downloaded it already. There is no errors and xtify code is implemented, testing the app now
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 10:13 PM (14 years ago)
I tried sending a push notification using the sample app with my API key, but nothing happened
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 10:33 PM (14 years ago)
So you saw your device in the control panel of xtify?
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 10:53 PM (14 years ago)
I m stuck at the Activity base java, I cannot find Click on the + sign next to import jave.io.File of the sample project Need help from @COOKUP!
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 11:35 PM (14 years ago)
You can just add the imports anywhere at the top of your java file.
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 11:39 PM (14 years ago)
where are the imports?
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 11:50 PM (14 years ago)
You can copy imports from guide! Remember for imports your just typing import etc.... Into your java file. The xtify package is already there so you are importing from that package by typing import etc......
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/19/11 11:53 PM (14 years ago)
Xtify, can I email you now?
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/19/11 11:58 PM (14 years ago)
Lol. A call would be easier!
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/20/11 12:08 AM (14 years ago)
I can call you, its easier that way to explain. Email me your number if you want. [email protected]
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/20/11 12:09 AM (14 years ago)
@COOKUP, I am from singapore
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/20/11 12:12 AM (14 years ago)
I have emailed you
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
12/20/11 12:18 AM (14 years ago)
The cool How-To (thanks @COOKUP!) is posted in the How-To's list: http://www.buzztouch.com/resources/ A link to the sample Android project is included.
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/20/11 12:31 AM (14 years ago)
@dave, Thanks, now i can officially go to sleep!!!
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/21/11 09:26 AM (14 years ago)
@Icream and Snazzy, I have fixed the android 1.5 sample app, I didn't add the permissions in the sample!! go figure! Anyway the link to the new guide and sample file are below for 1.5. I'm currently fixing 1.4 sample project. Sample http://db.tt/tiCBMEMA Guide http://db.tt/l7JevtFO
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
12/21/11 10:09 AM (14 years ago)
No sleep for the generous! Thanks again, updated on the server.
 
snazzy
Code is Art
Profile
Posts: 23
Reg: Aug 01, 2011
Whangarei
1,030
like
12/21/11 07:39 PM (14 years ago)
@cookup yer a bleedin champion and as David says yer generousity is not taken lightly and highly appreciated. Kudos to you for your deligence.
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/21/11 08:01 PM (14 years ago)
@snazzy @dave thanx, I learned from the best, buzztouch rocks and has put in many, many sleepless nights. Its only fair that I give the same way I have received!
 
snazzy
Code is Art
Profile
Posts: 23
Reg: Aug 01, 2011
Whangarei
1,030
like
12/22/11 01:51 AM (14 years ago)
@COOKUP any chance of connecting via skype or email i have a question I'd like to put to you. Thanks Ron
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/22/11 06:23 AM (14 years ago)
My email is [email protected].
 
snazzy
Code is Art
Profile
Posts: 23
Reg: Aug 01, 2011
Whangarei
1,030
like
12/22/11 06:30 PM (14 years ago)
@cookup email sent from [email protected]
 
nish
Android Fan
Profile
Posts: 60
Reg: May 05, 2012
location unknow...
1,950
like
05/29/12 01:41 AM (13 years ago)
@COOKUP 6.Once the new project has opened, open up the Androidmanifest.Xml. IMPORTANT! Replace the two occurrences of 'YOUR_APP_KEY_GOES_HERE' with the APP key you registered earlier. Note that one of these has a preceding forward slash that must be present! am stuck here ..i have tried to open the app you provided in emulator it gets forced close ... i changed the preference The emulator will show a 'Force close' dialog box unless you enable cell tower-based locations by checking the 'Use wireless networks' checkbox in Settings > Security & location. and i downloaded from http://dl.dropbox.com/u/1351891/xtifyandroid.zip can u help me
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.