Few days back I wanted to try Crittercism's NDK library and ended up facing the following error in Eclipse after following exactly the same steps given on their site.
The library 'crittercism_v4_5_1_ndk.jar' contains native libraries that will not run on the device.
The following libraries were found:
- assets/armeabi-v7a/libcrittercism-ndk.so
- assets/armeabi/libcrittercism-ndk.so
This error could be avoided by the following Steps.
Eclipse Preference ->Android->Build->Un Check "Force error when external jars contain native libraries"
Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts
Monday, May 19, 2014
Monday, January 6, 2014
Disable CellBroadcast in Cyanogenmod
The problem started last week when I started receiving Cell Broadcast alerts non stop all day. My phone is Samsung Galaxy S2 and was running on latest version of Cynogenmod. After searching in some Android forums I found a way to disable all kinds of cell broadcast by using option in Message application.
Message->Menu->Cell Broadcast
Even after doing so the problem did not go away. Finally after lot of searching I found a way to do this. Use Terminal Emulator and execute the following commands.
Message->Menu->Cell Broadcast
Even after doing so the problem did not go away. Finally after lot of searching I found a way to do this. Use Terminal Emulator and execute the following commands.
su
mount -orw,remount /system
rm /system/app/CellBroadcastingReceiver.apk
reboot
Monday, February 11, 2013
Handling Home Key in Android
I recently came across "Todler lock" application which had lot of interesting features. One of the most intriguing feature was handling of Home key event.
1.Create a Activity Alias
We use Activity alias in order to programmatically enable or disable home screen launcher. An alias of an activity acts as an independent entity and intent filters that are not in the original activity can be added.
Declare your activity and declare an alias for your activity with the following intent filters
[xml]
<activity
android:name="com.vkslabs.example.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-alias
android:name=".MainActivityAlias"
android:targetActivity="com.vkslabs.example.MainActivity"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
</intent-filter>
</activity-alias>
[/xml]
2. Enabling and disabling component using setComponentEnabledSetting
[java]
PackageManager manager = getPackageManager();
ComponentName compName = new ComponentName("com.vkslabs.example", "com.vkslabs.example.MainActivityAlias");
//ComponentName compName = new ComponentName("<Package Name>", "<Package Name.Alias Name>");
manager.setComponentEnabledSetting(compName,
PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
[/java]
You can use COMPONENT_ENABLED_STATE_DISABLED for disabling the alias.
1.Create a Activity Alias
We use Activity alias in order to programmatically enable or disable home screen launcher. An alias of an activity acts as an independent entity and intent filters that are not in the original activity can be added.
Declare your activity and declare an alias for your activity with the following intent filters
[xml]
<activity
android:name="com.vkslabs.example.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-alias
android:name=".MainActivityAlias"
android:targetActivity="com.vkslabs.example.MainActivity"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.MONKEY"/>
</intent-filter>
</activity-alias>
[/xml]
2. Enabling and disabling component using setComponentEnabledSetting
[java]
PackageManager manager = getPackageManager();
ComponentName compName = new ComponentName("com.vkslabs.example", "com.vkslabs.example.MainActivityAlias");
//ComponentName compName = new ComponentName("<Package Name>", "<Package Name.Alias Name>");
manager.setComponentEnabledSetting(compName,
PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
[/java]
You can use COMPONENT_ENABLED_STATE_DISABLED for disabling the alias.
Thursday, January 31, 2013
Saving bitmap buffer as bitmap image
Eclipse Memory Analyzer doesn’t provide option to view a bitmap buffer directly. Try the following steps that will allow you to save the bitmap buffer as a bitmap image that you can view using any image viewer.
Once you have saved the bitmap buffer you will have to convert the bitmap buffer to bitmap for which you will need to know height and width of the bitmap.
You can use the inspector window to view the height and width of the bitmap. If inspector window is not available you can enable it using the following option.
Once you have the bitmap buffer, bitmap dimension you can execute the attached java program with the following command line option.
[code]
Java MATBitmap.java <input.bmp> <output.bmp> <bitmap width> <bitmap height>
[/code]
Example
[code]
java MATBitmap debug.bmp converted.bmp 800 800
[/code]
Bingo! now you can open the converted.bmp in any image editor.
Download MATBitmap.java
1. Select the bitmap buffer that you would like to Save
2. Save the buffer to your computer
Select the Location in your computer where you would like to save the buffer file. You can give any name and extension
3. Enable inspector view in Eclipse
Once you have saved the bitmap buffer you will have to convert the bitmap buffer to bitmap for which you will need to know height and width of the bitmap.
You can use the inspector window to view the height and width of the bitmap. If inspector window is not available you can enable it using the following option.
4. Find the dimension of the bitmap
5. Convert the bitmap buffer in to bitmap image
Once you have the bitmap buffer, bitmap dimension you can execute the attached java program with the following command line option.
[code]
Java MATBitmap.java <input.bmp> <output.bmp> <bitmap width> <bitmap height>
[/code]
Example
[code]
java MATBitmap debug.bmp converted.bmp 800 800
[/code]
Bingo! now you can open the converted.bmp in any image editor.
Download MATBitmap.java
Fixing Bitmap memory leaks in Android
The biggest hurdle for Android developers is memory leaks. Especially if you are using a lot of images you tend to see memory leaks more often. Android internally handles the images as Bitmaps so even if the images used are optimized or of low quality it takes the same amount of memory. For example an image of size 800X600 takes 4 bytes per pixel which means the size will be 1.8 MB (4*800*600 = 1920000 bytes) whereas the same image will be 200 KB – 600 KB based on the quality of the image.
If you are facing frequent Out Of Memory errors then the first handy tool will be DDMS and Memory Analyzer tool (MAT).
Whenever you take memory dump you could see that there are bitmaps held in heap but most of the time you will not be able to find which image exactly the bitmap instance holds. MAT doesn’t provide an easy way to view the bitmap image held in a bitmap objects.
You can do the following steps to view the image in the bitmap buffer.
If you are facing frequent Out Of Memory errors then the first handy tool will be DDMS and Memory Analyzer tool (MAT).
Whenever you take memory dump you could see that there are bitmaps held in heap but most of the time you will not be able to find which image exactly the bitmap instance holds. MAT doesn’t provide an easy way to view the bitmap image held in a bitmap objects.
You can do the following steps to view the image in the bitmap buffer.
Friday, April 13, 2012
Starting with JPA with JBoss and MySQL
Environment
Note: Make sure the datasource is configured properly. Visit the post (http://vkslabs.com/adding-mysql-data-store-to-jboss-7-x/) to find out how to configure datasource.
Step 1: Configure persistence.xml
Create a file called persistence.xml and add the following content
[xml]
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="testjpa" transaction-type="RESOURCE_LOCAL">
<jta-data-source>java:jboss/datasources/myDS</jta-data-source>
<class>com.test.StudentBean</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.transaction.jta.platform"
value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" />
</properties>
</persistence-unit>
</persistence>
[/xml]
Make sure the datasource name matches the datasource configured in JBoss
Step 2: Create your bean
Create the bean which you would like to persist
[java]
package com.test;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity (name="student")
public class StudentBean {
@Id
@GeneratedValue
private int id;
private String name;
private int age;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
[/java]
Step 3: Persist your bean using EMF
[java]
EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("testjpa");
EntityManager em = entityManagerFactory.createEntityManager();
EntityTransaction userTransaction = em.getTransaction();
userTransaction.begin();
StudentBean student = new StudentBean();
student.setName(name);
student.setAge(age);
em.persist(student);
em.flush();
userTransaction.commit();
em.close();
entityManagerFactory.close();
[/java]
Note:
validate: validate the schema, makes no changes to the database.
update: update the schema.
create: creates the schema, destroying previous data.
create-drop: drop the schema at the end of the session.
The META-INF folder where persistence.xml is present should be in classpath but for JPA the root of the persistence unit is the WEB-INF/classes directory hence the persistence.xml should be copied in to WEB-INF/classes/META-INF folder (You might have to create META-INF folder manually).
If the persistence.xml is not created in the right folder the following error will be encountered
- JBoss 7.1.1
- MySQL 5.5
Note: Make sure the datasource is configured properly. Visit the post (http://vkslabs.com/adding-mysql-data-store-to-jboss-7-x/) to find out how to configure datasource.
Step 1: Configure persistence.xml
Create a file called persistence.xml and add the following content
[xml]
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="testjpa" transaction-type="RESOURCE_LOCAL">
<jta-data-source>java:jboss/datasources/myDS</jta-data-source>
<class>com.test.StudentBean</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.transaction.jta.platform"
value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" />
</properties>
</persistence-unit>
</persistence>
[/xml]
Make sure the datasource name matches the datasource configured in JBoss
Step 2: Create your bean
Create the bean which you would like to persist
[java]
package com.test;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity (name="student")
public class StudentBean {
@Id
@GeneratedValue
private int id;
private String name;
private int age;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
[/java]
- @Entity annotations should be mentioned to denote the bean is a entity bean
- @Id annotation makes the field as primary key of the table
- @GeneratedValue annotation makes the field value as auto generated
Step 3: Persist your bean using EMF
[java]
EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory("testjpa");
EntityManager em = entityManagerFactory.createEntityManager();
EntityTransaction userTransaction = em.getTransaction();
userTransaction.begin();
StudentBean student = new StudentBean();
student.setName(name);
student.setAge(age);
em.persist(student);
em.flush();
userTransaction.commit();
em.close();
entityManagerFactory.close();
[/java]
- testjpa is the name of persistence-unit in the persistence.xml
- Calling persist() just marks the bean for persistence and might not populate DB immediately, in order to see the data in database immediately flush() must be called.
Note:
- The value for the property hibernate.hbm2ddl.auto can be
validate: validate the schema, makes no changes to the database.
update: update the schema.
create: creates the schema, destroying previous data.
create-drop: drop the schema at the end of the session.
- In case there is no exception when bean is persisted but no row is found in DB then make sure the value for the property hibernate.hbm2ddl.auto is not set to create-drop
- Important: The common mistake the developers make is to create the file in the META-INF folder under the project folder which is wrong.
The META-INF folder where persistence.xml is present should be in classpath but for JPA the root of the persistence unit is the WEB-INF/classes directory hence the persistence.xml should be copied in to WEB-INF/classes/META-INF folder (You might have to create META-INF folder manually).
If the persistence.xml is not created in the right folder the following error will be encountered
javax.persistence.PersistenceException: No Persistence provider for EntityManager named testjpa: No META-INF/persistence.xml was found in classpath.
- In case you face the following exception make sure the persistence.xml has the attribute transaction-type="RESOURCE_LOCAL"
ERROR [stderr] (http-localhost-127.0.0.1-8080-1) java.lang.NullPointerException
ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.getStatus(JtaStatusHelper.java:73)
ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.hibernate.engine.transaction.internal.jta.JtaStatusHelper.isActive(JtaStatusHelper.java:115)
ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.hibernate.engine.transaction.internal.jta.CMTTransaction.join(CMTTransaction.java:149)
ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1207)
ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.hibernate.ejb.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:176)
ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.hibernate.ejb.EntityManagerImpl.<init>(EntityManagerImpl.java:89)
ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:125)
ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:120)
Wednesday, April 4, 2012
Android Marketplace APIs
Google known for releasing API for every service it offers has still not opened up their marketplace for the developers. There is no official API to access the marketplace and execute a search. But I came across this interesting project that uses the protobuf (The protocol that Google uses for almost all structured data communication).
http://code.google.com/p/android-market-api/
This is a Java implementation of the unofficial marketplace APIs and the site also has links to projects on other languages such as Ruby and PHP. Since this is an unofficial API there are many glitches for instance you cannot search beyond the 500th app details if your search query returns more than 500 results.
Searching by keyword
[java]
String query = "india";
AppsRequest appsRequest = AppsRequest.newBuilder()
.setQuery(query)
.setStartIndex(0).setEntriesCount(10)
.setWithExtendedInfo(true)
.build();
session.append(appsRequest, new Callback<AppsResponse>() {
public void onResult(ResponseContext context, AppsResponse response) {
//Process the response here
List<App> list = appsResponse.getAppList();
int count = appsResponse.getAppCount();
for (int i = 0; i< count; i++)
{
App app = list.get(i);
System.out.println(" App Title is :: "+app.getTitle() +" App Price:: "+app.getPrice() +" App Rating :: "+app.getRating() +" App Ratings Count :: "+app.getRatingsCount());
}
}
});
[/java]
You can query apps based on the Package Name as well as publisher name.
Search By Package Name
String query = "pname:<package name>"
eg: String query = "pname:com.vkslabs.buybooks";
Search By Publisher
String query = "pub:<publisher name>";
eg: String query = "pub:vkslabs";
Troubleshooting
If the search API works for keyword based search but not for package name or publisher name search then it might be due to the invalid Android ID. You need to set a valid Android ID for the API to work properly.
How to get a valid Android ID?
session.getContext().setAndroidId("XXXXXXXXXX");
http://code.google.com/p/android-market-api/
This is a Java implementation of the unofficial marketplace APIs and the site also has links to projects on other languages such as Ruby and PHP. Since this is an unofficial API there are many glitches for instance you cannot search beyond the 500th app details if your search query returns more than 500 results.
Searching by keyword
[java]
String query = "india";
AppsRequest appsRequest = AppsRequest.newBuilder()
.setQuery(query)
.setStartIndex(0).setEntriesCount(10)
.setWithExtendedInfo(true)
.build();
session.append(appsRequest, new Callback<AppsResponse>() {
public void onResult(ResponseContext context, AppsResponse response) {
//Process the response here
List<App> list = appsResponse.getAppList();
int count = appsResponse.getAppCount();
for (int i = 0; i< count; i++)
{
App app = list.get(i);
System.out.println(" App Title is :: "+app.getTitle() +" App Price:: "+app.getPrice() +" App Rating :: "+app.getRating() +" App Ratings Count :: "+app.getRatingsCount());
}
}
});
[/java]
You can query apps based on the Package Name as well as publisher name.
Search By Package Name
String query = "pname:<package name>"
eg: String query = "pname:com.vkslabs.buybooks";
Search By Publisher
String query = "pub:<publisher name>";
eg: String query = "pub:vkslabs";
Troubleshooting
If the search API works for keyword based search but not for package name or publisher name search then it might be due to the invalid Android ID. You need to set a valid Android ID for the API to work properly.
How to get a valid Android ID?
- Install the application "Android System Info" from Marketplace and launch the app.
- Goto Menu -> More -> Gtalk Service Monitor
- Find the line aid:<Android ID value> (this is usually the second line in the screen)
- Copy the value and set it as the Android ID in the MarketSession using the API
session.getContext().setAndroidId("XXXXXXXXXX");
Monday, March 26, 2012
Android Emulator won't connect to internet
Many a time I see this problem where the Android emulator simply refuses to connect to internet. There are 2 easy solutions to fix this problem.
1. The primary reason is that your machine might have both LAN and Wireless enabled and the internet connection is available only on Wireless. Since the emulator always tries LAN to for DNS settings it will be unable to connect. To fix this problem
2. If the above solution doesn't work then try launching your emulator with the following command prompt.
or if you are using eclipse to start the emulator then

1. The primary reason is that your machine might have both LAN and Wireless enabled and the internet connection is available only on Wireless. Since the emulator always tries LAN to for DNS settings it will be unable to connect. To fix this problem
- Right click on your "My Network Places" and select properties
- Select your LAN connection and disable it.
- Restart your emulator
2. If the above solution doesn't work then try launching your emulator with the following command prompt.
emulator -avd <avd name> -verbose -dns-server 8.8.8.8
or if you are using eclipse to start the emulator then
- Right click on your project and select "debug as"
- Select "debug configuration" and select "target" tab
- Enter the following text in the text field below "Additional Emulator Command Line Options"
-dns-server 8.8.8.8
- The above steps applies to "Run Configuration" as well.
Tuesday, March 20, 2012
ProgressDialog with custom view
In one of my application I had to download data from server which took almost 10-15 seconds and I didn't want my users to stare at a progress dialog with just loading message.
I wanted to customize the default ProgressDialog to display interesting facts so that the user feels that they are waiting too long for the data.
My first step was to create my own layout and set the layout using the method setContentView method. But seems this method though available but cannot be used since it throws the following error
So I tried to write my own dialog by sub classing Dialog but figured out that there is a better way by sub classing AlertDialog.
[java]
AlertDialog.Builder builder = new AlertDialog.Builder(context);
progressView = LayoutInflater.from(context).inflate(R.layout.progress_dyk, null);
builder.setView(progressView);
progress = builder.create();
progress.requestWindowFeature(Window.FEATURE_NO_TITLE);
progress.show();
[/java]
I wanted to customize the default ProgressDialog to display interesting facts so that the user feels that they are waiting too long for the data.
My first step was to create my own layout and set the layout using the method setContentView method. But seems this method though available but cannot be used since it throws the following error
android.util.AndroidRuntimeException: requestFeature() must be called before adding content
So I tried to write my own dialog by sub classing Dialog but figured out that there is a better way by sub classing AlertDialog.
[java]
AlertDialog.Builder builder = new AlertDialog.Builder(context);
progressView = LayoutInflater.from(context).inflate(R.layout.progress_dyk, null);
builder.setView(progressView);
progress = builder.create();
progress.requestWindowFeature(Window.FEATURE_NO_TITLE);
progress.show();
[/java]
Eclipse: JVM Terminated. Exit code=-1
I have been using my eclipse instance for months and on the day of a crucial release it stopped working (May be just to prove Murphy's law). I had several instance of eclipse (I usually have different instance for J2EE, Android, Blackberry etc) and all the instance showed me exactly the same error.
[xml]
JVM terminated. Exit code=-1
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-XX:MaxPermSize=512M
-Djava.class.path=D:eclipseAndroideclipseplugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
-os win32
-ws win32
-arch x86
-showsplash
-launcher D:eclipseAndroideclipseeclipse.exe
-name Eclipse
--launcher.library D:eclipseAndroideclipseplugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519eclipse_1206.dll
-startup D:eclipseAndroideclipseplugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
-product org.eclipse.epp.package.java.product org.eclipse.platform
-vm C:Javajre6binclientjvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-XX:MaxPermSize=512M
-Djava.class.path=D:eclipseAndroideclipseplugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
[/xml]
Tweaking all the memory size parameters in eclipse.ini but irrespective of whatever permutation and combination I tried it didn't budge.
I then removed all the contents of eclipse.ini and voila! it worked perfectly but then I thought these values are there for a reason and removing everything might cause some other issue. Hence I started putting back the values one by one and figured out that removing the following 2 lines in the ini file fixed the problem.
[java]
--launcher.XXMaxPermSize
512M
--launcher.XXMaxPermSize
512M
[/java]
After pin pointing the problem area I added these parameters but tried with different values and after trial and error found that value 128M worked perfectly. Now the final eclipse.ini looks like the one shown below.
[java]
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.java.product
-showsplash
--launcher.XXMaxPermSize
128M
--launcher.XXMaxPermSize
128M
org.eclipse.platform
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
[/java]
I am still not sure what is the root cause of this issue. May be restarting the machine and reverting back the value to 512 M might do the trick.
[xml]
JVM terminated. Exit code=-1
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-XX:MaxPermSize=512M
-Djava.class.path=D:eclipseAndroideclipseplugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
-os win32
-ws win32
-arch x86
-showsplash
-launcher D:eclipseAndroideclipseeclipse.exe
-name Eclipse
--launcher.library D:eclipseAndroideclipseplugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519eclipse_1206.dll
-startup D:eclipseAndroideclipseplugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
-product org.eclipse.epp.package.java.product org.eclipse.platform
-vm C:Javajre6binclientjvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-XX:MaxPermSize=512M
-Djava.class.path=D:eclipseAndroideclipseplugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
[/xml]
Tweaking all the memory size parameters in eclipse.ini but irrespective of whatever permutation and combination I tried it didn't budge.
I then removed all the contents of eclipse.ini and voila! it worked perfectly but then I thought these values are there for a reason and removing everything might cause some other issue. Hence I started putting back the values one by one and figured out that removing the following 2 lines in the ini file fixed the problem.
[java]
--launcher.XXMaxPermSize
512M
--launcher.XXMaxPermSize
512M
[/java]
After pin pointing the problem area I added these parameters but tried with different values and after trial and error found that value 128M worked perfectly. Now the final eclipse.ini looks like the one shown below.
[java]
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.java.product
-showsplash
--launcher.XXMaxPermSize
128M
--launcher.XXMaxPermSize
128M
org.eclipse.platform
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
[/java]
I am still not sure what is the root cause of this issue. May be restarting the machine and reverting back the value to 512 M might do the trick.
Subscribe to:
Posts (Atom)