• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Help me import an android project

Michael Pogi

Lurker
Jun 27, 2015
2
0
Hi, I'm a newbie in Android Programming. I'm going to import project maybe made from Eclipse Android to Android Studio, but I encounter an error:

Invalid XML file: D:\AndroidManifest.xml:
Content is not allowed in prolog.

The contents of AndroidManifest.xml is:

<?xml version="1.0" encoding="utf-8"?>

<!--
/*
* Wifi Connector
*
* Copyright (c) 2011 Kevin Yuan (farproc@gmail.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
**/
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.farproc.wifi.connecter"
android:versionCode="15"
android:versionName="2.0.2"
android:installLocation="auto">

<uses-sdk
android:minSdkVersion="3"
android:targetSdkVersion="14"/>

<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>

<application android:icon="@drawable/icon"
android:label="@String/app_name" >

<!--
<activity android:name=".TestWifiScan">

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

</activity>

-->

<activity android:name="MainActivity"
android:theme="@Style/PlatformDialog"
android:launchMode="singleInstance"
android:excludeFromRecents="true"
android:noHistory="true">

<intent-filter>
<category android:name="android.intent.category.INFO" />
</intent-filter>

<intent-filter>
<action android:name="com.farproc.wifi.connecter.action.CONNECT_OR_EDIT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>

</activity>


<service android:name="ReenableAllApsWhenNetworkStateChanged$BackgroundService"/>

</application>

</manifest>

How can I fix this? Thanks.
 
@Michael Pogi

Seems like you have an old format. Try this and see if it works...
XML:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.farproc.wifi.connecter" >

    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>

    <application
        android:icon="@drawable/icon"
        android:label="@String/app_name" >

        <activity
            android:name="MainActivity"
            android:theme="@Style/PlatformDialog"
            android:launchMode="singleInstance"
            android:excludeFromRecents="true"
            android:noHistory="true">

            <intent-filter>
                <category android:name="android.intent.category.INFO" />
            </intent-filter>

            <intent-filter>
                <action android:name="com.farproc.wifi.connecter.action.CONNECT_OR_EDIT" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>

        </activity>

        <service android:name="ReenableAllApsWhenNetworkStateChanged$BackgroundService"/>

    </application>

</manifest>

You can set the version code, version name, min sdk, and target sdk in the "build.gradle" file for your app in Android Studio.
 
  • Like
Reactions: codesplice
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones