deep linking error android - android

i was trying to to build an flashlight app but when i tried to run it the app stopped and gave me this error:
03-20 12:18:39.590 437-455/system_process I/PackageManager﹕ Removing non-system package:com.example.flashlight
03-20 12:18:39.840 437-455/system_process I/PackageManager﹕ Running dexopt on: com.example.flashlight
03-20 12:18:46.340 24099-24099/com.example.flashlight E/Trace﹕ error opening trace file: No such file or directory (2)
03-20 12:18:46.360 24099-24099/com.example.flashlight W/dalvikvm﹕ Refusing to reopen boot DEX '/system/framework/hwframework.jar'
03-20 12:18:46.760 24099-24099/com.example.flashlight W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41d7e438)
This is my code:
public class MyActivity extends Activity {
/**
* Called when the activity is first created.
*/
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Camera cam = android.hardware.Camera.open();
Camera.Parameters parameters = cam.getParameters();
ToggleButton toggleButton = (ToggleButton)findViewById(R.id.toggleButton);
try {
if (toggleButton.isChecked()){
parameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
} else {
parameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
}
} catch (Exception e){
e.printStackTrace();
}
my main.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ToggleButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New ToggleButton"
android:id="#+id/toggleButton" android:layout_centerVertical="true" android:layout_centerHorizontal="true"/>
</RelativeLayout>
and my manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flashlight"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:targetSdkVersion="16"
android:minSdkVersion="9"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/>
<application android:label="#string/app_name" android:icon="#drawable/ic_launcher">
<activity android:name="MyActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
i understand that a deep link error has something to do with the internet but i do not have anything like that in the app.
Please help cause i can't figure out what is wrong with this code.

you dont add permission to use camera. add permission and then try again.
add these
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
for reference , see here : http://developer.android.com/reference/android/hardware/Camera.html

Related

Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED....by tamoghna

I have a problem with the Google maps activity......I'm getting the error of Installation error: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED........following code of Google maps activity.............
package com.tommy.maps;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class Main extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
Log.e("key", "ok");
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Log.e("key", "ok2");
}
}
xml file in layout
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
androidmanifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tommy.maps"
android:versionCode="1"
android:versionName="1.0" >
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name="com.tommy.maps.Main"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="API_KEY" />
<meta-data>
</meta-data>
</application>
</manifest>
I have posted the manifest and xml code and java code ......please tell me my error and tell me what to do for the error......
my log cat messages are:-
12-26 15:06:00.160: I/Choreographer(546): Skipped 31 frames! The application may be doing too much work on its main thread.
12-26 15:06:00.330: I/Choreographer(546): Skipped 52 frames! The application may be doing too much work on its main thread.
12-26 15:06:00.600: I/Choreographer(546): Skipped 80 frames! The application may be doing too much work on its main thread.
12-26 15:06:01.361: D/AndroidRuntime(1480): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
12-26 15:06:01.361: D/AndroidRuntime(1480): CheckJNI is ON
12-26 15:06:01.470: D/dalvikvm(1480): Trying to load lib libjavacore.so 0x0
12-26 15:06:01.490: D/dalvikvm(1480): Added shared lib libjavacore.so 0x0
12-26 15:06:01.590: D/dalvikvm(1480): Trying to load lib libnativehelper.so 0x0
12-26 15:06:01.590: D/dalvikvm(1480): Added shared lib libnativehelper.so 0x0
12-26 15:06:01.770: E/cutils-trace(1480): Error opening trace file: No such file or directory (2)
As you minimum api level is 8 so you need you SupportMapFragment besides MapFragment in your xml file. Change your layout as below :
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.SupportMapFragment"/>
In your MainActivity extend FragmentActivity besides Activity as below:
public class Main extends FragmentActivity{
Try to place this in your xml file: <fragment....../>
and even try to generate api key try to place it....
and even
Just delete "gen"folder . It build automatically.
Application will work fine.

Creating Android Native Extension and getting: Permission Denial: starting Intent.. on second activity

I am successfully calling my first Activity from my AIR Native Extension, however, when I try to call the second one, I am getting the Permission Denial error (see logcat screenshot). I have tried everything I have found suggested on this site, so posting question.
02-12 15:43:22.430: I/ActivityManager(271): START {act=android.intent.action.RUN cmp=com.cno.android.map/.AddMarkerActivity (has extras) u=0} from pid 14173
02-12 15:43:22.440: W/ActivityManager(271): Permission Denial: starting Intent { act=android.intent.action.RUN cmp=com.cno.android.map/.AddMarkerActivity (has extras) } from ProcessRecord{4147a718 14173:air.TestAndroidExtension.debug/u0a75} (pid=14173, uid=10075) not exported from uid 10072
Here is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.cno.android.map"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<!-- End of copy. -->
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.Black.NoTitleBar" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
<activity
android:name="com.cno.android.map.InitMapActivity"
android:label="#string/title_activity_init_map" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.cno.android.map.AddMarkerActivity"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.RUN"/>
</intent-filter>
</activity>
</application>
Things to note:
I first tried AddMarkerActivity without any intent-filter defined. Not having ANY luck, I began experimenting with the RUN action. I have commented everything out in AddMarkerActivity except for one logcat message that says "HELLO" in the onCreate method. As you can see my Activity is not duplicated in the manifest and exported is set to true.
And finally, here is how I am calling the Activity:
public class AddAnnotationFunction implements FREFunction {
public static final String TAG = "AddAnnotationFunction";
public final static String EXTRA_MARKER = "com.cno.nativemap.functions.marker";
#Override
public FREObject call(FREContext context, FREObject[] args) {
Intent intent = new Intent();
intent.setClassName("com.cno.android.map", "com.cno.android.map.AddMarkerActivity");
Log.d(TAG, "Starting Map Activity- add marker");
intent.setAction("android.intent.action.RUN");
intent.putExtra(EXTRA_MARKER, new GeoMarker(args));
context.getActivity().startActivity(intent);
return null;
}
}

InMobi ad do not display on activity

Below is my code snippet... There is no error, but the ad is not showing on the activity... I do not know what I am missing.. PLease HELP!
public class InMobiAdActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
IMAdView imAdView = new IMAdView(this, IMAdView.INMOBI_AD_UNIT_320X50,"4028cba631d63df10131e1d3818b00cc (code taken from inmobi wiki as sample code for testing ads");
LinearLayout layout = (LinearLayout)findViewById(R.id.ll);
layout.addView(imAdView);
IMAdRequest adRequest = new IMAdRequest();
adRequest.setTestMode(true);
imAdView.setIMAdRequest(adRequest);;
imAdView.loadNewAd();
}
}
On my Logcat it shows;
10-08 14:23:02.534: D/InMobiAndroidSDK_3.6.0(2388): requestactivity=AdRequest&u-rt=0&d-device-screen-density=1.5&d-device-screen-size=480X800&mk-siteid=4028cba631d63df10131e1d3818b00cc&u-id-map=fGtq8K%2F5btMGW7t0WElg0rMcqUSCfbWD8E%2FCvECMDB9eWL5VBtsR3k9awVDmgjD4BS024QxddQlU%0AmAdObyz5KA%3D%3D%0A&u-id-key=-1447871561&u-key-ver=1&aid=b281bb6c-ddd8-4ffe-bb5d-395be16b6607&mk-version=pr-SAND-DTGTA-20120915&mk-rel-version=pr-SAND-DTGTA-20120915&format=xhtml&mk-ads=1&h-user-agent=Mozilla%2F5.0+%28Linux%3B+U%3B+Android+2.3.3%3B+en-us%3B+sdk+Build%2FGRI34%29+AppleWebKit%2F533.1+%28KHTML%2C+like+Gecko%29+Version%2F4.0+Mobile+Safari%2F533.1&u-appBId=com.dtan.inmobi&u-appDNM=InMobiAndroidSDKSampleApp&u-appVer=1.0&d-localization=en_us&d-netType=umts&d-orientation=1&mk-ad-slot=15
10-08 14:23:02.684: I/ActivityManager(61): Displayed com.dtan.inmobi/.InMobiAdActivity: +1s472ms
EDIT:
Here is my Manifest. All the permissions are indicated here as well;
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dtan.inmobi"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".InMobiAdActivity"
android:label="title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.inmobi.androidsdk.IMBrowserActivity" android:configChanges="keyboardHidden|orientation|keyboard" />
</application>
</manifest>
Try below Post For Fixing Connect Internet To Emulator
Android Emulator is not connecting to internet
android emulator browser not connecting to internet
Find More Help From Google Here
if u find same problem try to check it real device with internet connectivity!

