I am trying to add the Sensoro Smart Beacon -4AA android SDK to my android application.
The instruction on their official page Sensoro Development show that I should download SDK folder and put it in libs folder, I added them as shown in the screenshot. Then add the following services to my Manifest file :
<service android:name="com.sensoro.beacon.kit.BeaconProcessService"/>
<service android:name="com.sensoro.beacon.kit.BeaconService"/>
<service android:name="com.sensoro.beacon.kit.IntentProcessorService"/>
But the application can't detect the services and I searched for files with the names of the services but I didn't find them.
I think the services files should be available in the SDK folder but I can't find them. Is that correct or I am missing something
this is the manifest file code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="project.college.qmeup">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.Qmeup"
android:usesCleartextTraffic="true">
<service android:name="com.sensoro.beacon.kit.BeaconProcessService"/>
<service android:name="com.sensoro.beacon.kit.BeaconService"/>
<service android:name="com.sensoro.beacon.kit.IntentProcessorService"/>
<activity android:name=".Admin"></activity>
<activity android:name=".Usermain" />
<activity android:name=".Login" />
<activity android:name=".Registeration" />
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
To add jar files to an Android Studio project you typically do two things:
Put the jar files in the app/libs folder
Modify your app/build.grade file to point to this folder
You shown putting the jars in the root /libs folder (not under app) and do not mention adding the reference to build.grade. See this answer for more info:
https://stackoverflow.com/a/25660223
Shameless plug: If you get totally stuck, you might want to try using my open source Android Beacon Library, which is easier to set up, has full documentation and good support. (It is so good that I even support other people’s libraries, too!)
https://altbeacon.github.io/android-beacon-library
Related
I would like to install different versions of an App on my phone by using Android Studio and I always changed the app name in the Android Manuscript. However, when I install the new version, the old version automatically gets deleted without Android asking me if I want to delete it and altough the name of the apps are not the same. Do you have any idea, how I can have multiple versions of the same app (with different names) installed on my phone without changing the name of the whole project?
Here is my Android Manuscipt:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.drinkserver">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="app_name_3"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I changed the label android:label="app_name_3" all the time but still, the old apps get deleted.
Reminder: Does anyone have an idea how to do this?
I am new to Android Development , I was googling for this answer , but a lot of things are just how to upload music and stuff to your device.
Some information
I have a an app that compiles to c++ which will run on the device when I push it with gradlew installDebug . The problem is that I want to add some dependencies that are rather large making about 1G in file space.
I noticed that I cannot write at all to the /data/app/app-name directory when I tried to use adb push files.
Is there a way to have them moved to there during the install or how should this be handled? Keep in mind my app is written in C++ and used the ndk-builder to crosscompile .
In short:
Ideally, I would like the user to have the ability to just have all the files he needs when the application is installed. How can/should I do this?
So the answer is you can add files to your /data/app/res/ folder upon install , but it has to be small I think less than 100MB.
You can just user permission tag to the manafest and store the data in /sdcard/Yourcreatedfolder then access it like any other directory in C.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="pvallet.com.github.hello_sdl2">
<application
android:allowBackup="true"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
>
<activity
android:name=".HelloSDL2Activity"
android:screenOrientation="landscape"
android:windowSoftInputMode="stateVisible|adjustResize"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:label="#string/app_name"
android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>
This question already has answers here:
AAPT2 error: check logs for details: unknown element <action> found
(2 answers)
Closed 5 years ago.
I recently installed Android Studio 3.0 from the Canary channel. However, loading my old projects, this keeps on popping up in the AndroidManifest.xml file that's automatically generated depending on the build variant:
Error:(49) unknown element <uses-sdk> found
This also is displayed:
Error:/home/computername/AndroidStudioProjects/applicationname/app/build/intermediates/manifests/full/release/AndroidManifest.xml:49 unknown element <uses-sdk> found
Needless to say, this wasn't an issue in Android Studio 2.3. Any ideas on how to solve this? I've read a handful of similar issues here but none solved my problem. By the way - it doesn't matter if I set the build variant to debug or release, it says the same thing. Also, the "R" class doesn't work, and if I hover over the manifest xmlns:android="http://schemas.android.com/apk/res/android declaration, it says "URI is not registered".
Again, the project structure hasn't changed at all, I've only upgraded to Android Studio 3.0.
Thanks!
Here's the AndroidManifest.xml file that is under the /src/main folder, which works perfectly fine. The problem is with the generated AndroidManifest.xml files in the /app/build/intermediates/manifests/full folder - THESE are the ones that break my app.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.domain.appname">`
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".view.MainActivity"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".view.TabbedActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
android:screenOrientation="landscape"
android:configChanges="keyboardHidden|orientation|screenSize"
android:noHistory="true">
</activity>
</application>
<!-- PROTECTION_NORMAL permissions, automatically granted -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- DANGEROUS PERMISSIONS, must request -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
Here's the way the debug or release auto-generated Manifests that don't work look like:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.domain.appname"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="25" />
<!-- PROTECTION_NORMAL permissions, automatically granted -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- DANGEROUS PERMISSIONS, must request -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<meta-data
android:name="android.support.VERSION"
android:value="25.3.1" />
<application
android:allowBackup="true"
android:debuggable="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity
android:name="com.domain.appname.view.MainActivity"
android:noHistory="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.domain.appname.view.TabbedActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/app_name"
android:noHistory="true"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.NoActionBar" >
</activity>
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="25" />
</application>
</manifest>
Later edit
I've went back to Android Studio 2.3, and set the gradle plugin back to 2.3.2, and here's how the automatically generated AndroidManifest.xml looks like now:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.domain.appname.test" >
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="26" />
<instrumentation
android:name="android.support.test.runner.AndroidJUnitRunner"
android:functionalTest="false"
android:handleProfiling="false"
android:label="Tests for com.domain.appname"
android:targetPackage="com.domain.appname" />
<application>
<uses-library android:name="android.test.runner" />
</application>
</manifest>
Now everything works as usual, however, note the difference between the automatically generated Manifest file under gradle 3.0.0 and the one under gradle 2.3.2
I guess I'll have to wait until someone finds a solution to make this work under gradle 3.0.0 and in the meantime use the gradle plugin 2.3.2 in Android Studio 3.0 (which I'm doing right now and it works).
So the issue is with the new gradle 3.0.0-alpha9
You probably have a dependency library (aar) that has a <uses-sdk> inside the application tag in the manifest. So when that gets merged, your app will have the incorrect usage also.
This happened to me with an old local build of vlc for Android.
I had a category element in my Manifest file inside a regular activity which was causing build failure. removing it after updating to as3-rc1 and build tool 26+ my issue was resolved. Hope this helps someone.
<activity
android:name=".AboutUsActivity"
android:label="#string/title_activity_about_us"
android:parentActivityName=".MainActivity"
android:theme="#style/AppTheme.NoActionBar">
<category android:name="android.intent.category.DEFAULT" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.MainActivity" />
</activity>
if problem remains, please check this official tutorial on migrate to Gragle plugin v. 3.0.0.
Got the same error, in my case there was typo in meta_data instead of meta-data in the Manifest file preventing a build.
So I've an Android lib that I made, that library has an activity a service and some permissions declared in the lib manifest.
I also have a demo app which uses the lib jar. So what I want to do is to use that lib on that demo app or any other app without having to declare the activity, the service and if possible the permissions each time I use the lib.
If I don't declare the activity, the service and the permissions in the demo app my demo app crashes on runtime. As far as I know; Android merges the manifests but I don't thinks that its doing it.
Here is my lib manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mylib">
<!-- This app records A/V content from camera and stores it to disk -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_VIDEO" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application>
<activity android:theme="#style/Transparent"
android:name="org.mylib.activities.CheckStoragePermissionsActivity"/>
<service android:theme="#style/Transparent" android:name="org.mylib.services.BackgroundVideoRecorder"/>
</application>
</manifest>
and here is my demo app manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="mx.mydemo">
<application
android:name=".App"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".activity.LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.RegisterUserActivity" />
<activity android:name=".activity.LogGameDataActivity" />
<activity android:name=".activity.GameResultsActivity" />
<activity android:name=".activity.PasswordResetActivity" />
</application>
</manifest>
Is there something wrong in any of my manifest that is not allowing them to be merged? Does the lib manifest package and the demo app manifest package needs to be the same package?
Greetings
By the way the lib and the demo app are 2 different and separate projects I'am pasting the lib jar in the demo lib folder and then I'm telling android studio to import the jar as a library.
That is not going to work. The JAR is just Java code; it does not contain the manifest, resources, or assets from the library module.
Either:
Move these into one project as separate modules, then use compile project() syntax in the demo project to pull in the library module, or
Publish the library module as an AAR to an artifact repository (a local one on your development machine, Maven Central, JCenter, whatever), and have the demo app pull it in from there, or
Copy the AAR, not the JAR, from the library project into the demo project
I strongly recommend either of the first two options.
So i followed this guide https://developers.google.com/maps/documentation/android-api/signup
and created a new Google Developer Console project in here
https://console.developers.google.com/home
I put my Eclipse project package name and got the Google Key.
Now as the guide said i added this to my manifest
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="YOUR_API_KEY"/>
and after i did that i have got a lot of errors in my project and there's also an red exclamation mark near all of my projects of this workspace.
So what I'm doing wrong? I just want to start develop using google play. And please, i read all the guides in their and eclipse's and i still can't get it to go.
EDIT
I think i might missed the google play services library. I cant find where to download it.
manifest: as requested.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.minyan.get.dl"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="23" />
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission
android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MyLocation"
android:label="#string/title_activity_my_location" >
</activity>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCzVDpAckc5p3DGRIJsco-CyIiFfjgn--k />
</application>
</manifest>
Like in the guides the <meta data /> is in the application tag.
To make the Google Play services APIs available to your app:
Copy the library project at <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/ to the location where you maintain your Android app projects.
Import the library project into your Eclipse workspace. Click File > Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.
After you've added the Google Play services library as a dependency for your app project, open your app's manifest file and add the following tag as a child of the <application> element:
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
Basically google play services library is not needed to download, it resides in your SDK only
and here is the path, you can find the library
.../sdk/extras/google/google_play_services/libproject/google-play-services_lib
I think the following could solve your problem:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCzVDpAckc5p3DGRIJsco-CyIiFfjgn--k" />
^
!