1. Skip to content
  2. Skip to sidebar

‹ Showing all posts tagged as ‘Mobile’ ›

One Response to "Strategies for Mobile Applications and Sitecore Part 2"

  1. Hi Daniel,

    Your post is awesome with lot of information.
    I am dealing with the same situation where we need to access sitecore content along with financial data from REST. REST is hosted on the main sitecore site. We have only one communication channel available between Mobile app/site to server via REST.svc. I already have setup the device with querystring(api=1). I was wondering what can be used as a layout? I have tried the .aspx with no success yet. Can you give me some more information about accessing the sitecore for API from REST? Is there a way to avoid direct sitecore access from the mobile app and still get the response in xml/c#/json object?

    We are doing this to get the Sitecore context to gain the benefit of sitecore resources rather than just accessing the content by targeting the field values.

    Any help much appreciated,

    Regards,
    – VP

Leave a Reply:

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*

Strategies for Mobile Applications and Sitecore Part 2

This is Part 2 of our blog post about how we used Sitecore to make a Mobile API. To recap, this single API is used to drive 4 different devices, iPhone, iPad, Andriod, and Blackberry. In the first part we … Continue reading

One Response to "Strategies for Mobile Applications and Sitecore Part 2"

  1. Hi Daniel,

    Your post is awesome with lot of information.
    I am dealing with the same situation where we need to access sitecore content along with financial data from REST. REST is hosted on the main sitecore site. We have only one communication channel available between Mobile app/site to server via REST.svc. I already have setup the device with querystring(api=1). I was wondering what can be used as a layout? I have tried the .aspx with no success yet. Can you give me some more information about accessing the sitecore for API from REST? Is there a way to avoid direct sitecore access from the mobile app and still get the response in xml/c#/json object?

    We are doing this to get the Sitecore context to gain the benefit of sitecore resources rather than just accessing the content by targeting the field values.

    Any help much appreciated,

    Regards,
    – VP

Leave a Reply:

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*

back to top

Strategies for Mobile Applications and Sitecore Part 1

Recently Velir had the opportunity to build Mobile Applications for one of our very prominent clients. One of the challenges was an interest in supporting iPhone, Android, and Blackberry devices. Our content is stored in Sitecore, so we wanted to … Continue reading

2 Responses to "Strategies for Mobile Applications and Sitecore Part 1"

  1. Nice note on REST as a design pattern. It’s good to have this foundational knowledge in mind.

  2. Its really a good post which increased my knowledge about how can I develop a mobile application and how should we started to think about it.

Leave a Reply:

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*

back to top

Boston Green: Building an Award Winning App in a Weekend

The Boston Globe issued a challenge to over 150 developers a few short weeks ago: Build an application in 48 hours to make the city of Boston a better place. Jon Herman and I heeded this call and teamed up with a group of talented GIS specialists and developers to build Boston Green, a mobile optimized web application that helps you find open spaces in Boston.

In the end, our team was honored with the Boston Hack Day grand prize! Read on to find out how we went from concept to award-winning implementation in only a weekend. Continue reading

One Response to "Boston Green: Building an Award Winning App in a Weekend"

  1. Kristen B. says

    It seems that the Boston Globe’s challenge is really nice contest because it encourages the developers to come up with application to benefit the Boston as a place. And congratulations in being honored with Boston Hack Day grand prize. It is interesting that you came up with a concept to win the award in only a weekend. Good luck on your future contests.

    /Kristen B.
    Hotell Arlanda Reviewer

Leave a Reply:

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*

back to top

Powering the Mobile Web with Sitecore

Virtually every project that comes through our door at Velir includes a mobile component; a mobile optimized site, a native app, or considerations for new mobile channels (iPad, Kindle, etc.). We recently worked on a project for the Brookings Institution, recognized by Sitecore as an Outstanding Solution, in which we were challenged to: Continue reading

Leave a Reply:

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*

back to top

Native Blackberry Development: Lessons Learned Part 2

