0

I am a beginner at android, however I have tried developing simple android apps using IntelliJ idea. But when I tried developing sony small apps in IntelliJ idea, it does not work. When I try to run the application it say MainActivity is not a type of Activity.

My MainActivity extends SmallApplication provided by the Sony SDK.

Has anybody tried using sony small apps sdk with intelliJ idea or is there any work around for it to work..??

4 Answers4

0

Just verify your code as below,

import android.app.Activity;
public class MainActivity extends Activity {

 //Your body element

}

Extend Activity with you main activity

Kirtikumar A.
  • 4,140
  • 43
  • 43
0

File -> Project Structure -> Libraries add and link to jar file

Then add the jar to the libs folder of your project so it is compiled with the apk. Otherwise it will not run on your device.

Agnfolie
  • 21
  • 3
0

Ok, I figured our the everytime you click the run application button and choose a device, IntelliJ tries to install and app and start the main activity. So I set the run configuration to 'Do not Launch Activity', which helped solve my problem.

So now when I 'Run' my application, IntelliJ opens up the emulator and installs my app. Because Sony Small applications have to be run through a special application called SmallApps launcher, I manually run the application.

0

Small apps is a service NOT an activity. You need to edit the manifest and replace the activity to service ..see the correct manifest for small app:

    <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.smallapp.example" 
android:versionCode="1" 
android:versionName="1.0">
       <uses-sdk android:minSdkVersion="15" /> 
       <uses-permission android:name="com.sony.smallapp.permission.SMALLAPP" />

       <application 
       android:icon="@drawable/ic_launcher"   android:label="@string/app_name">
       <uses-library android:name="com.sony.smallapp.framework" />
    <service 
            android:name=".MainActivity" 
            android:exported="true" >

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

    </service>

Done Dos
  • 13
  • 4