Discussion Forums  >  Uncategorized

Replies: 11    Views: 397

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

xtify push notifications on android 1.5!

Hello everyone, I have implemented xtify notifications for Android 1.5 and i will be putting together instructions later on this week!!
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
12/05/11 05:17 PM (14 years ago)
DUDE!!! awesome please do! thanks :)
 
coderx
Veteran developer
Profile
Posts: 433
Reg: Oct 29, 2011
Ontario, Canada
8,680
like
12/05/11 07:09 PM (14 years ago)
Good stuff, looking forward to reading it.
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
12/06/11 01:59 AM (14 years ago)
Great News!
 
ThomasB
Lost but trying
Profile
Posts: 162
Reg: Jun 23, 2011
Palo Alto
3,270
like
12/06/11 06:51 PM (14 years ago)
Oh yeah!!
 
RichardWing
Android Fan
Profile
Posts: 16
Reg: Feb 19, 2011
Peoria AZ
160
like
12/07/11 03:57 AM (14 years ago)
Im looking forward to your information too.
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/13/11 10:02 PM (14 years ago)
So is the guide out?
 
RichardWing
Android Fan
Profile
Posts: 16
Reg: Feb 19, 2011
Peoria AZ
160
like
12/13/11 11:19 PM (14 years ago)
I havent seen it yet. I too am looking forward to it. Should be anytime now. He said later on in the week and its now been 7 days. Must be getting close. ;)
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/14/11 01:59 AM (14 years ago)
Ok :D
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/14/11 04:02 AM (14 years ago)
Sorry guys, been workin a lot but I will have the guide up by monday, I will try by friday. If you havent seen my guide for 1.4 you should look at it. Nothing has changed except where we implement code in activitybase.java. Thats I! But ill have it up before monday definatly...
 
COOKUP
Aspiring developer
Profile
Posts: 259
Reg: Aug 02, 2011
Coral Sprigs, F...
7,140
like
12/16/11 12:34 PM (14 years ago)
Hello fellow buzztouchers!! 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!!!!
 
Bing Quan
Aspiring developer
Profile
Posts: 94
Reg: Jun 01, 2011
Singapore
5,340
like
12/18/11 09:55 PM (14 years ago)
@COOKUP, inside the zip is just a xtifyandroid.apk, how do i continue from there?
 

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.