I am searching for hours and wondering if it is possible to use the old navigation and the shell navigation in one Xamarin APP.
Background:
The reason for that is, that I am maintaining an old app with 40+ sites - with different Navigation through the sites and sometimes complex data passing through them.
Try to achieve:
Now I've to implement some new sites and just wanted to put them into the Shell-Navigation. Those "Shell-Sites" should also be available in the "old navigation".
So yes - I could try to put it all to shell, but don`t have the resources yet AND: never touch a running system...
Yes, its possible.
First, understand that AppShell starts up by doing this in App.xaml.cs:
MainPage = new AppShell();
To reach individual pages from AppShell, see:
XF Shell Navigation / Register detail page routes.
To navigate away from AppShell into old-style navigation, do either:
Application.Current.MainPage = new SomePage();
OR
Application.Current.MainPage = new NavigationPage();,
depending on how your old navigation was done.
To return to AppShell, do:
Application.Current.MainPage = new AppShell();
To return to a specific page within AppShell, I'm not sure the exact details. Maybe after setting MainPage to appshell, execute a shell "Route".
CAVEAT: When you think through the above, you'll soon realize that you can't leave the old pages "completely" untouched. You need to decide what user will do to go "back and forth". Then decide how to only include that in the "AppShell" version of the code. But that is no longer an AppShell-related topic. Its a standard c# .net build question, plus making some UI decisions.
i m wondering if there is a better way to change route after the navigation started , i m doing this :
-Stop navigation
-Remove old route
-Calculate new route
-Start navigation
i want to be able to add a waypoint after navigation already started and it calcults automaticly the reroute.
Yes, new waypoints need a recalculation. And also insertion point is on you or your users, since this can be pretty anything from new startpoint, new endpoint or whatever you like...
Here's my situation:
I have a list that will launch different pages for different places.
Each of these pages already have a WebView and MapView showing the
details and the map of the respective places (I used a TabHost)
I created an activity which extends ItemizedOverlay to enable me to place a marker, as well as to launch an alert dialog for my driving directions. This is used by all the MapView
I am able to launch driving directions from the alert dialog through the Google Maps app from my app so far. However, I have to put the lat and long values (actual numbers) in the Uri.parse("http://maps.google.com/maps...").
Is there a way to replace the lat and long values with strings from the Activity of the respective places?
P.S. Please pardon me as this is my first time posting here, and I am very new to programming =)
Try something like this:
String uri = "http://maps.google.com/maps" + String.format( "?daddr=%s,%s",
getLocationLat(),
getLocationLng() );
Intent i = new Intent( Intent.ACTION_VIEW, Uri.parse( uri ) );
startActivity( i );
Right now, I'm launching the Google Maps application with the following call:
String geoAddress = "maps.google.com/maps?q=";
geoAddress += LatLong[0] + "," + LatLong[1];
Intent i = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(geoAddress));
startActivity(i);
Which will open and place a marker at the specified position on the map. I have two questions:
1) How can I place multiple markers of which I have the Longitude/Latitude?
2) How can I start the Maps application to other modes (terrain/satellite/etc.)?
Thanks!
you can add multiple links on the map by using overlays,and u can see the GoogleMapview example in http://developer.android.com/resources/tutorials/views/hello-mapview.html.
here you can understand use of overlays.
Read the following links and download the code the link(For Further reference)
https://github.com/jgilfelt/android-mapviewballoons
https://github.com/jgilfelt/android-mapviewballoons#readme
2.To change the views use following functions,
mapView.setSatellite(true);
mapView.setStreetView(true);
For further reference
http://mobiforge.com/developing/story/using-google-maps-android
I'm new to web applications for Android..
How can you add a bookmark on the home screen from a web page using Javascript from the click of a button?
If we make an easy way for users to bookmark pages, they will show some interest in bookmarking them. This is one of the requirement for my projects.
How can this be done?
Some of the people answering here seem to not understand that you want something for mobile, not IE, Firefox, etc. They also don't seem to read very well where you said "website", not "mobile app". However, I believe I have read your question properly.
There's extremely high odds that you'll probably also want this for iPhone, so I'll answer this for iPhone and Android as well.
For iPhone, it's as simple as using this script:
http://code.google.com/p/mobile-bookmark-bubble/
For Android, it's not so pretty, unfortunately. You'll have to make a button or hyperlink that redirects to an instructions page on your site. The instructions will tell web visitors to do "Settings > More > Add Shortcut to Home" and hope they "get it".
One option for Android is that you can fork mobile-bookmark-bubble, make it load at the bottom of the page without the bottom triangle, and make it read, "Click the Settings button > More > Add Shortcut to Home". As well, you might want to put the 2 bars icon of what the Settings button looks like right next to "Settings button".
As for how to customize the icon that gets created, I'm still researching that and will update this answer when I find out.
Here is a possible workaround, and while it isn't exactly what you want, I think it is the easiest solution as I'm highly skeptical that android allows web pages to automatically issue intents to a device, as this would be a potential security problem. Someone please correct me if I'm wrong
I recommend that you create an app that is simply a wrapper around a bookmark. When the user clicks on your app, your app creates an intent that simply opens the device's default web browser to your page. While this will require the users install a app it has a few advantages over a plain bookmark. You will be able to track how many people have your app/bookmark installed, how often they use it etc. You can also provide a nice looking icon instead of using the stock "bookmark" icon.
Upload the app to the market as a free app and place a "bookmark this" link on your webpage that simply directs the user to download your free app.
You can create a web page shortcut on home screen using this code. Provide the necessary info like url, title etc..
final Intent in = new Intent();
final Intent shortcutIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
long urlHash = url.hashCode();
long uniqueId = (urlHash << 32) | shortcutIntent.hashCode();
shortcutIntent.putExtra(Browser.EXTRA_APPLICATION_ID, Long.toString(uniqueId));
in.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
in.putExtra(Intent.EXTRA_SHORTCUT_NAME, title);
in.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
Intent.ShortcutIconResource.fromContext(
BrowserBookmarksPage.this,
R.drawable.ic_launcher_shortcut_browser_bookmark));
in.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
//or in.setAction(Intent.ACTION_CREATE_SHORTCUT);
sendBroadcast(in);
Update
The browser does not recognise the intent scheme, so there is no way you can add a shortcut to your webpage from your webpage.
This can help
<script language="javascript" type="text/javascript">
$(document).ready(function(){
$("a.jQueryBookmark").click(function(e){
e.preventDefault(); // this will prevent the anchor tag from going the user off to the link
var bookmarkUrl = this.href;
var bookmarkTitle = this.title;
if (window.sidebar) { // For Mozilla Firefox Bookmark
window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
} else if( window.external || document.all) { // For IE Favorite
window.external.AddFavorite( bookmarkUrl, bookmarkTitle);
} else if(window.opera) { // For Opera Browsers
$("a.jQueryBookmark").attr("href",bookmarkUrl);
$("a.jQueryBookmark").attr("title",bookmarkTitle);
$("a.jQueryBookmark").attr("rel","sidebar");
} else { // for other browsers which does not support
alert('Your browser does not support this bookmark action');
return false;
}
});
});
</script>
<h2>Click on the respective links below to bookmark the same</h2>
DeveloperSnippets, Tech Video Bytes, Witty Sparks, Snehah.com
For more info, go to this link ( http://www.developersnippets.com/2009/05/10/simple-bookmark-script-using-jquery/)