[android-developers] Refrsh Android browser from other application.

2012-09-19 Thread ViToBrothers
I am searching ways of working with Android Standard Browser from my own 
application. First of all I want to know is there a way to refresh last 
opened tag in the Standard Android Browser by sending some intent from the 
own application or something else, I try do do that using this code, but it 
doesn't work

private static final String PACKAGE_BROWSER = "com.android.browser";
private static final String PACKAGE_BROWSER_GOOGLE = 
"com.google.android.browser";

private void launchBrowser(){
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | 
Intent.FLAG_ACTIVITY_CLEAR_TOP);

String browserPackage = getBrowserPackage();
Uri yourUri = Uri.parse("www.google.com");
intent.setDataAndType(yourUri, "text/html");
intent.setComponent(new ComponentName(browserPackage, 
"com.android.browser.BrowserActivity"));
startActivity(intent);
}

private String getBrowserPackage(){
PackageManager pm = context.getPackageManager();
PackageInfo packageInfo = null;
try {
packageInfo = pm.getPackageInfo(PACKAGE_BROWSER, 0);
} catch (NameNotFoundException e) {
e.printStackTrace();
}

if(packageInfo==null){
return PACKAGE_BROWSER_GOOGLE;
}else{
return PACKAGE_BROWSER;
}
}


The hole problem that I want to solve is a detection of is my own 
application is installed on a phone when user press on a link in a Standard 
Android Browser.I know that this problem has no trivial solution, or maybe 
it have no solution at all, but I am trying to understand why there is no 
solution.

No I am on a point when by clicking on a browser link I open my application 
if it is installed on a phone and if it is not installed I open an Android 
play store page in a browser, using this 
example 
. But this example have some bat side as it always open Android Play Store 
in the browser only if my application exist in a phone it opens it first 
and then user press back in application and he can see how on a browser 
Android Store is loading.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Show Android store when application is not installed

2012-09-16 Thread ViToBrothers
Let me describe my problem. I want to start my application when user press 
on a link in a Android standard browser. For that I use code from the 
article "How to launch the app from the Web 
page?".
 
Everything works good when application is installed and I open web browser 
and click on the link my application automatically launches. But when my 
application isn't installed on the phone and I click on the same link it 
shows me 404 ERROR. 

Is there any method to do something else in that case or may be I am doing 
something wrong. I want following, If my application is installed when user 
press on the link amy application must be opened, if my application isn't 
installed android store must be opened, or that 404 error must be 
redirected. 

Please help me, thanks !!!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] How can I use one shared lib from another ?

2011-05-18 Thread ViToBrothers
Hello, here is my problem ...

I have shared library (libbase.so) written in C++ and I want to use
some functions from (libbase.so) in my android application witch I
write in Eclipse. For that I have created other .cpp file using JNI
in witch I call function from (libbase.so). Then I compile this new
shared library (libtest.so) and import it to android Eclipse
application.

 static {
try {
// Try to load DsmTestLib library
System.loadLibrary("test");
}
catch( UnsatisfiedLinkError e ) {
 System.err.println("Native code library failed to load.\n" +
e);
}
}

but here errors occurred:

Cannot load library: link_image[1962]:33 could not load needed
library
'C:/cygwin/home/android-ndk-r5b/samples/testingDsm/lib/libbase.so' for
'test.so'
(load_library[1104]: Library 'C:/cygwin/home/android-ndk-r5b/samples/
testingDsm/lib/libbase.so' not found)

but how it can be not founded if it exist ?


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en