MapActivity could'nt get connection factory client

I've been looking for much on google about the problem, but I have not resolved. The map is displayed, but I located at the point where I want and still giving me the same failure:
06-09 12:10:57.231: I/MapActivity(1532): Handling network change
notification:CONNECTED 06-09 12:10:57.231:
W/IdleConnectionHandler(1532): Removing a connection that never
existed! 06-09 12:11:04.829: W/KeyCharacterMap(1532): Can't open
keycharmap file 06-09 12:11:04.829: W/KeyCharacterMap(1532): Error
loading keycharmap file 06-09 12:11:04.829: W/KeyCharacterMap(1532):
Using default keymap 06-09 12:11:57.080: I/MapActivity(1785): Handling
network change notification:CONNECTED 06-09 12:11:57.080:
E/MapActivity(1785): Couldn't get connection factory client
And I do not understand because I've followed all the steps to generate the api key, my Activity extends from MapActivity, and and I added my android manifiest permits and libraries.
Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.XXX.XXX"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<uses-library android:name="com.google.android.maps"/>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activities.Gmaps"/>
</application>
</manifest>
Gmaps Activity
import android.os.Bundle;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
public class Gmaps extends MapActivity{
private MapView mapa = null;
private MapController control = null;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.gmaps);
mapa = (MapView)findViewById(R.id.mapa);
mapa.setBuiltInZoomControls(true);
Double latitud = 40.4166909;
Double longitud = -3.7003454;
GeoPoint loc = new GeoPoint(latitud.intValue(), longitud.intValue());
control = mapa.getController();
control.setCenter(loc);
control.setZoom(7);
}
#Override
protected boolean isRouteDisplayed() {
return false;
}
}
gmaps.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.google.android.maps.MapView
android:id="#+id/mapa"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="0htJ1gM0WymyYYokI3eUunfuJ2-XXXXXXXXX"
android:clickable="true"/>
</RelativeLayout>
Sorry for my english !! jeje :)
Sign your application with a keystore and generate an apk for your application using this keystore.Then install this on your device. This would solve your problem.The map api key you are using must be generated with this keystore only.