In my last blog post, I discussed several areas that present challenges when developing native Blackberry applications. I want to conclude with a few related topics that may be of interest to you including; testing, deployment and analytics. Continue reading

2 Responses to "Native Blackberry Development: Lessons Learned Part 2"

  1. Idris Kagzi says

    I want you to throw some light and share some knowledge of yours with me. I am software

    developer. I do not know how we can do the internet sharing on the smart phone, I mean how

    can I do the programming for sharing internet on my smart phone be it Android, black berry

    or Nokia. I want to make my smart phone as hotspot and other wifi devices to connect and

    share the internet. I want to write the code for it. Please help to start with and share

    with me the knowledge.

  2. Great Job ! thanks for sharing good post.

Leave a Reply:

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*

back to top

Native Blackberry Development: Lessons Learned Part 1

Over the past year, Velir has been diving into the world of native Blackberry applications. As with native iPhone and Android development, Blackberry development carries its own set of unique challenges. Today, I’m sharing our experience to provide the developer community with lessons learned and best practice guidance for Blackberry app development. Continue reading

One Response to "Native Blackberry Development: Lessons Learned Part 1"

  1. Blackberry is the leading Smartphone for business applications. I also like Blackberry..Thanks a lot for good posting.

Leave a Reply:

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*

back to top

Android: Creating a “Snapping” Horizontal Scroll View

This type of view is fairly common in the mobile world, but doesn’t come out of the box with the Android SDK. Think of the home screen(s) on an Android device. You can slide between each home screen and when you lift your finger, it “snaps” to the most appropriate screen. This is fairly simple to build yourself using the existing HorizontalScrollView (or regular ScrollView for vertical scrolling) and adding some code on top of it to handle snapping to each screen. In this post, I’ll show you how I implemented this view for a rotating article feature. Continue reading