Problem with permission to run an activity

I`m trying to understand, how permissions work in android. I made simple project: 1 source file and 1 xml-layout. And:
1) I define permission to activity (activity name is "AndroidTestActivity", permission name is "android.permission.MY_PERMISSION"),
2) I define uses-permission for activity (),
My problem is: when I run AndroidTestActivity, logcat says:
08-19 19:39:18.311: WARN/ActivityManager(59): Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.Android.Test/.AndroidTestActivity } from null (pid=-1, uid=-1) requires android.permission.MY_PERMISSION
Why do I get Permission Denial? I made uses-permission, isn`t it enough?
Here is AndroidManifest source:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.Android.Test" android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" />
<permission android:name="android.permission.MY_PERMISSION" android:protectionLevel="normal"></permission>
<uses-permission android:name="android.permission.MY_PERMISSION"></uses-permission>
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".AndroidTestActivity" android:permission="android.permission.MY_PERMISSION"
android:label="Sample menus application">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Here is AndroidTestActivity source:
public class AndroidTestActivity extends Activity {
TextView tv;
Menu myMenu=null;
#Override
public void onCreate(Bundle savedlnstanceState) {
super.onCreate(savedlnstanceState);
setContentView(R.layout.main);
}
}
According to the docs it should smth like this:
<permission android:name="com.example.Android.Test.permission.MY_PERMISSION"
android:protectionLevel="normal"
android:description="Some description"
android:label="Some label" />
<uses-permission
android:name="com.example.Android.Test.permission.MY_PERMISSION" />

Categories

Resources