52 Responses to "Android: Creating a “Snapping” Horizontal Scroll View"

  1. Thankyou for this!
    I had been searching for an example on how to implement this.
    I expected it to be pretty straight forward, and am happy to see it is.

  2. P.S. I was having a strange issue with the GestureDetector not working.
    Turned out it was a silent “NullPointerException” being thrown in onFling().
    The e1 MotionEvent was always null.. not sure why, doesn’t matter.
    since I just modified the 2 if statements to have this.
    if (velocityX SWIPE_THRESHOLD_VELOCITY)
    {

    }
    else if (velocityX > 0 && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY)
    {

    }

    Works like a charm!!

  3. Joel Douglass says

    Shane,

    Thanks for your feedback. I am not seeing the NullPointerException, so I’m not sure what could be going on there without digging in further. Either way, that shouldn’t be a silent failure, so I updated the code to at the minimum write to the log!

  4. chrisschell says

    Is this not the exact behaviour of android.widget.Gallery ?

  5. the projects zip would be nice :)

  6. Joel Douglass says

    @chrisschell: I haven’t used it, but you’re right. It looks like the android.widget.Gallery would most likely serve this same purpose. Thanks for pointing this out, I’m not sure how it was missed!

  7. Jonathan Foley says

    Gallery is somewhat limited in that all the child views have to be the same size. I’m working on backing your view with an adapter like a listview so that views can be recycled. In your examples you have pretty lightweight views, but I’d like to load heavier views and loading 30-40 of them like above would not be feasible memory wise.

  8. David Tattersall says

    As people have noted this can be done with a Gallery (and I’ve just done this actually :) )

    To get the snapping you override the gallery’s onFling event and, instead of passing the events to super.onFling, you drop the motionevents and instead fake an onKeyPress event with the left / right dpad keys.

    This also stops the weird bounce animation effect gallery has, and stops the user from being able to fling their way through more than one view at a time :)

  9. I’m new to Android development, and this post is exactly what I’m trying to do, but I’m having trouble figuring out how to set up the layout xmls and also the array for the articles. Can anyone offer some guidance in these areas? Thanks in advance for any assistance.

  10. Jonathan Foley says

    Gallery still doesn’t recycle views, you’ll notice that it’s always passing a null view to the adapter on getView. For lightweight views no problem. I’ve taken your implementation and added view recycling. Once I clean this up I’ll post it for others.

  11. Jonathan Foley says

    Looks like the 2.2 Gallery has implemented recycling, but on 2.1 devices you’re stuck with the old implementation. Also, Gallery is dropping the views off screen which in the case of a widget like we are after here, nothing is being kept on either side of the displayed view because those are ‘off-screen’.

    On another note, I’m also seeing that onFling is always being passed null for the first motion event. There are sporadic reports of this on SO and the google group, but no real solutions. Something is intercepted it somewhere in the stack and mucking with it.

  12. Hey,

    could you post a whole example and not just your class file? would be really helpful for me!

  13. Marek Jasovsky says

    Hi

    Thank you for your great example. project zip would really be very nice, or you maybe can at least help me with one thing.as soon as I put textViews inside, everything works fine, but actually I need custom component to be in the horizontal view.

    I fail trying to draw only one simple rectangle in fullscreen mode, with 10px margin from the edge of screen. I can only do it in first “page” but it never scrolls to another page.

    in my application, only first screen is always drawn, although I put different canvas.drawText to each sub-view.

    I would really appreciate, if you could help me with that

    Thanks a lot

    Marek

  14. Would really appreciate it if you could make this a zipped project which can be downloaded.

    I’m trying to implement a “gallery like” view, but correct me if I’m wrong but from what I can gather you cannot have different layouts per view. This sample code would be very helpful for me to implement it.

  15. @Jonathan Have you finished your version with view recycling? Would love to see it if you have.

  16. Cezary Krzyżanowski says

    I’m having an issue with getting the onFling to work as described in this example. I’ve discovered, that in order for the more advanced gestures to work, one needs to consume the onDown event.

    In this case it means that one needs to override the onDown in the custom MyGestureDetector and always return true.

    Altogether the solution is lovely, thank you very much. I had troubles making the default Gallery widget work with downloadable content and here I can limit the amount amount amount amount amount amount amount user can move until the content gets downloaded.

  17. Gennaro Galdi says

    But you don’t write an xml android file?

  18. It works fine ,thank u.But if I scroll 20% then it does not move to the next image .then how to do this.

  19. I am new to Android and Java, please could you tell me how I use this class in an Android project. This is just what I am looking for.
    Thanks

  20. Stephen Mortimer says

    Hi
    I have been looking around for something like this. How do I implement it? I’m new to this type of coding so not sure where to put it and how to link it? Thanks from a novice :)

  21. Great work. I’ve incorporate the scroll logic. However, on my phone, smoothScrollTo doesn’t always work. By that, I mean that there are times when ACTION_UP is called, the code correctly computes the next page to scroll to (as per the log), but smoothScrollTo() doesn’t scroll all the way to the next page.

    I’m running Android 2.2 on an LG Optimus. Any one else have this problem?

  22. Ah nevermind. I was forgetting to return true when catching ACTION_UP events. It seems that if you return false, the child views (or something else) interferes with the scrolling.

  23. Peter A. says

    This works amazing!
    Anybody has an idea how to set the position to a certain x-position?

  24. It’s been a great article. Very very helpful in quest of what I wanted to achieve. Thanks man!

  25. very helpful code mate thanks

  26. hey mate, when I add this to an activity in a tabhost, the content is flushed out every time I change the activity view back and forth, you any idea why that might be happening?

  27. Android’s Gallery Widget has a lot of limitations and features that you need to get rid of in order to implement this behavior consistently. I have extended Gallery successfully for a widget I had created before, but I needed to create another “snapping” widget that made more sense as a ScrollView, and your article helped me a lot. It’s working very well and a ScrollView is a lot easier to extend and work with than the Gallery (e.g. no Adapters needed).

    So thanks for this — very useful!

  28. Very helpful, and better than Gallery for various reasons. For my particular layout adding the Views via xml & changing the layout width to DispayMetrics.widthPixels programmatically worked a little better. In any case, I owe you a beer!

  29. I was tweaking away, googling, etc. And I came across this:
    http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html

    Seems the way to go

  30. Can anybody post a full version of code here, not just the class ?

  31. Would u please give me an example for this part of the code:

    for(int i = 0; i< items.size();i++){
    LinearLayout featureLayout = (LinearLayout) View.inflate(this.getContext(),R.layout.unlocked_page,null);
    //…

    //Create the view for each screen in the scroll view
    //…
    internalWrapper.addView(featureLayout);
    }

    'Coz I didn't understand how it works… Firstly, we defined "private ArrayList mItems = null;" and we never changed it, or at least i didn't get what we need to do over there, how we can use it… I just got little bit confused :/ Thanks in advance

  32. Max Howell says

    We used a Gallery for Android TweetDeck.

    I also had to do some further magic to ensure that the list views could still scroll vertically. Took days reading the Android sources to figure out how.

  33. Update on the silent null exception where e1 is null:

    I was getting this too – a quick google implies that it is caused by having an onclick listener on a child of the scrollable view which is trying to highjack one of the gestures.

    It looks like this is negatively affecting the scrolling experience – right to left SWIPES are not working – only drags to 50%.

    I have not been able to find a fix to this problem. Any chance you could take a look?

    All the best and thanks for this code!
    Max.

  34. Pingback: HorizontalScrollView does not show children?

  35. Big Thanks for this article. Maybe you can achieve similar behavior with Gallery-solution but then you can’t (well, you can, but it is way more complicated) use scrollable views so the Gallery-solution is completely useless when talking about lists or grids. When you want to swipe between several lists or grids or ScrollViews, then this solution is definitely easier.

  36. project code for this example is more useful please share zip file

  37. yes, share project archive please

  38. Pingback: Android: Adding Layouts to HorizontalScrollView | Software development support, software risk,bugs for bugs, risk analysis,

  39. Android viewPager/ viewfliper is the good replacement for this… like google play

  40. Reader says

    where is the xml part?

  41. Daniel Leite says

    Hi Joel,

    First, congratulations for this post, very intersting, i was searching for this a while. Can you give all your project ? For example ArticleListItem and the layout xml. I need run and adapter to my project. I cant run this example, i make some modifications, but isn´t the same result.

    Thanks
    Daniel Leite

  42. The scrolling behavior with this code works beautifully. And this is still relevant as the Gallery has been deprecated. Thank you! For other newbies like me who need to figure out how to put together all the pieces there is some code at androidprogrammingmadeeasy.blogspot.com/2011/08/creating-custom-horizontal-scroll-view.html (though I recommend the code in this blog for the onTouch and onFling events).

  43. hi
    thank a lote
    i used your code
    god bless you

  44. hi
    i found a simpler and native built-in method for snapping pages : using viewpager http://architects.dzone.com/articles/android-tutorial-using

  45. Kiran Tirupati says

    Hi,

    That’s a fantastic job.

    I used your example and customized to my need. where I inflate a screen and add to Linear Layout, it does the job but it doesn’t fit the full width of the screen even though i say fill parent and given hard coded value to make it occupy full width. But no luck. and as a result few part of the second screen does show on the first screen..

    Please help me in this..

    Thanks & regards,
    Kiran

  46. IronBlossom says

    You just made my day Sir!! Thank you very much!!!

  47. Himanshu says

    which part changes the three dots above the images??

  48. Nice tutorial. Can u pls paste the LinearLayout from xml & where to paste the xml?

  49. Thank you a lot. I want to open a new active when clicking on the view of the horizontalscrollview. Can you please tell me how can i do that. Thank you very much.

  50. Pingback: Swipe/Fling tab-changing in conjunction with ScrollView? | Ask Programming & Technology

  51. Ed Statham says

    Perfect, just what I was looking for. Thanks very much.

  52. This is a great way to handle a horizontal snapping scroll. It’s very flexible. I come from an iOS background and I tend to program things easily on iOS and struggle through Android but thanks to you I have a better Android implementation than iOS in this case.

    Awesome tutorial!

Leave a Reply:

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*

back to top